SysTableWhiteList.data.ts
1.5 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import { BasicColumn, FormSchema } from '/@/components/Table';
const statusOptions = [
{ label: '禁用', value: '0' },
{ label: '启用', value: '1' },
];
export const columns: BasicColumn[] = [
{
title: '允许的表名',
dataIndex: 'tableName',
},
{
title: '允许的字段名',
dataIndex: 'fieldName',
},
{
title: '状态',
dataIndex: 'status',
customRender({ text }) {
const find = statusOptions.find((opt) => opt.value === text);
return find?.label || '未知';
},
},
{
title: '创建时间',
dataIndex: 'createTime',
},
];
export const searchFormSchema: FormSchema[] = [
{
label: '允许的表名',
field: 'tableName',
component: 'Input',
},
{
label: '允许的字段名',
field: 'fieldName',
component: 'Input',
},
{
label: '状态',
field: 'status',
component: 'Select',
componentProps: {
options: statusOptions,
},
},
];
export const formSchema: FormSchema[] = [
{ label: '', field: 'id', component: 'Input', show: false },
{
label: '允许的表名',
field: 'tableName',
component: 'Input',
required: true,
},
{
label: '允许的字段名',
field: 'fieldName',
component: 'Input',
required: true,
helpMessage: '多个用逗号分割',
},
{
label: '状态',
field: 'status',
component: 'Select',
defaultValue: '1',
componentProps: {
options: statusOptions,
},
},
];