Ben Lin
2024-06-02 6f6207ef6eb81d2abb3805bc2cba889ea2abd135
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
 
export const columns: BasicColumn[] = [
  {
    title: '系统参数名称',
    dataIndex: 'PARAM_NAME',
    width: 200,
    align: 'left',
  },
  {
    title: '系统参数值',
    dataIndex: 'PARAM_VALUE',
  },
  {
    title: '创建时间',
    dataIndex: 'CREATE_TIME',
  },
];
 
const isDir = (type: string) => type === '0';
const isMenu = (type: string) => type === '1';
 
export const searchFormSchema: FormSchema[] = [
  {
    field: 'menuName',
    label: '系统参数名称',
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    field: 'status',
    label: '状态',
    component: 'Select',
    componentProps: {
      options: [
        { label: '启用', value: '1' },
        { label: '停用', value: '0' },
      ],
    },
    colProps: { span: 8 },
  },
];
 
export const formSchema: FormSchema[] = [
  {
    field: 'PARAM_TYPE',
    label: '参数类别',
    component: 'RadioButtonGroup',
    defaultValue: '0',
    componentProps: {
      options: [
        { label: '系统参数组', value: '0' },
        { label: '系统参数', value: '1' },
      ],
    },
    colProps: { lg: 24, md: 24 },
  },
  {
    field: 'PRMG_TYPE',
    label: '参数组类型',
    component: 'Input',
    required: true,
    colProps: { span: 8 },
    ifShow: ({ values }) => isDir(values.PARAM_TYPE),
  },
  {
    field: 'PRMG_CODE',
    label: '上级参数组',
    component: 'TreeSelect',
    componentProps: {
      fieldNames: {
        label: 'PARAM_NAME',
        key: 'PARAM_CODE',
        value: 'PARAM_CODE',
      },
      getPopupContainer: () => document.body,
    },
    colProps: { span: 8 },
    ifShow: ({ values }) => isMenu(values.PARAM_TYPE),
  },
  {
    field: 'PARAM_CODE',
    label: '参数代码',
    component: 'Input',
    required: true,
    colProps: { span: 8 },
    // ifShow: ({ values }) => isMenu(values.PARAM_TYPE),
  },
  {
    field: 'PARAM_NAME',
    label: '参数名称',
    component: 'Input',
    required: true,
    colProps: { span: 8 },
    // ifShow: ({ values }) => isMenu(values.PARAM_TYPE),
  },
  {
    field: 'PARAM_VALUE',
    label: '参数值',
    component: 'Input',
    required: true,
    colProps: { span: 8 },
    ifShow: ({ values }) => isMenu(values.PARAM_TYPE),
  },
  {
    field: 'PARAM_DESC',
    label: '参数描述',
    component: 'Input',
    required: true,
    colProps: { span: 8 },
    ifShow: ({ values }) => isMenu(values.PARAM_TYPE),
  },
  {
    field: 'PARAM_SEQ',
    label: '排序',
    component: 'InputNumber',
    required: true,
    ifShow: ({ values }) => isMenu(values.PARAM_TYPE),
  },
  {
    field: 'DATA_1',
    label: '扩展一',
    component: 'Input',
    colProps: { span: 8 },
    ifShow: ({ values }) => isMenu(values.PARAM_TYPE),
  },
  {
    field: 'DATA_2',
    label: '扩展二',
    component: 'Input',
    colProps: { span: 8 },
    ifShow: ({ values }) => isMenu(values.PARAM_TYPE),
  },
  {
    field: 'DATA_3',
    label: '扩展三',
    component: 'Input',
    colProps: { span: 8 },
    ifShow: ({ values }) => isMenu(values.PARAM_TYPE),
  },
  {
    field: 'DATA_4',
    label: '扩展四',
    component: 'Input',
    colProps: { span: 8 },
    ifShow: ({ values }) => isMenu(values.PARAM_TYPE),
  },
  {
    field: 'DATA_5',
    label: '扩展五',
    component: 'Input',
    colProps: { span: 8 },
    ifShow: ({ values }) => isMenu(values.PARAM_TYPE),
  },
  {
    field: 'ID',
    label: '系统参数ID',
    component: 'Input',
    show: false,
  },
 
];