From c103a1df3de9787365a879076b9c7cc18e409ad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E7=A3=8A?= <45566618@qq.com> Date: Tue, 24 Mar 2026 15:01:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86=E7=94=B5?= =?UTF-8?q?=E8=A1=A8=E5=A2=9E=E5=8A=A0=E5=BA=8F=E5=8F=B7=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hs/electricity/components/ElectricityInfoForm.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/views/iot/hs/electricity/components/ElectricityInfoForm.vue b/src/views/iot/hs/electricity/components/ElectricityInfoForm.vue index 9d909af..77b8067 100644 --- a/src/views/iot/hs/electricity/components/ElectricityInfoForm.vue +++ b/src/views/iot/hs/electricity/components/ElectricityInfoForm.vue @@ -49,9 +49,8 @@ const labelCol = ref({ xs: { span: 24 }, sm: { span: 5 } }); const wrapperCol = ref({ xs: { span: 24 }, sm: { span: 16 } }); const confirmLoading = ref(false); //表单验证 -const validatorRules = { - // remarks: [{ required: true, message: '请输入备注!'},], -}; +const validatorRules = reactive({ +}); const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true }); // 表单禁用 @@ -97,6 +96,10 @@ function edit(record) { * 提交数据 */ async function submitForm() { + if(formData.nusnId == null || formData.sn ==''){ + createMessage.warning('请填写设备序号'); + return; + } try { // 触发表单验证 await validate();