|
@@ -91,6 +91,7 @@ export default {
|
|
|
flag: false,
|
|
|
isFullscreen: false, // 初始状态为非全屏
|
|
|
dateTime: "",
|
|
|
+ timer: null,
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -154,13 +155,27 @@ export default {
|
|
|
this.isFullscreen = true;
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
initData() {
|
|
|
percent().then((res) => {
|
|
|
this.percentData = res.data;
|
|
|
this.flag = true;
|
|
|
- console.log("我刚执行");
|
|
|
+ this.switper();
|
|
|
});
|
|
|
this.$refs.updateData.initData();
|
|
|
+ },
|
|
|
+ //轮询
|
|
|
+ switper() {
|
|
|
+ if (this.timer) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let looper = (a) => {
|
|
|
+ this.initData();
|
|
|
+ };
|
|
|
+ this.timer = setInterval(
|
|
|
+ looper,
|
|
|
+ this.$store.state.settings.echartsAutoTime
|
|
|
+ );
|
|
|
},
|
|
|
initMap(AMap) {
|
|
|
console.log("进来了");
|