Browse Source

Merge branch 'master' of http://182.92.126.35:3000/hrx/mky-vent-base

hongrunxia 1 week ago
parent
commit
aa4e03cb93

+ 1 - 0
src/views/vent/deviceManager/configurationTable/types.ts

@@ -209,6 +209,7 @@ export interface ModuleDataChart extends ReadFrom {
     | 'bar_cylinder'
     | 'bar_cylinder_wide'
     | 'pie_halo'
+    | 'line_enhance'
     | 'pie_drag';
   /** 排序依据,该项应配置将配合 readFrom 使用 */
   sortBy?: string;

+ 54 - 0
src/views/vent/home/configurable/components/detail/CustomChart.vue

@@ -489,6 +489,60 @@
       };
     }
 
+    if (type === 'line_enhance') {
+      return {
+        textStyle,
+        legend: {
+          show: legend.show,
+          top: 10,
+          right: 10,
+          textStyle,
+        },
+        tooltip: {
+          trigger: 'item',
+        },
+        grid: {
+          left: 60,
+          top: 40,
+          right: 60,
+          bottom: dataZoom.length ? 70 : 30,
+        },
+        dataZoom: baseDataZoom,
+        xAxis: xAxis.map((e) => {
+          return {
+            ...e,
+            type: 'category',
+            axisLabel: {
+              width: 100,
+              overflow: 'break',
+            },
+          };
+        }),
+        yAxis: yAxis.map((e, i) => {
+          return {
+            ...e,
+            min: (value) => {
+              return parseInt(value.min * 0.8);
+            },
+            max: (value) => {
+              return parseInt(value.max * 1.2);
+            },
+            splitLine: {
+              lineStyle: {
+                opacity: i === 0 ? 0.1 : 0,
+              },
+            },
+          };
+        }),
+        series: baseSeries.map((serie) => {
+          return {
+            ...serie,
+            type: 'line',
+          };
+        }),
+      };
+    }
+
     // 平滑曲线图
     if (type === 'line_smooth') {
       return {