diff --git a/packages/app/src/api/collections/example.ts b/packages/app/src/api/collections/example.ts index aa1063839..d36044a90 100644 --- a/packages/app/src/api/collections/example.ts +++ b/packages/app/src/api/collections/example.ts @@ -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, diff --git a/packages/plugin-pages/src/actions/getView.ts b/packages/plugin-pages/src/actions/getView.ts index a2c1e9cb4..7e14d4299 100644 --- a/packages/plugin-pages/src/actions/getView.ts +++ b/packages/plugin-pages/src/actions/getView.ts @@ -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(',');