Commit 7766f2ac authored by caicaicai's avatar caicaicai

修改

parent 8780570f
......@@ -70,6 +70,12 @@ export default {
})
},
//关闭清除定时器
dingshiqiCloseFn(){
if(this.sonTimer1) { //如果定时器还在运行 或者直接关闭,不用判断
clearInterval(this.sonTimer1); //关闭
}
},
//查询是否有卸车
loadData2(){
httpGet(vehicleInformationQuery,{number:this.carnumber}).then((res) => {
......@@ -171,9 +177,9 @@ export default {
},
beforeDestroy() {
if(this.sonTimer1) { //如果定时器还在运行 或者直接关闭,不用判断
clearInterval(this.sonTimer1); //关闭
}
// if(this.sonTimer1) { //如果定时器还在运行 或者直接关闭,不用判断
// clearInterval(this.sonTimer1); //关闭
// }
}
}
</script>
......
......@@ -19,7 +19,7 @@
<div class="voiceAppContent_2_content">
<el-checkbox-group v-model="selectCarRadioArray">
<el-checkbox v-for="(item,index) in carsInforData" :label="item" :key="index" style="margin-top:10px;">
<div style="width:20vw;text-align: center;">{{item.number}}</div>
<div style="width:20vw;text-align: center;">{{item.number == 'pcBigScreen' ? '调度中心' : item.number}}</div>
</el-checkbox>
</el-checkbox-group>
</div>
......@@ -30,7 +30,7 @@
</div>
<div class="voiceAppContent_2_3_content">
<div v-for="(item,index) in selectCarRadioArray" :key="index" class="voiceAppContent_2_content_selectCar">
<div>车牌号:{{item.number}}</div>
<div>车牌号:{{item.number == 'pcBigScreen' ? '调度中心' : item.number}}</div>
<div style="width:27px;height:27px;background-color: rgb(4,112,171);text-align: center;font-size:40px;" @click="cancelSelect(index)">
<span>×</span>
</div>
......@@ -192,11 +192,12 @@ export default {
});
this.loadData2();
//页面刚进入时开启长连接
this.initWebSocket();
this.heartbeatTimer = setInterval(() => {
this.reconnect();
}, 10000)
// this.initWebSocket();
// this.heartbeatTimer = setInterval(() => {
// this.reconnect();
// }, 10000)
},
//获取车辆数据
loadData2() {
let query = {};
query.size = 9999;
......@@ -206,10 +207,21 @@ export default {
//车辆
httpGet(vehicleInformationQuery,query).then((res) => {
if(res.code == 200){
let obj1 = res.data.content;
obj1.unshift({number:'pcBigScreen'});
this.carsInforData = res.data.content;
}
});
},
//页面刚进入时开启长连接
loadData3(value){
this.userName1 = value; //车牌号
this.initWebSocket();
this.heartbeatTimer = setInterval(() => {
this.reconnect();
}, 10000)
},
//关闭语音申请组件
voiceAppCloseFn(){
this.showDecide = false;
this.selectCarFleet = '';
......@@ -218,6 +230,15 @@ export default {
this.situationWhich = 10000;
this.recClose();
//页面销毁时关闭长连接
// this.websocketclose();
//关闭心跳
// if(this.heartbeatTimer) {
// clearInterval(this.heartbeatTimer);
// }
},
//关闭心跳以及关闭长连接
xintiaoCloseFn(){
//页面销毁时关闭长连接
this.websocketclose();
//关闭心跳
if(this.heartbeatTimer) {
......@@ -697,11 +718,11 @@ export default {
},
beforeDestroy(){
//页面销毁时关闭长连接
this.websocketclose();
// this.websocketclose();
//关闭心跳
if(this.heartbeatTimer) {
clearInterval(this.heartbeatTimer);
}
// if(this.heartbeatTimer) {
// clearInterval(this.heartbeatTimer);
// }
}
}
</script>
......
......@@ -144,6 +144,7 @@ export default {
this.carnumber = res.data.content[0].car;
this.personalName = res.data.content[0].name;
this.$refs.startOrderReceivingMethod.loadData(this.carnumber);
this.$refs.voiceApplicationMethod.loadData3(this.carnumber);
httpGet(vehicleInformationQuery,{number:this.carnumber}).then((res) => {
if(res.code == 200){
......@@ -385,6 +386,8 @@ export default {
},
},
beforeDestroy(){
this.$refs.voiceApplicationMethod.xintiaoCloseFn();
this.$refs.startOrderReceivingMethod.dingshiqiCloseFn();
if(this.zongTimer1) {
clearInterval(this.zongTimer1);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment