mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 05:57:53 +00:00
fix: use simple table for the association tab view
This commit is contained in:
parent
cf47b9f282
commit
94c386e7aa
@ -29,6 +29,7 @@ export function CollectionTabPane(props) {
|
||||
<ViewFactory
|
||||
{...props}
|
||||
viewName={viewName}
|
||||
isAssociationView={true}
|
||||
{...params}
|
||||
/>
|
||||
</div>
|
||||
|
@ -49,6 +49,7 @@ export default function ViewFactory(props: ViewProps) {
|
||||
viewName,
|
||||
mode,
|
||||
reference,
|
||||
isAssociationView = false,
|
||||
} = props;
|
||||
console.log('propspropspropspropspropspropsprops', props);
|
||||
const { data = {}, loading } = useRequest(() => {
|
||||
@ -67,7 +68,10 @@ export default function ViewFactory(props: ViewProps) {
|
||||
if (loading) {
|
||||
return <Spin/>;
|
||||
}
|
||||
const { template } = data;
|
||||
let { template } = data;
|
||||
if (isAssociationView && template === 'Table') {
|
||||
template = 'SimpleTable';
|
||||
}
|
||||
const Template = getViewTemplate(template);
|
||||
return Template && <Template {...props} ref={reference} schema={data}/>;
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ export default async (ctx, next) => {
|
||||
view.setDataValue('defaultTabName', get(defaultTabs, [0, 'name']));
|
||||
}
|
||||
|
||||
if (view.get('template') === 'SimpleTable') {
|
||||
if (view.get('type') === 'table') {
|
||||
view.setDataValue('rowViewName', 'form');
|
||||
}
|
||||
if (view.get('updateViewName')) {
|
||||
|
Loading…
Reference in New Issue
Block a user