Showing
1 changed file
with
4 additions
and
2 deletions
| ... | ... | @@ -17,7 +17,7 @@ |
| 17 | 17 | defineEmits(['register']); |
| 18 | 18 | const props = defineProps<{ deviceId: string; deviceName: string }>(); |
| 19 | 19 | |
| 20 | - const [registerForm, { setProps, getFieldsValue, resetFields }] = useForm({ | |
| 20 | + const [registerForm, { setProps, getFieldsValue, resetFields, validate }] = useForm({ | |
| 21 | 21 | schemas: [], |
| 22 | 22 | showActionButtonGroup: false, |
| 23 | 23 | layout: 'vertical', |
| ... | ... | @@ -95,13 +95,15 @@ |
| 95 | 95 | createMessage.warning('当前物模型扩展描述没有填写'); |
| 96 | 96 | return; |
| 97 | 97 | } |
| 98 | + const flag = await validate(); | |
| 99 | + if (!flag) return; | |
| 98 | 100 | const sendValue = ref({}); |
| 99 | 101 | //判断tcp类型 标识符是自定义还是ModBus |
| 100 | 102 | if (unref(isShowModBUS)) { |
| 101 | 103 | const oldValue = getFieldsValue()[unref(formField)]; |
| 102 | 104 | modBUSForm.value.registerValues = [oldValue]; |
| 103 | 105 | modBUSForm.value.registerNumber = 1; |
| 104 | - // 只有 | |
| 106 | + | |
| 105 | 107 | if (unref(modBUSForm).method == '16') { |
| 106 | 108 | const newValue = getArray(SingleToHex(oldValue)); |
| 107 | 109 | modBUSForm.value.registerValues = newValue; | ... | ... |