From c6c2e541f8c8f5b8420f47c6f9f42f8886df64bc Mon Sep 17 00:00:00 2001 From: luojiayi <1712054227@qq.com> Date: Mon, 12 May 2025 18:30:50 +0800 Subject: [PATCH] =?UTF-8?q?2025=E5=B9=B405=E6=9C=8812=E6=97=A518:30:46?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/synthesizeManage/deviceInfo/index.vue | 1 + src/views/synthesizeManage/setting/index.vue | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/views/synthesizeManage/deviceInfo/index.vue b/src/views/synthesizeManage/deviceInfo/index.vue index f645ba8..8e28734 100644 --- a/src/views/synthesizeManage/deviceInfo/index.vue +++ b/src/views/synthesizeManage/deviceInfo/index.vue @@ -22,6 +22,7 @@
固件版本:{{ query.deviceVersion }}
+
紧急联系人:{{ query.deviceVersion }}
diff --git a/src/views/synthesizeManage/setting/index.vue b/src/views/synthesizeManage/setting/index.vue index d418cdf..f3a7f7d 100644 --- a/src/views/synthesizeManage/setting/index.vue +++ b/src/views/synthesizeManage/setting/index.vue @@ -136,6 +136,9 @@ const getDeviceConfig = () => { phone: item.phone, }; }); + for (let i = 0; i <= 3 - arr.length; i++) { + arr.push({ name: "", phone: "" }); + } ruleForm.value = { ...res, contacts: arr.length @@ -152,6 +155,15 @@ const submitForm = async (formEl: FormInstance | undefined) => { if (!formEl) return; await formEl.validate((valid) => { if (valid) { + for (let i = 1; i < ruleForm.value.contacts.length; i++) { + let item = ruleForm.value.contacts[i]; + if (!item.name && item.phone) { + return ElMessage.error(`请输入姓名${i + 1}`); + } + if (item.name && !item.phone) { + return ElMessage.error(`请输入紧急电话${i + 1}`); + } + } deviceConfigModify({ ...ruleForm.value, contacts: ruleForm.value.contacts,