From c67954eec2aee6bcf70b50207690ae449639f0be Mon Sep 17 00:00:00 2001 From: luojiayi <1712054227@qq.com> Date: Thu, 24 Apr 2025 10:12:03 +0800 Subject: [PATCH] =?UTF-8?q?2025=E5=B9=B404=E6=9C=8824=E6=97=A510:12:01?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/alarm.vue | 5 ++-- src/views/login.vue | 28 +++++++++++-------- src/views/monitoringCenter/deviceHistory.vue | 1 + src/views/monitoringCenter/deviceInfo.vue | 29 +++++++++++--------- src/views/monitoringCenter/index.vue | 25 ++++++++++++++--- src/views/statisticalCenter/index.vue | 24 +++++++++------- 6 files changed, 72 insertions(+), 40 deletions(-) diff --git a/src/components/alarm.vue b/src/components/alarm.vue index b8ff4c5..6064365 100644 --- a/src/components/alarm.vue +++ b/src/components/alarm.vue @@ -20,9 +20,9 @@
{{ item.deviceId }}
{{ warnTypeEnum[item.type] }}
-
{{ item.useName }}
+
{{ item.user }}
{{ item.createTime }}
-
去处理
+
去处理
@@ -41,6 +41,7 @@ interface TWarning { useName: string; createTime: string; type: number; + warnId: number; } enum warnTypeEnum { diff --git a/src/views/login.vue b/src/views/login.vue index 4ff8f7a..aa6fa58 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -12,7 +12,7 @@ - 登 录 + 登 录
如遇到账号问题,请联系管理员
@@ -39,6 +39,7 @@ const validatePass = (rule: any, value: any, callback: any) => { if (rule.field == "password" && !ruleForm.password) return callback(new Error("请输入密码")); callback(); }; +const disabled = ref(false); const ruleForm = reactive({ username: "", password: "", @@ -53,18 +54,23 @@ const submitForm = async (formEl: FormInstance | undefined) => { if (!formEl) return; await formEl.validate((valid, fields) => { if (valid) { + disabled.value = true; localStorage.setItem("isReload", "true"); - fetchLogin(ruleForm).then((res) => { - comm.setUser(res); - comm.getRoleList(); - ElMessage({ - message: "登录成功", - type: "success", + fetchLogin(ruleForm) + .then((res) => { + comm.setUser(res); + comm.getRoleList(); + ElMessage({ + message: "登录成功", + type: "success", + }); + setTimeout(() => { + router.push("/"); + }, 1000); + }) + .finally(() => { + disabled.value = false; }); - setTimeout(() => { - router.push("/"); - }, 1000); - }); } }); }; diff --git a/src/views/monitoringCenter/deviceHistory.vue b/src/views/monitoringCenter/deviceHistory.vue index 233742b..eb88a4a 100644 --- a/src/views/monitoringCenter/deviceHistory.vue +++ b/src/views/monitoringCenter/deviceHistory.vue @@ -16,6 +16,7 @@ import { ref } from "vue"; const radio = ref("1"); const emit = defineEmits(["change"]); +defineExpose({ radio }); const change = (e) => { emit("change", e); diff --git a/src/views/monitoringCenter/deviceInfo.vue b/src/views/monitoringCenter/deviceInfo.vue index 88cd761..fc1fa99 100644 --- a/src/views/monitoringCenter/deviceInfo.vue +++ b/src/views/monitoringCenter/deviceInfo.vue @@ -2,7 +2,7 @@
设备列表
- + @@ -10,7 +10,7 @@