|
@@ -280,6 +280,7 @@ export default {
|
|
|
taskData: [
|
|
|
],
|
|
|
current: 1,
|
|
|
+ timer: null,
|
|
|
confirmDisabled: true,
|
|
|
tenantViewVisible: false,
|
|
|
view1Visible: false,
|
|
@@ -301,16 +302,21 @@ export default {
|
|
|
return this.$store.state.account.user;
|
|
|
},
|
|
|
},
|
|
|
- mounted() {},
|
|
|
+ mounted() {
|
|
|
+ //setInterval(this.getStation, 2000);
|
|
|
+ this.timerTask()
|
|
|
+ },
|
|
|
methods: {
|
|
|
tabClick(e){
|
|
|
console.log("被选择的tab:", e.index)
|
|
|
// 待执行-tab
|
|
|
if(e.index == 0){
|
|
|
- this.getStation()
|
|
|
+ //this.getStation()
|
|
|
+ this.timerTask()
|
|
|
}
|
|
|
// 已完成-tab
|
|
|
if(e.index == 1){
|
|
|
+ this.clearTimer()
|
|
|
this.fetch()
|
|
|
}
|
|
|
},
|
|
@@ -327,7 +333,19 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
+ //定时器处理
|
|
|
+ timerTask(){
|
|
|
+ let that = this
|
|
|
+ that.timer = setInterval(()=>{
|
|
|
+ this.getStation();
|
|
|
+ }, 60000)
|
|
|
+ },
|
|
|
+ clearTimer(){
|
|
|
+ if(this.timer){
|
|
|
+ clearInterval(this.timer)
|
|
|
+ this.timer = null
|
|
|
+ }
|
|
|
+ },
|
|
|
// 退出全屏
|
|
|
exitFullPing() {
|
|
|
this.$nextTick(() => {
|
|
@@ -402,8 +420,8 @@ export default {
|
|
|
this.view3Visible = false
|
|
|
},
|
|
|
editSuccess(item){
|
|
|
- this.getStation(item)
|
|
|
- // this.taskData.shift();
|
|
|
+ this.getStation()
|
|
|
+ this.taskData.shift();
|
|
|
},
|
|
|
setPercentage(time, left) {
|
|
|
return this.formatGap(time, left)[0] > 100
|