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 @@
如遇到账号问题,请联系管理员
@@ -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 @@
-