From 8e8d00477b1f30183d0d09cd7ec744067595dc46 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期三, 18 三月 2026 17:29:15 +0800
Subject: [PATCH] 2026.3.18

---
 src/sfc/ExceptionTypeLineChart.vue |   74 ++++++++++++++++++-------------------
 1 files changed, 36 insertions(+), 38 deletions(-)

diff --git a/src/sfc/ExceptionTypeLineChart.vue b/src/sfc/ExceptionTypeLineChart.vue
index 75576f2..ae457c4 100644
--- a/src/sfc/ExceptionTypeLineChart.vue
+++ b/src/sfc/ExceptionTypeLineChart.vue
@@ -1,5 +1,5 @@
 <!-- 寮傚父鎯呭喌鐨� 鎶樼嚎鍥剧粍浠�
-瀛愮粍浠舵湁鍩烘湰鐨勬牱寮� 
+瀛愮粍浠舵湁鍩烘湰鐨勬牱寮�
 浣跨敤鍚屼竴涓浘褰㈠疄渚嬶紝鎺ュ彈鐖剁粍浠朵紶鍏ョ殑鎶樼嚎鍥緊ption
 **鐖剁粍浠�
  <ExceptionTypeLineChart
@@ -9,66 +9,65 @@
       ></ExceptionTypeLineChart>
  -->
 <template>
-  <div  id="main" class="line-chart"></div>
+  <div id="main" class="line-chart"></div>
 </template>
 
 <script>
-import * as echarts from 'echarts';
+import * as echarts from 'echarts'
 
 export default {
   props: {
-    option:{
-      type:Object,
-      default(){
+    option: {
+      type: Object,
+      default() {
         return {}
-      }
+      },
     },
-    isOpenDialog:{
-      type:Boolean
+    isOpenDialog: {
+      type: Boolean,
     },
-
   },
   data() {
     return {
-      chart: null
-    };
+      chart: null,
+    }
   },
   mounted() {
-     // 鑾峰彇椤甸潰瀹藉害鐨勪竴鍗�
-     
-    this.initChart();
+    // 鑾峰彇椤甸潰瀹藉害鐨勪竴鍗�
+
+    this.initChart()
     this.chart.clear
-    this.chart.setOption(this.option,true)
-    window.addEventListener('resize', this.resizeChart);
+    this.chart.setOption(this.option, true)
+    window.addEventListener('resize', this.resizeChart)
   },
   watch: {
-    option(){
+    option() {
       // this.chart.dispose;
       // this.initChart();
       // this.chart.clear
       // 涓嶄笌涔嬪墠鐨刼ption杩涜鍚堝苟
-      this.chart.setOption(this.option,true)
+      this.chart.setOption(this.option, true)
     },
-    isOpenDialog(){
-      window.addEventListener('resize', this.resizeChart);
+    isOpenDialog() {
+      window.addEventListener('resize', this.resizeChart)
     },
   },
   beforeUnmount() {
     if (this.chart) {
-      this.chart.dispose;
+      this.chart.dispose
     }
   },
   methods: {
     initChart() {
       // 鍒涘缓echarts瀹炰緥
-      this.chart = echarts.init(document.getElementById('main'));
+      this.chart = echarts.init(document.getElementById('main'))
       // 瀹氫箟鍥捐〃鐨勯厤缃」鍜屾暟鎹�
       const option = {
         grid: {
           left: '3%',
           right: '4%',
           bottom: '3%',
-          containLabel: true
+          containLabel: true,
         },
         tooltip: {},
         toolbox: {
@@ -79,8 +78,8 @@
             //   yAxisIndex: 'none'
             // },
             // 淇濆瓨涓哄浘鐗�
-            saveAsImage: {}
-          }
+            saveAsImage: {},
+          },
         },
         xAxis: {
           type: 'time',
@@ -93,31 +92,30 @@
           {
             name: '娌圭儫娴撳害',
             type: 'line',
-            data: []
-          }
-        ]
-      };
+            data: [],
+          },
+        ],
+      }
       // 浣跨敤鍒氭寚瀹氱殑閰嶇疆椤瑰拰鏁版嵁鏄剧ず鍥捐〃
-      this.chart.setOption(option, true);
+      this.chart.setOption(option, true)
     },
 
     // 璺熼〉闈㈠搷搴斿紡鍙樺寲
     resizeChart() {
       this.$nextTick(() => {
         if (this.chart) {
-          this.chart.resize();
+          this.chart.resize()
         }
-      });
+      })
       // this.chart.resize();
-    }
-  }
-};
+    },
+  },
+}
 </script>
-
 
 <style>
 .line-chart {
-  width:920px;
+  width: 100%;
   height: 300px;
   margin-bottom: 20px;
   /* margin-left: 10px; */

--
Gitblit v1.9.3