From c24a5a2a99515b365ebc343b04538bb862790de1 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 21 十二月 2023 11:44:22 +0800
Subject: [PATCH] Merge branch 'feature-code-refactoring' and 'feature-002'

---
 src/views/exception/components/DustLineChart.vue |  202 ++++++++++++++++++++++++--------------------------
 1 files changed, 96 insertions(+), 106 deletions(-)

diff --git a/src/views/exception/components/DustLineChart.vue b/src/views/exception/components/DustLineChart.vue
index f7b0c85..66f55fd 100644
--- a/src/views/exception/components/DustLineChart.vue
+++ b/src/views/exception/components/DustLineChart.vue
@@ -4,112 +4,102 @@
 **鐖剁粍浠�
 
  -->
- <template>
-       <div  id="main" class="line-chart-exception"></div>
-   
-  </template>
-  
-  <script>
-  import * as echarts from 'echarts';
-  
-  export default {
-    props: {
-      option:{
-        type:Object,
-        default(){
-          return {}
-        }
-      },
-      isOpenDialog:{
-        type:Boolean
-      },
-  
-    },
-    data() {
-      return {
-        chart: null
-      };
-    },
-    mounted() {
-       // 鑾峰彇椤甸潰瀹藉害鐨勪竴鍗�
-      this.initChart();
-      this.chart.clear
-      this.chart.setOption(this.option,true)
-      window.addEventListener('resize', this.resizeChart);
-    },
-    watch: {
-      option(){
-        // this.chart.clear
-        // 涓嶄笌涔嬪墠鐨刼ption杩涜鍚堝苟
-        this.chart.setOption(this.option,true)
-      },
-      isOpenDialog(){
-        window.addEventListener('resize', this.resizeChart);
-      },
-    },
- 
-    methods: {
-      initChart() {
-        // 鍒涘缓echarts瀹炰緥
-        this.chart = echarts.init(document.getElementById('main'));
-        // 瀹氫箟鍥捐〃鐨勯厤缃」鍜屾暟鎹�
-        const option = {
-          grid: {
-            left: '3%',
-            right: '4%',
-            bottom: '3%',
-            containLabel: true
-          },
-          tooltip: {},
-          toolbox: {
-            // 宸ュ叿鏍�
-            feature: {
-              // dataZoom: {
-              //   // 鍖哄煙缂╂斁
-              //   yAxisIndex: 'none'
-              // },
-              // 淇濆瓨涓哄浘鐗�
-              saveAsImage: {}
-            }
-          },
-          xAxis: {
-            type: 'time',
-            data: [],
-          },
-          yAxis: {
-            type: 'value',
-          },
-          series: [
-            {
-              name: '棰楃矑鐗╂祿搴�',
-              type: 'line',
-              data: []
-            }
-          ]
-        };
-        // 浣跨敤鍒氭寚瀹氱殑閰嶇疆椤瑰拰鏁版嵁鏄剧ず鍥捐〃
-        this.chart.setOption(option, true);
-      },
-  
-      // 璺熼〉闈㈠搷搴斿紡鍙樺寲
-      resizeChart() {
-        this.$nextTick(() => {
-        if (this.chart) {
-          this.chart.resize();
-        }
-      });
+<template>
+  <div id="main" class="line-chart-exception"></div>
+</template>
+
+<script>
+import * as echarts from 'echarts'
+
+export default {
+  props: {
+    option: {
+      type: Object,
+      default() {
+        return {}
       }
     }
-  };
-  </script>
-  
-  
-  <style scoped>
-  .line-chart-exception {
-    width: 600px;
-    height: 250px;
-    margin-bottom: 20px;
-    min-width: 500px;
+  },
+  data() {
+    return {
+      chart: null
+    }
+  },
+  mounted() {
+    // 鑾峰彇椤甸潰瀹藉害鐨勪竴鍗�
+    this.initChart()
+    this.chart.clear
+    this.chart.setOption(this.option, true)
+    window.addEventListener('resize', this.resizeChart)
+  },
+  watch: {
+    option() {
+      // this.chart.clear
+      // 涓嶄笌涔嬪墠鐨刼ption杩涜鍚堝苟
+      this.chart.setOption(this.option, true)
+    }
+  },
+
+  methods: {
+    initChart() {
+      // 鍒涘缓echarts瀹炰緥
+      this.chart = echarts.init(document.getElementById('main'))
+      // 瀹氫箟鍥捐〃鐨勯厤缃」鍜屾暟鎹�
+      const option = {
+        grid: {
+          left: '3%',
+          right: '4%',
+          bottom: '3%',
+          containLabel: true
+        },
+        tooltip: {},
+        toolbox: {
+          // 宸ュ叿鏍�
+          feature: {
+            // dataZoom: {
+            //   // 鍖哄煙缂╂斁
+            //   yAxisIndex: 'none'
+            // },
+            // 淇濆瓨涓哄浘鐗�
+            saveAsImage: {}
+          }
+        },
+        xAxis: {
+          type: 'time',
+          data: []
+        },
+        yAxis: {
+          type: 'value'
+        },
+        series: [
+          {
+            name: '棰楃矑鐗╂祿搴�',
+            type: 'line',
+            data: []
+          }
+        ]
+      }
+      // 浣跨敤鍒氭寚瀹氱殑閰嶇疆椤瑰拰鏁版嵁鏄剧ず鍥捐〃
+      this.chart.setOption(option, true)
+    },
+
+    // 璺熼〉闈㈠搷搴斿紡鍙樺寲
+    resizeChart() {
+      this.$nextTick(() => {
+        if (this.chart) {
+          this.chart.resize()
+        }
+      })
+    }
   }
-  </style>
-  
\ No newline at end of file
+}
+</script>
+
+<style scoped>
+.line-chart-exception {
+  width: 600px;
+  height: 250px;
+  margin-bottom: 20px;
+  min-width: 500px;
+}
+</style>

--
Gitblit v1.9.3