|
@@ -27,272 +27,288 @@ export const validateJSON = (_rule, value: ModelOfMatterParams[], _callback) => |
|
@@ -27,272 +27,288 @@ export const validateJSON = (_rule, value: ModelOfMatterParams[], _callback) => |
27
|
return Promise.reject('JSON对象不能为空');
|
27
|
return Promise.reject('JSON对象不能为空');
|
28
|
};
|
28
|
};
|
29
|
|
29
|
|
30
|
-export const formSchemas: FormSchema[] = [
|
|
|
31
|
- {
|
|
|
32
|
- field: FormField.FUNCTION_NAME,
|
|
|
33
|
- label: '功能名称',
|
|
|
34
|
- required: true,
|
|
|
35
|
- component: 'Input',
|
|
|
36
|
- colProps: {
|
|
|
37
|
- span: 18,
|
|
|
38
|
- },
|
|
|
39
|
- componentProps: {
|
|
|
40
|
- maxLength: 255,
|
|
|
41
|
- placeholder: '请输入功能名称',
|
|
|
42
|
- },
|
|
|
43
|
- },
|
|
|
44
|
- {
|
|
|
45
|
- field: FormField.IDENTIFIER,
|
|
|
46
|
- label: '标识符',
|
|
|
47
|
- required: true,
|
|
|
48
|
- component: 'Input',
|
|
|
49
|
- colProps: {
|
|
|
50
|
- span: 18,
|
|
|
51
|
- },
|
|
|
52
|
- componentProps: {
|
|
|
53
|
- maxLength: 255,
|
|
|
54
|
- placeholder: '请输入标识符',
|
|
|
55
|
- },
|
|
|
56
|
- },
|
|
|
57
|
- {
|
|
|
58
|
- field: FormField.TYPE,
|
|
|
59
|
- label: '数据类型',
|
|
|
60
|
- required: true,
|
|
|
61
|
- component: 'ApiSelect',
|
|
|
62
|
- colProps: {
|
|
|
63
|
- span: 9,
|
|
|
64
|
- },
|
|
|
65
|
- defaultValue: 'INT',
|
|
|
66
|
- componentProps: {
|
|
|
67
|
- placeholder: '请选择数据类型',
|
|
|
68
|
- api: async (params: Recordable) => {
|
|
|
69
|
- try {
|
|
|
70
|
- const record = await findDictItemByCode(params);
|
|
|
71
|
- return record.filter((item) => item.itemValue !== 'STRUCT');
|
|
|
72
|
- } catch (error) {
|
|
|
73
|
- console.log(error);
|
|
|
74
|
- return [];
|
|
|
75
|
- }
|
30
|
+export const formSchemas = (hasStructForm: boolean): FormSchema[] => {
|
|
|
31
|
+ return [
|
|
|
32
|
+ {
|
|
|
33
|
+ field: FormField.FUNCTION_NAME,
|
|
|
34
|
+ label: '功能名称',
|
|
|
35
|
+ required: true,
|
|
|
36
|
+ component: 'Input',
|
|
|
37
|
+ colProps: {
|
|
|
38
|
+ span: 18,
|
76
|
},
|
39
|
},
|
77
|
- params: {
|
|
|
78
|
- dictCode: 'data_type',
|
40
|
+ componentProps: {
|
|
|
41
|
+ maxLength: 255,
|
|
|
42
|
+ placeholder: '请输入功能名称',
|
79
|
},
|
43
|
},
|
80
|
- labelField: 'itemText',
|
|
|
81
|
- valueField: 'itemValue',
|
|
|
82
|
- getPopupContainer: () => document.body,
|
|
|
83
|
- },
|
|
|
84
|
- },
|
|
|
85
|
- {
|
|
|
86
|
- field: FormField.VALUE_RANGE,
|
|
|
87
|
- label: '取值范围',
|
|
|
88
|
- component: 'CustomMinMaxInput',
|
|
|
89
|
- valueField: 'value',
|
|
|
90
|
- changeEvent: 'update:value',
|
|
|
91
|
- colProps: {
|
|
|
92
|
- span: 18,
|
|
|
93
|
},
|
44
|
},
|
94
|
- ifShow: ({ values }) =>
|
|
|
95
|
- values[FormField.TYPE] === DataTypeEnum.IS_NUMBER_INT ||
|
|
|
96
|
- values[FormField.TYPE] === DataTypeEnum.IS_NUMBER_DOUBLE,
|
|
|
97
|
- rules: [{ validator: validateValueRange }],
|
|
|
98
|
- },
|
|
|
99
|
- {
|
|
|
100
|
- field: FormField.STEP,
|
|
|
101
|
- label: '步长',
|
|
|
102
|
- component: 'InputNumber',
|
|
|
103
|
- colProps: {
|
|
|
104
|
- span: 18,
|
|
|
105
|
- },
|
|
|
106
|
- componentProps: {
|
|
|
107
|
- maxLength: 255,
|
|
|
108
|
- placeholder: '请输入步长',
|
|
|
109
|
- min: 1,
|
|
|
110
|
- formatter: (value: number | string) => {
|
|
|
111
|
- return value ? Math.floor(Number(value)) : value;
|
45
|
+ {
|
|
|
46
|
+ field: FormField.IDENTIFIER,
|
|
|
47
|
+ label: '标识符',
|
|
|
48
|
+ required: true,
|
|
|
49
|
+ component: 'Input',
|
|
|
50
|
+ colProps: {
|
|
|
51
|
+ span: 18,
|
|
|
52
|
+ },
|
|
|
53
|
+ componentProps: {
|
|
|
54
|
+ maxLength: 255,
|
|
|
55
|
+ placeholder: '请输入标识符',
|
112
|
},
|
56
|
},
|
113
|
},
|
57
|
},
|
114
|
- ifShow: ({ values }) =>
|
|
|
115
|
- values[FormField.TYPE] === DataTypeEnum.IS_NUMBER_INT ||
|
|
|
116
|
- values[FormField.TYPE] === DataTypeEnum.IS_NUMBER_DOUBLE,
|
|
|
117
|
- dynamicRules: ({ model }) => {
|
|
|
118
|
- const valueRange = model[FormField.VALUE_RANGE] || {};
|
|
|
119
|
- const { min = 0, max = 0 } = valueRange;
|
|
|
120
|
- const step = model[FormField.STEP];
|
|
|
121
|
- return [
|
|
|
122
|
- {
|
|
|
123
|
- validator: () => {
|
|
|
124
|
- if (step > max - min) {
|
|
|
125
|
- return Promise.reject('步长不能大于取值范围的差值');
|
58
|
+ {
|
|
|
59
|
+ field: FormField.TYPE,
|
|
|
60
|
+ label: '数据类型',
|
|
|
61
|
+ required: true,
|
|
|
62
|
+ component: 'ApiSelect',
|
|
|
63
|
+ colProps: {
|
|
|
64
|
+ span: 9,
|
|
|
65
|
+ },
|
|
|
66
|
+ defaultValue: 'INT',
|
|
|
67
|
+ componentProps: ({ formActionType }) => {
|
|
|
68
|
+ const { updateSchema } = formActionType;
|
|
|
69
|
+ return {
|
|
|
70
|
+ placeholder: '请选择数据类型',
|
|
|
71
|
+ api: async (params: Recordable) => {
|
|
|
72
|
+ try {
|
|
|
73
|
+ const record = await findDictItemByCode(params);
|
|
|
74
|
+ return hasStructForm
|
|
|
75
|
+ ? record.filter((item) => item.itemValue !== DataTypeEnum.IS_STRUCT)
|
|
|
76
|
+ : record;
|
|
|
77
|
+ } catch (error) {
|
|
|
78
|
+ console.log(error);
|
|
|
79
|
+ return [];
|
126
|
}
|
80
|
}
|
127
|
- return Promise.resolve();
|
|
|
128
|
},
|
81
|
},
|
129
|
- },
|
|
|
130
|
- ];
|
|
|
131
|
- },
|
|
|
132
|
- },
|
|
|
133
|
- {
|
|
|
134
|
- field: FormField.UNIT_NAME,
|
|
|
135
|
- label: '单位名称',
|
|
|
136
|
- component: 'Input',
|
|
|
137
|
- show: false,
|
|
|
138
|
- },
|
|
|
139
|
- {
|
|
|
140
|
- field: FormField.UNIT,
|
|
|
141
|
- label: '单位',
|
|
|
142
|
- component: 'ApiSelect',
|
|
|
143
|
- colProps: {
|
|
|
144
|
- span: 9,
|
|
|
145
|
- },
|
|
|
146
|
- componentProps: ({ formActionType }) => {
|
|
|
147
|
- const { setFieldsValue } = formActionType;
|
|
|
148
|
- return {
|
|
|
149
|
- placeholder: '请选择单位',
|
|
|
150
|
- api: async (params) => {
|
|
|
151
|
- const list = await findDictItemByCode(params);
|
|
|
152
|
- list.map((item) => (item.itemText = `${item.itemText} / ${item.itemValue}`));
|
|
|
153
|
- return list;
|
|
|
154
|
- },
|
|
|
155
|
- params: {
|
|
|
156
|
- dictCode: 'attribute_unit',
|
|
|
157
|
- },
|
|
|
158
|
- labelInValue: true,
|
|
|
159
|
- labelField: 'itemText',
|
|
|
160
|
- valueField: 'itemValue',
|
|
|
161
|
- onChange(_, record: Record<'label' | 'value', string>) {
|
|
|
162
|
- if (record) {
|
|
|
163
|
- const { label } = record;
|
|
|
164
|
- setFieldsValue({ [FormField.UNIT_NAME]: label });
|
|
|
165
|
- }
|
|
|
166
|
- },
|
|
|
167
|
- getPopupContainer: () => document.body,
|
|
|
168
|
- showSearch: true,
|
|
|
169
|
- filterOption: (inputValue: string, option: Record<'label' | 'value', string>) => {
|
|
|
170
|
- let { label, value } = option;
|
|
|
171
|
- label = label.toLowerCase();
|
|
|
172
|
- value = value.toLowerCase();
|
|
|
173
|
- inputValue = inputValue.toLowerCase();
|
|
|
174
|
- return label.includes(inputValue) || value.includes(inputValue);
|
|
|
175
|
- },
|
|
|
176
|
- };
|
|
|
177
|
- },
|
|
|
178
|
- ifShow: ({ values }) =>
|
|
|
179
|
- values[FormField.TYPE] === DataTypeEnum.IS_NUMBER_INT ||
|
|
|
180
|
- values[FormField.TYPE] === DataTypeEnum.IS_NUMBER_DOUBLE,
|
|
|
181
|
- },
|
|
|
182
|
- {
|
|
|
183
|
- field: FormField.BOOL_CLOSE,
|
|
|
184
|
- component: 'Input',
|
|
|
185
|
- required: true,
|
|
|
186
|
- label: '0 -',
|
|
|
187
|
- colProps: {
|
|
|
188
|
- span: 18,
|
82
|
+ params: {
|
|
|
83
|
+ dictCode: 'data_type',
|
|
|
84
|
+ },
|
|
|
85
|
+ labelField: 'itemText',
|
|
|
86
|
+ valueField: 'itemValue',
|
|
|
87
|
+ getPopupContainer: () => document.body,
|
|
|
88
|
+ onChange: (value: string) => {
|
|
|
89
|
+ value === DataTypeEnum.IS_STRUCT &&
|
|
|
90
|
+ updateSchema({
|
|
|
91
|
+ field: FormField.SPECS_LIST,
|
|
|
92
|
+ componentProps: {
|
|
|
93
|
+ hasStructForm: true,
|
|
|
94
|
+ },
|
|
|
95
|
+ });
|
|
|
96
|
+ },
|
|
|
97
|
+ };
|
|
|
98
|
+ },
|
189
|
},
|
99
|
},
|
190
|
- componentProps: {
|
|
|
191
|
- placeholder: '如:关',
|
100
|
+ {
|
|
|
101
|
+ field: FormField.VALUE_RANGE,
|
|
|
102
|
+ label: '取值范围',
|
|
|
103
|
+ component: 'CustomMinMaxInput',
|
|
|
104
|
+ valueField: 'value',
|
|
|
105
|
+ changeEvent: 'update:value',
|
|
|
106
|
+ colProps: {
|
|
|
107
|
+ span: 18,
|
|
|
108
|
+ },
|
|
|
109
|
+ ifShow: ({ values }) =>
|
|
|
110
|
+ values[FormField.TYPE] === DataTypeEnum.IS_NUMBER_INT ||
|
|
|
111
|
+ values[FormField.TYPE] === DataTypeEnum.IS_NUMBER_DOUBLE,
|
|
|
112
|
+ rules: [{ validator: validateValueRange }],
|
192
|
},
|
113
|
},
|
193
|
- defaultValue: '关',
|
|
|
194
|
- ifShow: ({ values }) => values[FormField.TYPE] === DataTypeEnum.IS_BOOL,
|
|
|
195
|
- dynamicRules: ({ model }) => {
|
|
|
196
|
- const close = model[FormField.BOOL_CLOSE];
|
|
|
197
|
- const open = model[FormField.BOOL_OPEN];
|
|
|
198
|
- return [
|
|
|
199
|
- {
|
|
|
200
|
- required: true,
|
114
|
+ {
|
|
|
115
|
+ field: FormField.STEP,
|
|
|
116
|
+ label: '步长',
|
|
|
117
|
+ component: 'InputNumber',
|
|
|
118
|
+ colProps: {
|
|
|
119
|
+ span: 18,
|
|
|
120
|
+ },
|
|
|
121
|
+ componentProps: {
|
|
|
122
|
+ maxLength: 255,
|
|
|
123
|
+ placeholder: '请输入步长',
|
|
|
124
|
+ min: 1,
|
|
|
125
|
+ formatter: (value: number | string) => {
|
|
|
126
|
+ return value ? Math.floor(Number(value)) : value;
|
201
|
},
|
127
|
},
|
202
|
- {
|
|
|
203
|
- validator() {
|
|
|
204
|
- if (open === close) return Promise.reject('布尔值不能相同');
|
|
|
205
|
- return Promise.resolve();
|
128
|
+ },
|
|
|
129
|
+ ifShow: ({ values }) =>
|
|
|
130
|
+ values[FormField.TYPE] === DataTypeEnum.IS_NUMBER_INT ||
|
|
|
131
|
+ values[FormField.TYPE] === DataTypeEnum.IS_NUMBER_DOUBLE,
|
|
|
132
|
+ dynamicRules: ({ model }) => {
|
|
|
133
|
+ const valueRange = model[FormField.VALUE_RANGE] || {};
|
|
|
134
|
+ const { min = 0, max = 0 } = valueRange;
|
|
|
135
|
+ const step = model[FormField.STEP];
|
|
|
136
|
+ return [
|
|
|
137
|
+ {
|
|
|
138
|
+ validator: () => {
|
|
|
139
|
+ if (step > max - min) {
|
|
|
140
|
+ return Promise.reject('步长不能大于取值范围的差值');
|
|
|
141
|
+ }
|
|
|
142
|
+ return Promise.resolve();
|
|
|
143
|
+ },
|
206
|
},
|
144
|
},
|
207
|
- },
|
|
|
208
|
- ];
|
145
|
+ ];
|
|
|
146
|
+ },
|
209
|
},
|
147
|
},
|
210
|
- },
|
|
|
211
|
- {
|
|
|
212
|
- field: FormField.BOOL_OPEN,
|
|
|
213
|
- component: 'Input',
|
|
|
214
|
- required: true,
|
|
|
215
|
- label: '1 -',
|
|
|
216
|
- colProps: {
|
|
|
217
|
- span: 18,
|
148
|
+ {
|
|
|
149
|
+ field: FormField.UNIT_NAME,
|
|
|
150
|
+ label: '单位名称',
|
|
|
151
|
+ component: 'Input',
|
|
|
152
|
+ show: false,
|
218
|
},
|
153
|
},
|
219
|
- componentProps: {
|
|
|
220
|
- placeholder: '如:开',
|
154
|
+ {
|
|
|
155
|
+ field: FormField.UNIT,
|
|
|
156
|
+ label: '单位',
|
|
|
157
|
+ component: 'ApiSelect',
|
|
|
158
|
+ colProps: {
|
|
|
159
|
+ span: 9,
|
|
|
160
|
+ },
|
|
|
161
|
+ componentProps: ({ formActionType }) => {
|
|
|
162
|
+ const { setFieldsValue } = formActionType;
|
|
|
163
|
+ return {
|
|
|
164
|
+ placeholder: '请选择单位',
|
|
|
165
|
+ api: async (params) => {
|
|
|
166
|
+ const list = await findDictItemByCode(params);
|
|
|
167
|
+ list.map((item) => (item.itemText = `${item.itemText} / ${item.itemValue}`));
|
|
|
168
|
+ return list;
|
|
|
169
|
+ },
|
|
|
170
|
+ params: {
|
|
|
171
|
+ dictCode: 'attribute_unit',
|
|
|
172
|
+ },
|
|
|
173
|
+ labelInValue: true,
|
|
|
174
|
+ labelField: 'itemText',
|
|
|
175
|
+ valueField: 'itemValue',
|
|
|
176
|
+ onChange(_, record: Record<'label' | 'value', string>) {
|
|
|
177
|
+ if (record) {
|
|
|
178
|
+ const { label } = record;
|
|
|
179
|
+ setFieldsValue({ [FormField.UNIT_NAME]: label });
|
|
|
180
|
+ }
|
|
|
181
|
+ },
|
|
|
182
|
+ getPopupContainer: () => document.body,
|
|
|
183
|
+ showSearch: true,
|
|
|
184
|
+ filterOption: (inputValue: string, option: Record<'label' | 'value', string>) => {
|
|
|
185
|
+ let { label, value } = option;
|
|
|
186
|
+ label = label.toLowerCase();
|
|
|
187
|
+ value = value.toLowerCase();
|
|
|
188
|
+ inputValue = inputValue.toLowerCase();
|
|
|
189
|
+ return label.includes(inputValue) || value.includes(inputValue);
|
|
|
190
|
+ },
|
|
|
191
|
+ };
|
|
|
192
|
+ },
|
|
|
193
|
+ ifShow: ({ values }) =>
|
|
|
194
|
+ values[FormField.TYPE] === DataTypeEnum.IS_NUMBER_INT ||
|
|
|
195
|
+ values[FormField.TYPE] === DataTypeEnum.IS_NUMBER_DOUBLE,
|
221
|
},
|
196
|
},
|
222
|
- defaultValue: '开',
|
|
|
223
|
- ifShow: ({ values }) => values[FormField.TYPE] === DataTypeEnum.IS_BOOL,
|
|
|
224
|
- dynamicRules: ({ model }) => {
|
|
|
225
|
- const close = model[FormField.BOOL_CLOSE];
|
|
|
226
|
- const open = model[FormField.BOOL_OPEN];
|
|
|
227
|
- return [
|
|
|
228
|
- {
|
|
|
229
|
- required: true,
|
|
|
230
|
- },
|
|
|
231
|
- {
|
|
|
232
|
- validator() {
|
|
|
233
|
- if (open === close) return Promise.reject('布尔值不能相同');
|
|
|
234
|
- return Promise.resolve();
|
197
|
+ {
|
|
|
198
|
+ field: FormField.BOOL_CLOSE,
|
|
|
199
|
+ component: 'Input',
|
|
|
200
|
+ required: true,
|
|
|
201
|
+ label: '0 -',
|
|
|
202
|
+ colProps: {
|
|
|
203
|
+ span: 18,
|
|
|
204
|
+ },
|
|
|
205
|
+ componentProps: {
|
|
|
206
|
+ placeholder: '如:关',
|
|
|
207
|
+ },
|
|
|
208
|
+ defaultValue: '关',
|
|
|
209
|
+ ifShow: ({ values }) => values[FormField.TYPE] === DataTypeEnum.IS_BOOL,
|
|
|
210
|
+ dynamicRules: ({ model }) => {
|
|
|
211
|
+ const close = model[FormField.BOOL_CLOSE];
|
|
|
212
|
+ const open = model[FormField.BOOL_OPEN];
|
|
|
213
|
+ return [
|
|
|
214
|
+ {
|
|
|
215
|
+ required: true,
|
235
|
},
|
216
|
},
|
236
|
- },
|
|
|
237
|
- ];
|
217
|
+ {
|
|
|
218
|
+ validator() {
|
|
|
219
|
+ if (open === close) return Promise.reject('布尔值不能相同');
|
|
|
220
|
+ return Promise.resolve();
|
|
|
221
|
+ },
|
|
|
222
|
+ },
|
|
|
223
|
+ ];
|
|
|
224
|
+ },
|
238
|
},
|
225
|
},
|
239
|
- },
|
|
|
240
|
- {
|
|
|
241
|
- field: FormField.LENGTH,
|
|
|
242
|
- component: 'Input',
|
|
|
243
|
- required: true,
|
|
|
244
|
- label: '数据长度',
|
|
|
245
|
- defaultValue: '10240',
|
|
|
246
|
- colProps: {
|
|
|
247
|
- span: 8,
|
226
|
+ {
|
|
|
227
|
+ field: FormField.BOOL_OPEN,
|
|
|
228
|
+ component: 'Input',
|
|
|
229
|
+ required: true,
|
|
|
230
|
+ label: '1 -',
|
|
|
231
|
+ colProps: {
|
|
|
232
|
+ span: 18,
|
|
|
233
|
+ },
|
|
|
234
|
+ componentProps: {
|
|
|
235
|
+ placeholder: '如:开',
|
|
|
236
|
+ },
|
|
|
237
|
+ defaultValue: '开',
|
|
|
238
|
+ ifShow: ({ values }) => values[FormField.TYPE] === DataTypeEnum.IS_BOOL,
|
|
|
239
|
+ dynamicRules: ({ model }) => {
|
|
|
240
|
+ const close = model[FormField.BOOL_CLOSE];
|
|
|
241
|
+ const open = model[FormField.BOOL_OPEN];
|
|
|
242
|
+ return [
|
|
|
243
|
+ {
|
|
|
244
|
+ required: true,
|
|
|
245
|
+ },
|
|
|
246
|
+ {
|
|
|
247
|
+ validator() {
|
|
|
248
|
+ if (open === close) return Promise.reject('布尔值不能相同');
|
|
|
249
|
+ return Promise.resolve();
|
|
|
250
|
+ },
|
|
|
251
|
+ },
|
|
|
252
|
+ ];
|
|
|
253
|
+ },
|
248
|
},
|
254
|
},
|
249
|
- componentProps: {
|
|
|
250
|
- placeholder: '请输入数据长度',
|
255
|
+ {
|
|
|
256
|
+ field: FormField.LENGTH,
|
|
|
257
|
+ component: 'Input',
|
|
|
258
|
+ required: true,
|
|
|
259
|
+ label: '数据长度',
|
|
|
260
|
+ defaultValue: '10240',
|
|
|
261
|
+ colProps: {
|
|
|
262
|
+ span: 8,
|
|
|
263
|
+ },
|
|
|
264
|
+ componentProps: {
|
|
|
265
|
+ placeholder: '请输入数据长度',
|
|
|
266
|
+ },
|
|
|
267
|
+ renderComponentContent: () => {
|
|
|
268
|
+ return {
|
|
|
269
|
+ suffix: () => '字节',
|
|
|
270
|
+ };
|
|
|
271
|
+ },
|
|
|
272
|
+ ifShow: ({ values }) => values[FormField.TYPE] === DataTypeEnum.IS_STRING,
|
251
|
},
|
273
|
},
|
252
|
- renderComponentContent: () => {
|
|
|
253
|
- return {
|
|
|
254
|
- suffix: () => '字节',
|
|
|
255
|
- };
|
274
|
+ {
|
|
|
275
|
+ field: FormField.ACCESS_MODE,
|
|
|
276
|
+ component: 'ApiRadioGroup',
|
|
|
277
|
+ label: '读写类型',
|
|
|
278
|
+ required: true,
|
|
|
279
|
+ colProps: {
|
|
|
280
|
+ span: 24,
|
|
|
281
|
+ },
|
|
|
282
|
+ defaultValue: 'r',
|
|
|
283
|
+ componentProps: {
|
|
|
284
|
+ placeholder: '请选择读写类型',
|
|
|
285
|
+ api: findDictItemByCode,
|
|
|
286
|
+ params: {
|
|
|
287
|
+ dictCode: 'read_write_type',
|
|
|
288
|
+ },
|
|
|
289
|
+ labelField: 'itemText',
|
|
|
290
|
+ valueField: 'itemValue',
|
|
|
291
|
+ },
|
256
|
},
|
292
|
},
|
257
|
- ifShow: ({ values }) => values[FormField.TYPE] === DataTypeEnum.IS_STRING,
|
|
|
258
|
- },
|
|
|
259
|
- {
|
|
|
260
|
- field: FormField.ACCESS_MODE,
|
|
|
261
|
- component: 'ApiRadioGroup',
|
|
|
262
|
- label: '读写类型',
|
|
|
263
|
- required: true,
|
|
|
264
|
- colProps: {
|
|
|
265
|
- span: 24,
|
293
|
+ {
|
|
|
294
|
+ field: FormField.SPECS_LIST,
|
|
|
295
|
+ label: 'JSON对象',
|
|
|
296
|
+ component: 'StructForm',
|
|
|
297
|
+ valueField: 'value',
|
|
|
298
|
+ changeEvent: 'update:value',
|
|
|
299
|
+ colProps: { span: 24 },
|
|
|
300
|
+ ifShow: ({ values }) => values[FormField.TYPE] === DataTypeEnum.IS_STRUCT,
|
|
|
301
|
+ rules: [{ required: true, validator: validateJSON }],
|
266
|
},
|
302
|
},
|
267
|
- defaultValue: 'r',
|
|
|
268
|
- componentProps: {
|
|
|
269
|
- placeholder: '请选择读写类型',
|
|
|
270
|
- api: findDictItemByCode,
|
|
|
271
|
- params: {
|
|
|
272
|
- dictCode: 'read_write_type',
|
303
|
+ {
|
|
|
304
|
+ field: FormField.REFARK,
|
|
|
305
|
+ label: '备注',
|
|
|
306
|
+ component: 'InputTextArea',
|
|
|
307
|
+ componentProps: {
|
|
|
308
|
+ rows: 4,
|
|
|
309
|
+ maxLength: 100,
|
|
|
310
|
+ placeholder: '请输入描述',
|
273
|
},
|
311
|
},
|
274
|
- labelField: 'itemText',
|
|
|
275
|
- valueField: 'itemValue',
|
|
|
276
|
- },
|
|
|
277
|
- },
|
|
|
278
|
- {
|
|
|
279
|
- field: FormField.SPECS_LIST,
|
|
|
280
|
- label: 'JSON对象',
|
|
|
281
|
- component: 'StructForm',
|
|
|
282
|
- valueField: 'value',
|
|
|
283
|
- changeEvent: 'update:value',
|
|
|
284
|
- colProps: { span: 24 },
|
|
|
285
|
- ifShow: ({ values }) => values[FormField.TYPE] === DataTypeEnum.IS_STRUCT,
|
|
|
286
|
- rules: [{ required: true, validator: validateJSON }],
|
|
|
287
|
- },
|
|
|
288
|
- {
|
|
|
289
|
- field: FormField.REFARK,
|
|
|
290
|
- label: '备注',
|
|
|
291
|
- component: 'InputTextArea',
|
|
|
292
|
- componentProps: {
|
|
|
293
|
- rows: 4,
|
|
|
294
|
- maxLength: 100,
|
|
|
295
|
- placeholder: '请输入描述',
|
|
|
296
|
},
|
312
|
},
|
297
|
- },
|
|
|
298
|
-]; |
313
|
+ ];
|
|
|
314
|
+}; |