...
|
...
|
@@ -202,6 +202,13 @@ export const step1Schemas: FormSchema[] = [ |
202
|
202
|
},
|
203
|
203
|
},
|
204
|
204
|
{
|
|
205
|
+ field: 'addressType',
|
|
206
|
+ label: '',
|
|
207
|
+ component: 'Input',
|
|
208
|
+ show: false,
|
|
209
|
+ defaultValue: 'HEX',
|
|
210
|
+ },
|
|
211
|
+ {
|
205
|
212
|
field: 'addressCode',
|
206
|
213
|
label: '地址码',
|
207
|
214
|
dynamicRules({ values }) {
|
...
|
...
|
@@ -211,7 +218,7 @@ export const step1Schemas: FormSchema[] = [ |
211
|
218
|
values?.transportType === TransportTypeEnum.TCP &&
|
212
|
219
|
values?.tcpDeviceProtocol === TCPProtocolTypeEnum.MODBUS_RTU,
|
213
|
220
|
message: '地址码范围为00~FF',
|
214
|
|
- pattern: /^[0-9A-Fa-f]{1,2}$/,
|
|
221
|
+ pattern: values?.addressType === 'HEX' ? /^[0-9A-Fa-f]{2}$/ : /^[0-9A-Fa-f]{1,2}$/,
|
215
|
222
|
},
|
216
|
223
|
];
|
217
|
224
|
},
|
...
|
...
|
@@ -219,10 +226,15 @@ export const step1Schemas: FormSchema[] = [ |
219
|
226
|
component: 'HexInput',
|
220
|
227
|
changeEvent: 'update:value',
|
221
|
228
|
valueField: 'value',
|
222
|
|
- componentProps: {
|
223
|
|
- type: InputTypeEnum.HEX,
|
224
|
|
- maxValue: parseInt('FF', 16),
|
225
|
|
- placeholder: '请输入寄存器地址',
|
|
229
|
+ componentProps: ({ formModel }) => {
|
|
230
|
+ return {
|
|
231
|
+ type: InputTypeEnum.HEX,
|
|
232
|
+ maxValue: parseInt('FF', 16),
|
|
233
|
+ placeholder: '请输入寄存器地址',
|
|
234
|
+ onHexChange: (e) => {
|
|
235
|
+ formModel.addressType = e;
|
|
236
|
+ },
|
|
237
|
+ };
|
226
|
238
|
},
|
227
|
239
|
ifShow: ({ values }) => {
|
228
|
240
|
return (
|
...
|
...
|
|