|
|
@@ -259,6 +259,8 @@ export default {
|
|
|
checkButton:2,
|
|
|
effective:false,
|
|
|
modList:[],
|
|
|
+ //定时器
|
|
|
+ pollTimer: null
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -266,22 +268,14 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
this.laboratoryLabScreenScreenConfigGet();
|
|
|
- if(this.checkButton == 1){
|
|
|
- this.demo()
|
|
|
- }else if(this.checkButton == 2){
|
|
|
- this.getMonitorTree();
|
|
|
- this.getDeptDropList();
|
|
|
- }
|
|
|
+ this.pollTimer = setInterval(this.laboratoryLabScreenScreenConfigGet, 5 * 60 * 1000)
|
|
|
+ },
|
|
|
+ beforeDestroy() {
|
|
|
+ if (this.pollTimer) clearInterval(this.pollTimer)
|
|
|
},
|
|
|
methods: {
|
|
|
buttonClick(val){
|
|
|
this.$set(this,'checkButton',val);
|
|
|
- if(val == 1){
|
|
|
- this.demo()
|
|
|
- }else if(val == 2){
|
|
|
- this.getMonitorTree();
|
|
|
- this.getDeptDropList();
|
|
|
- }
|
|
|
},
|
|
|
handleEnter(){
|
|
|
this.getMonitorTree();
|
|
|
@@ -541,6 +535,9 @@ export default {
|
|
|
this.$set(this,'modList',res.data.items);
|
|
|
if(res.data.effective){
|
|
|
this.$set(this,'checkButton',1);
|
|
|
+ }else{
|
|
|
+ this.getMonitorTree();
|
|
|
+ this.getDeptDropList();
|
|
|
}
|
|
|
}
|
|
|
} catch (e) {
|