tachybase_todo/packages/plugin-collections/src/collections/tabs.ts
chenos eb93f0734f
feat: actions & views (#18)
* feat: 视图新增支持 associated 的情况

* fix: 解决关系数据的视图问题

* 表单数据初始化

* feat: sortable table

* 排序

* 表格细节调整

* feat: field actions
2020-11-19 21:12:15 +08:00

110 lines
1.9 KiB
TypeScript

import { TableOptions } from '@nocobase/database';
export default {
name: 'tabs',
title: '标签配置',
fields: [
{
type: 'integer',
name: 'sort',
title: '排序',
component: {
type: 'sort',
className: 'drag-visible',
width: 60,
},
},
{
type: 'string',
name: 'type',
title: '类型',
component: {
type: 'string',
className: 'drag-visible',
},
},
{
type: 'string',
name: 'name',
title: '标识',
},
{
type: 'string',
name: 'title',
title: '名称',
},
{
type: 'boolean',
name: 'default',
title: '默认标签页',
defaultValue: false,
},
{
type: 'json',
name: 'options',
},
{
type: 'belongsTo',
name: 'collection',
target: 'collections',
targetKey: 'name',
},
],
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',
},
{
type: 'details',
name: 'details',
title: '详情',
template: 'Details',
actionNames: ['update'],
},
{
type: 'table',
name: 'simple',
title: '简易模式',
template: 'SimpleTable',
default: true,
actionNames: ['create', 'destroy'],
detailsViewName: 'details',
updateViewName: 'form',
},
{
type: 'table',
name: 'table',
title: '列表',
template: 'Table',
actionNames: ['create', 'destroy'],
},
],
} as TableOptions;