diff --git a/src/views/login.vue b/src/views/login.vue
index 58423c5..7a39e16 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -34,7 +34,7 @@
记住密码
-
登 录
+ 登 录
@@ -47,6 +47,8 @@ export default {
save: false,
password: "",
username: "",
+ loading:null,
+ isLoad:false,
};
},
mounted() {
@@ -61,20 +63,35 @@ export default {
if (localStorage.getItem("token")) {
this.$router.push({ name: "index" });
}
- this.toLogin();
+ window.addEventListener('keyup', this.handleKeyUp);
+ },
+ beforeDestroy() {
+ window.removeEventListener('keyup', this.handleKeyUp);
},
methods: {
- toLogin() {
- document.onkeydown = e =>{
- if (!e.shiftKey && e.keyCode === 13) {
- e.cancelBubble = true; //ie阻止冒泡行为
- e.stopPropagation();//Firefox阻止冒泡行为
- e.preventDefault(); //取消事件的默认动作*换行
- if (e.srcElement.value) {
- this.login()
- }
- }
- }
+ handleKeyUp() {
+ if (event.key === 'Enter'&&this.isLoad==false) {
+ this.isLoad=true
+ this.loading = this.$loading({
+ lock: true,
+ text: '登录中',
+ spinner: 'el-icon-loading',
+ background: 'rgba(0, 0, 0, 0.7)'
+ });
+ this.login();
+ }
+ // document.onkeydown = (e) => {
+ // if (!e.shiftKey && e.keyCode === 13) {
+ // e.cancelBubble = true; //ie阻止冒泡行为
+ // e.stopPropagation(); //Firefox阻止冒泡行为
+ // e.preventDefault(); //取消事件的默认动作*换行
+ // console.log(e,111);
+ // if (e.srcElement.value) {
+ // console.log(11);
+
+ // }
+ // }
+ // };
},
login() {
var store = this.$store.state;
@@ -95,6 +112,8 @@ export default {
password: this.password,
}; // 替换为你要发送的数据
this.api.login(data).then((res) => {
+ this.loading.close()
+ this.isLoad=false
if (this.save) {
localStorage.setItem("save", 1);
localStorage.setItem("username", this.username);
@@ -119,6 +138,9 @@ export default {
localStorage.removeItem("token");
this.$message.error(res.data.msg);
}
+ }).catch(err=>{
+ this.loading.close()
+ this.isLoad=false
});
},
},
diff --git a/src/views/page/air-conditioning.vue b/src/views/page/air-conditioning.vue
index ea42d99..1c46050 100644
--- a/src/views/page/air-conditioning.vue
+++ b/src/views/page/air-conditioning.vue
@@ -467,7 +467,7 @@
冷暖风机达到最大输出能力后,仍然达不到目标值
-
+
-
+
+
+
+
+
+
+ 空调运行时,关闭天窗;
+
+
+
+
+
+
+
+
+ 空调运行时,关闭风机,湿帘;
+
+
+
+
+
+
+
+
+ 空调运行时开启环流风扇。
+
+