create.config.ts
1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import {
SaveToCustomTableFieldsEnum,
SaveToCustomTableFieldsNameEnum,
} from '../../../enum/formField/action';
import { AttributeConfiguration } from '../../../src/components/AttributeConfiguration';
import { FormSchema, useComponentRegister } from '/@/components/Form';
import { isObject } from '/@/utils/is';
useComponentRegister('AttributeConfiguration', AttributeConfiguration);
export const formSchemas: FormSchema[] = [
{
field: SaveToCustomTableFieldsEnum.TABLE_NAME,
component: 'Input',
label: SaveToCustomTableFieldsNameEnum.TABLE_NAME,
required: true,
componentProps: {
placeholder: `请输入${SaveToCustomTableFieldsEnum.TABLE_NAME}`,
},
},
{
field: SaveToCustomTableFieldsEnum.FIELDS_MAPPING,
component: 'AttributeConfiguration',
label: SaveToCustomTableFieldsNameEnum.FIELDS_MAPPING,
required: true,
valueField: 'value',
changeEvent: 'update:value',
rules: [
{
required: true,
validator(_rule, value) {
if (!isObject(value) || !Object.keys(value).length)
return Promise.reject('至少应该指定一个字段映射。');
return Promise.resolve();
},
},
],
slot: SaveToCustomTableFieldsEnum.FIELDS_MAPPING,
},
];