mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 08:36:44 +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
|
<ViewFactory
|
||||||
{...props}
|
{...props}
|
||||||
viewName={viewName}
|
viewName={viewName}
|
||||||
|
isAssociationView={true}
|
||||||
{...params}
|
{...params}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -49,6 +49,7 @@ export default function ViewFactory(props: ViewProps) {
|
|||||||
viewName,
|
viewName,
|
||||||
mode,
|
mode,
|
||||||
reference,
|
reference,
|
||||||
|
isAssociationView = false,
|
||||||
} = props;
|
} = props;
|
||||||
console.log('propspropspropspropspropspropsprops', props);
|
console.log('propspropspropspropspropspropsprops', props);
|
||||||
const { data = {}, loading } = useRequest(() => {
|
const { data = {}, loading } = useRequest(() => {
|
||||||
@ -67,7 +68,10 @@ export default function ViewFactory(props: ViewProps) {
|
|||||||
if (loading) {
|
if (loading) {
|
||||||
return <Spin/>;
|
return <Spin/>;
|
||||||
}
|
}
|
||||||
const { template } = data;
|
let { template } = data;
|
||||||
|
if (isAssociationView && template === 'Table') {
|
||||||
|
template = 'SimpleTable';
|
||||||
|
}
|
||||||
const Template = getViewTemplate(template);
|
const Template = getViewTemplate(template);
|
||||||
return Template && <Template {...props} ref={reference} schema={data}/>;
|
return Template && <Template {...props} ref={reference} schema={data}/>;
|
||||||
}
|
}
|
||||||
|
@ -185,7 +185,7 @@ export default async (ctx, next) => {
|
|||||||
view.setDataValue('defaultTabName', get(defaultTabs, [0, 'name']));
|
view.setDataValue('defaultTabName', get(defaultTabs, [0, 'name']));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (view.get('template') === 'SimpleTable') {
|
if (view.get('type') === 'table') {
|
||||||
view.setDataValue('rowViewName', 'form');
|
view.setDataValue('rowViewName', 'form');
|
||||||
}
|
}
|
||||||
if (view.get('updateViewName')) {
|
if (view.get('updateViewName')) {
|
||||||
|
Loading…
Reference in New Issue
Block a user