fix: improve createdBy/updatedBy default options

This commit is contained in:
chenos 2020-12-18 15:32:45 +08:00
parent 110d5bcc9c
commit a351d52226
2 changed files with 14 additions and 4 deletions

View File

@ -3,6 +3,8 @@ import { TableOptions } from '@nocobase/database';
export default { export default {
title: '示例', title: '示例',
showInDataMenu: true, showInDataMenu: true,
createdBy: true,
updatedBy: true,
fields: [ fields: [
{ {
interface: 'string', interface: 'string',

View File

@ -340,12 +340,16 @@ export const linkTo = {
export const createdBy = { export const createdBy = {
title: '创建者', title: '创建者',
disabled: true, // disabled: true,
options: { options: {
interface: 'createdBy', interface: 'createdBy',
type: 'belongsTo', type: 'createdBy',
name: 'createdBy', name: 'createdBy',
filterable: true, filterable: true,
target: 'users',
labelField: 'nickname',
foreignKey: 'created_by_id',
appends: true,
component: { component: {
type: 'drawerSelect', type: 'drawerSelect',
}, },
@ -372,12 +376,16 @@ export const createdAt = {
export const updatedBy = { export const updatedBy = {
title: '更新人', title: '更新人',
disabled: true, // disabled: true,
options: { options: {
interface: 'updatedBy', interface: 'updatedBy',
name: 'updatedBy', name: 'updatedBy',
type: 'belongsTo', type: 'updatedBy',
filterable: true, filterable: true,
target: 'users',
labelField: 'nickname',
foreignKey: 'created_by_id',
appends: true,
component: { component: {
type: 'drawerSelect', type: 'drawerSelect',
}, },