import { TableOptions } from '@nocobase/database'; export default { name: 'tabs', title: '标签配置', sortable: true, model: 'TabModel', developerMode: true, fields: [ { interface: 'sort', type: 'integer', name: 'sort', title: '排序', component: { type: 'sort', className: 'drag-visible', width: 60, showInTable: true, }, }, { interface: 'string', type: 'string', name: 'title', title: '名称', component: { type: 'string', className: 'drag-visible', showInTable: true, showInDetail: true, showInForm: true, }, }, { interface: 'string', type: 'string', name: 'name', title: '标识', component: { type: 'string', showInTable: true, showInDetail: true, showInForm: true, }, }, { interface: 'radio', type: 'string', name: 'type', title: '类型', dataSource: [ { label: '详情数据', value: 'details' }, { label: '相关数据', value: 'association' }, { label: '模块组合', value: 'module', disabled: true }, ], component: { type: 'radio', showInTable: true, showInDetail: true, showInForm: true, }, }, { interface: 'string', type: 'virtual', name: 'association', title: '相关数据表', component: { type: 'string', showInDetail: true, showInForm: true, }, }, { interface: 'boolean', type: 'boolean', name: 'default', title: '默认标签页', defaultValue: false, component: { type: 'checkbox', showInTable: true, showInDetail: true, showInForm: true, }, }, { interface: 'boolean', type: 'boolean', name: 'enabled', title: '启动', defaultValue: false, component: { type: 'checkbox', showInTable: true, showInDetail: true, showInForm: true, }, }, { interface: 'boolean', type: 'boolean', name: 'developerMode', title: '开发者模式', defaultValue: false, component: { type: 'boolean', }, }, { interface: 'linkTo', type: 'belongsTo', name: 'collection', title: '所属数据表', target: 'collections', targetKey: 'name', component: { type: 'drawerSelect', }, }, { interface: 'json', type: 'json', name: 'options', title: '配置信息', defaultValue: {}, component: { type: 'hidden', }, }, ], actions: [ { type: 'list', name: 'list', title: '查看', }, { type: 'create', name: 'create', title: '创建', viewName: 'form', }, { type: 'update', name: 'update', title: '编辑', viewName: 'form', }, { type: 'destroy', name: 'destroy', title: '删除', }, ], views: [ { type: 'form', name: 'form', title: '表单', template: 'DrawerForm', developerMode: true, }, { type: 'details', name: 'details', title: '详情', template: 'Details', actionNames: ['update'], developerMode: true, }, { type: 'table', name: 'simple', title: '简易模式', template: 'SimpleTable', default: true, actionNames: ['create', 'destroy'], detailsViewName: 'details', updateViewName: 'form', paginated: false, }, { type: 'table', name: 'table', title: '列表', template: 'Table', actionNames: ['create', 'destroy'], }, ], } as TableOptions;