fix: show the relationship fields of the sub table
This commit is contained in:
parent
435cd9a7c9
commit
8861e282cb
@ -142,13 +142,58 @@ export default {
|
||||
},
|
||||
{
|
||||
interface: 'textarea',
|
||||
title: '内容',
|
||||
title: '内容1',
|
||||
component: {
|
||||
showInTable: true,
|
||||
showInDetail: true,
|
||||
showInForm: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
interface: 'textarea',
|
||||
title: '内容2',
|
||||
component: {
|
||||
showInTable: true,
|
||||
showInDetail: true,
|
||||
showInForm: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
interface: 'createdBy',
|
||||
title: '创建人',
|
||||
component: {
|
||||
showInTable: true,
|
||||
showInDetail: true,
|
||||
// showInForm: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
interface: 'updatedBy',
|
||||
title: '更新人',
|
||||
component: {
|
||||
showInTable: true,
|
||||
showInDetail: true,
|
||||
// showInForm: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
interface: 'createdAt',
|
||||
title: '创建日期',
|
||||
component: {
|
||||
showInTable: true,
|
||||
showInDetail: true,
|
||||
// showInForm: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
interface: 'updatedAt',
|
||||
title: '更新日期',
|
||||
component: {
|
||||
showInTable: true,
|
||||
showInDetail: true,
|
||||
// showInForm: true,
|
||||
},
|
||||
}
|
||||
],
|
||||
component: {
|
||||
// showInTable: true,
|
||||
|
@ -245,6 +245,17 @@ export default async (ctx, next) => {
|
||||
if (field.get('interface') === 'attachment') {
|
||||
appends.push(`${field.name}.storage`);
|
||||
}
|
||||
if (field.get('interface') === 'subTable') {
|
||||
const children = await field.getChildren();
|
||||
console.log(children);
|
||||
for (const child of children) {
|
||||
if (!['subTable', 'linkTo', 'attachment', 'updatedBy', 'createdBy'].includes(child.get('interface'))) {
|
||||
continue;
|
||||
}
|
||||
console.log(child.name);
|
||||
appends.push(`${field.name}.${child.name}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
actionDefaultParams['fields[appends]'] = appends.join(',');
|
||||
|
Loading…
Reference in New Issue
Block a user