tachybase_todo/packages/plugin-ui-schema/src/collections/ui_schemas.ts
2021-08-04 12:38:08 +08:00

54 lines
898 B
TypeScript

import { TableOptions } from '@nocobase/database';
export default {
name: 'ui_schemas',
title: '字段配置',
model: 'UISchema',
sortable: {
type: 'sort',
name: 'sort',
scope: ['parentKey'],
},
fields: [
{
type: 'uid',
name: 'key',
primaryKey: true,
},
// {
// type: 'sort',
// name: 'sort',
// scope: ['parentKey'],
// },
{
type: 'string',
name: 'name',
},
{
type: 'string',
name: 'title',
},
{
type: 'string',
name: 'type',
},
{
type: 'json',
name: 'options',
defaultValue: {},
},
{
type: 'boolean',
name: 'async',
defaultValue: false,
},
{
type: 'hasMany',
name: 'children',
target: 'ui_schemas',
sourceKey: 'key',
foreignKey: 'parentKey',
},
],
} as TableOptions;