From 05245855eb7eb23695c289a7f0bcf4c8a8b4efca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E6=B5=A9=E6=B5=A9?= <1036606149@qq.com> Date: Sun, 13 Oct 2024 23:03:44 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91=E4=BC=98=E5=8C=96IOT=E7=89=A9=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E8=A1=A8=E5=8D=95=E9=AA=8C=E8=AF=81=E8=A7=84?= =?UTF-8?q?=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/product/detail/ThinkModelFunctionForm.vue | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/views/iot/product/detail/ThinkModelFunctionForm.vue b/src/views/iot/product/detail/ThinkModelFunctionForm.vue index 0f59062c..62049167 100644 --- a/src/views/iot/product/detail/ThinkModelFunctionForm.vue +++ b/src/views/iot/product/detail/ThinkModelFunctionForm.vue @@ -138,7 +138,7 @@ const formRules = reactive({ trigger: 'blur' }, { - validator: (rule, value, callback) => { + validator: (value, callback) => { const reservedKeywords = ['set', 'get', 'post', 'property', 'event', 'time', 'value'] if (reservedKeywords.includes(value)) { callback( @@ -153,12 +153,8 @@ const formRules = reactive({ trigger: 'blur' } ], - property: { - dataType: { - type: [{ required: true, message: '数据类型不能为空', trigger: 'blur' }] - }, - accessMode: [{ required: true, message: '读写类型不能为空', trigger: 'blur' }] - } + 'property.dataType.type': [{ required: true, message: '数据类型不能为空', trigger: 'blur' }], + 'property.accessMode': [{ required: true, message: '读写类型不能为空', trigger: 'blur' }] }) const formRef = ref() @@ -195,9 +191,9 @@ const submitForm = async () => { await ThinkModelFunctionApi.updateThinkModelFunction(data) message.success(t('common.updateSuccess')) } + } finally { dialogVisible.value = false // 确保关闭弹框 emit('success') - } finally { formLoading.value = false } } @@ -231,4 +227,4 @@ const resetForm = () => { } formRef.value?.resetFields() } - + \ No newline at end of file