|
@@ -55,7 +55,7 @@ export default {
|
|
|
pageflag: true,
|
|
|
timer: null,
|
|
|
config: {
|
|
|
- number: [100],
|
|
|
+ number: [0],
|
|
|
content: "{nt}",
|
|
|
style: {
|
|
|
...style,
|
|
@@ -109,11 +109,12 @@ export default {
|
|
|
methods: {
|
|
|
clearData() {
|
|
|
if (this.timer) {
|
|
|
+ // this.onlineconfig = {
|
|
|
+ // ...this.onlineconfig,
|
|
|
+ // number: [0],
|
|
|
+ // };
|
|
|
clearInterval(this.timer);
|
|
|
this.timer = null;
|
|
|
- this.onlineconfig = {
|
|
|
- number: [0],
|
|
|
- };
|
|
|
}
|
|
|
},
|
|
|
deviceView() {
|
|
@@ -136,55 +137,29 @@ export default {
|
|
|
...this.laramnumconfig,
|
|
|
number: [res.data.alarmCount],
|
|
|
};
|
|
|
- this.switper();
|
|
|
+ // this.switper();
|
|
|
} else {
|
|
|
this.pageflag = false;
|
|
|
this.$Message.warning(res.msg);
|
|
|
}
|
|
|
|
|
|
- this.switper();
|
|
|
+ // this.switper();
|
|
|
});
|
|
|
},
|
|
|
- // getData() {
|
|
|
- // this.pageflag = true;
|
|
|
- // currentGET("big2").then((res) => {
|
|
|
- // if (!this.timer) {
|
|
|
- // console.log("设备总览", res);
|
|
|
- // }
|
|
|
- // if (res.success) {
|
|
|
- // this.userOverview = res.data;
|
|
|
- // this.onlineconfig = {
|
|
|
- // ...this.onlineconfig,
|
|
|
- // number: [res.data.onlineNum],
|
|
|
- // };
|
|
|
- // this.config = {
|
|
|
- // ...this.config,
|
|
|
- // number: [res.data.totalNum],
|
|
|
- // };
|
|
|
- // this.offlineconfig = {
|
|
|
- // ...this.offlineconfig,
|
|
|
- // number: [res.data.offlineNum],
|
|
|
- // };
|
|
|
- // this.laramnumconfig = {
|
|
|
- // ...this.laramnumconfig,
|
|
|
- // number: [res.data.alarmNum],
|
|
|
- // };
|
|
|
- // this.switper();
|
|
|
- // } else {
|
|
|
- // this.pageflag = false;
|
|
|
- // this.$Message.warning(res.msg);
|
|
|
- // }
|
|
|
- // });
|
|
|
- // },
|
|
|
//轮询
|
|
|
switper() {
|
|
|
if (this.timer) {
|
|
|
console.log(this.timer, "1212");
|
|
|
- return;
|
|
|
+ // return;
|
|
|
+ }else{
|
|
|
+ console.log('我在else', this.onlineconfig.number);
|
|
|
+ // this.onlineconfig = {
|
|
|
+ // ...this.onlineconfig,
|
|
|
+ // number: [0],
|
|
|
+ // };
|
|
|
}
|
|
|
let looper = (a) => {
|
|
|
- console.log(a, "aa");
|
|
|
- this.deviceView();
|
|
|
+ // this.deviceView();
|
|
|
};
|
|
|
this.timer = setInterval(
|
|
|
looper,
|