Merge pull request 'pc-master' (#232) from pc-master into portal
Reviewed-on: #232
This commit is contained in:
commit
88e819d5bb
@ -34,7 +34,7 @@
|
||||
记住密码
|
||||
</div>
|
||||
</div>
|
||||
<div class="login-btn" @keyup.enter="toLogin" @click="login">登 录</div>
|
||||
<div class="login-btn" @click="login">登 录</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -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
|
||||
});
|
||||
},
|
||||
},
|
||||
|
@ -467,7 +467,7 @@
|
||||
<span>冷暖风机达到最大输出能力后,仍然达不到目标值</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view padding-none border-none shrink-none">
|
||||
<div class="flex-view padding-none shrink-none">
|
||||
<div class="input-main-60">
|
||||
<span></span><span></span><span></span><span></span><span></span><span></span><span></span>
|
||||
<input
|
||||
@ -480,7 +480,57 @@
|
||||
<span>分钟后启动空调</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-view padding-none border-none shrink-none">
|
||||
<div class="input-main">
|
||||
<span></span><span></span>
|
||||
</div>
|
||||
<div class="input-btn">
|
||||
<div
|
||||
class="btn btn-w70"
|
||||
@click="changeIndexOpen3(1)"
|
||||
:class="actList3[0] == '1' ? 'blue' : 'off'"
|
||||
>
|
||||
{{ actList3[0] == "1" ? "有效" : "无效" }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-60">
|
||||
<span>空调运行时,关闭天窗;</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view padding-none border-none shrink-none">
|
||||
<div class="input-main">
|
||||
<span></span><span></span>
|
||||
</div>
|
||||
<div class="input-btn">
|
||||
<div
|
||||
class="btn btn-w70"
|
||||
@click="changeIndexOpen3(1)"
|
||||
:class="actList3[1] == '1' ? 'blue' : 'off'"
|
||||
>
|
||||
{{ actList3[1] == "1" ? "有效" : "无效" }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-60">
|
||||
<span>空调运行时,关闭风机,湿帘;</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view padding-none border-none shrink-none">
|
||||
<div class="input-main">
|
||||
<span></span><span></span>
|
||||
</div>
|
||||
<div class="input-btn">
|
||||
<div
|
||||
class="btn btn-w70"
|
||||
@click="changeIndexOpen3(1)"
|
||||
:class="actList3[2] == '1' ? 'blue' : 'off'"
|
||||
>
|
||||
{{ actList3[2] == "1" ? "有效" : "无效" }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-60">
|
||||
<span>空调运行时开启环流风扇。</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@ -492,6 +542,7 @@ export default {
|
||||
indexs: 1,
|
||||
actList1: [],
|
||||
actList2:[],
|
||||
actList3:[],
|
||||
loading: null,
|
||||
pageName: "空调",
|
||||
typeList1: [
|
||||
@ -630,6 +681,15 @@ export default {
|
||||
openListNew = num1.split("")
|
||||
this.actList2 = openListNew.reverse();
|
||||
},
|
||||
getActive3() {
|
||||
this.actList3 = []
|
||||
var num = this.inputData[22064]
|
||||
|
||||
var num1 = this.padString(num.toString(2), 3)
|
||||
var openListNew = []
|
||||
openListNew = num1.split("")
|
||||
this.actList3 = openListNew.reverse();
|
||||
},
|
||||
changeCountData(code, el) {
|
||||
var data = el.target.value * 10 + 400;
|
||||
var sendData = {
|
||||
@ -696,6 +756,24 @@ export default {
|
||||
}
|
||||
});
|
||||
return name;
|
||||
},
|
||||
// 空调运行时
|
||||
changeIndexOpen3(active) {
|
||||
if (this.actList3[active] == "1") {
|
||||
this.actList3[active] = "0";
|
||||
} else {
|
||||
this.actList3[active] = "1";
|
||||
}
|
||||
this.$forceUpdate();
|
||||
var revList = this.actList3.slice().reverse();
|
||||
var num = revList.join("");
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: parseInt(num, 2),
|
||||
},
|
||||
};
|
||||
this.inputData[22064] = parseInt(num, 2);
|
||||
this.changeBtn(22064, dataNum);
|
||||
},
|
||||
// 空调时段限制
|
||||
changeIndexOpen(active) {
|
||||
@ -750,6 +828,7 @@ export default {
|
||||
this.inputDataNew[22042] = this.getData2(this.inputData[22042]);
|
||||
this.getActive1();
|
||||
this.getActive2()
|
||||
this.getActive3()
|
||||
// this.inputDataNew[22045] = this.getData1(this.inputData[22045]);
|
||||
}
|
||||
});
|
||||
|
@ -724,18 +724,28 @@ this.dataInit();
|
||||
for (let index = 0; index < inputList.length; index++) {
|
||||
inputList[index].onfocus = this.selectValue;//input放入焦点,全选文本
|
||||
}
|
||||
window.addEventListener('keyup', this.handleKeyUp);
|
||||
},
|
||||
beforeDestroy() {
|
||||
window.removeEventListener('keyup', this.handleKeyUp);
|
||||
},
|
||||
methods: {
|
||||
modelClose(){
|
||||
this.$router.go(-1); // 返回前一页
|
||||
},
|
||||
modelConfirm(){
|
||||
handleKeyUp() {
|
||||
if (event.key === 'Enter') {
|
||||
|
||||
this.modelConfirm();
|
||||
}
|
||||
},
|
||||
modelConfirm(){
|
||||
if(this.modelPassword=='230509'){
|
||||
this.warnModel=false
|
||||
}else{
|
||||
this.$message('密码错误');
|
||||
}
|
||||
},
|
||||
},
|
||||
//失去焦点 计算公式 x/10
|
||||
blurChange10(code, el) {
|
||||
var store = this.$store.state
|
||||
|
Loading…
x
Reference in New Issue
Block a user