Browse Source

fix: 图表样式修改

TwoKe945 1 year ago
parent
commit
ba3b51e4bd
2 changed files with 10 additions and 4 deletions
  1. 2 1
      app/src/views/Home/components/FireIndex/Chart.vue
  2. 8 3
      app/src/views/Home/index.vue

+ 2 - 1
app/src/views/Home/components/FireIndex/Chart.vue

@@ -118,7 +118,8 @@ export default {
           },
         },
         grid: {
-          right: "8px",
+          left: "45px",
+          right: '8px',
           top: "20px",
         },
         series: [

+ 8 - 3
app/src/views/Home/index.vue

@@ -144,6 +144,8 @@ export default {
   },
   data() {
     return {
+      // 定时器
+      timer: null,
       riskList: [],
       // 传参
       qy: "重庆市",
@@ -364,16 +366,19 @@ export default {
     this.loadMapData();
   },
   mounted(){
-    setInterval(() => {
+    this.timer = setInterval(() => {
       // 获取通知
       getJqdt(this.params).then((res) => {
         // console.log("通知", res);
         this.PoliceList = res.data.rows;
       });
     }, 6000 );
-
+  },
+  destroyed() {
+    if (this.timer) {
+      clearInterval(this.timer)
+    }
   }
-  
 };
 </script>
 <style scoped>