Selaa lähdekoodia

新增自定义分析图形组件

liujiejie 4 kuukautta sitten
vanhempi
commit
1f37947559
24 muutettua tiedostoa jossa 1797 lisäystä ja 67 poistoa
  1. 27 27
      .env.dev
  2. 70 0
      src/assets/js/constants/echarts-config/doughnut.js
  3. 69 0
      src/assets/js/constants/echarts-config/lineHighlight.js
  4. 16 0
      src/assets/js/constants/index.js
  5. 1 0
      src/icons/svg/doughnut.svg
  6. 0 0
      src/icons/svg/doughnut1.svg
  7. 1 0
      src/icons/svg/funnelPlot.svg
  8. 1 0
      src/icons/svg/funnelPlot1.svg
  9. 1 0
      src/icons/svg/funnelPlot2.svg
  10. 0 0
      src/icons/svg/horizontalStackedBar.svg
  11. 1 0
      src/icons/svg/horizontalStackedBar1.svg
  12. 1 0
      src/icons/svg/horizontalStackedBar2.svg
  13. 0 0
      src/icons/svg/lineHighlight.svg
  14. 1 0
      src/icons/svg/styleChart.svg
  15. 0 0
      src/icons/svg/styleChart1.svg
  16. 1 0
      src/store/dragChart.js
  17. 14 7
      src/views/performance/components/custonAsCom/dragChart/components/chartConfig/config.js
  18. 18 3
      src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/chartLogic/modules/pie.js
  19. 22 3
      src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/chartTitle.vue
  20. 3 2
      src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/configFn.js
  21. 1 0
      src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/index.js
  22. 1434 0
      src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/toolbox.vue
  23. 46 24
      src/views/performance/components/custonAsCom/dragChart/components/chartsAttributes.vue
  24. 69 1
      src/views/performance/components/custonAsCom/dragChart/index.vue

+ 27 - 27
.env.dev

@@ -1,8 +1,8 @@
 ###
  # @Author: your name
  # @Date: 2025-07-17 14:14:27
- # @LastEditTime: 2025-07-30 10:04:53
- # @LastEditors: milo-MacBook-Pro.local
+ # @LastEditTime: 2025-08-12 09:23:49
+ # @LastEditors: bogon
  # @Description: In User Settings Edit
  # @FilePath: /performance-test/.env.dev
 #这里需要在router/index.js 文件中进行判断cockpitComponent;
@@ -12,30 +12,30 @@ VUE_APP_ISSHOWHD='default'
 VUE_APP_TITLE='机组功率曲线异常检测数据分析系统'
 
 #外网
-VUE_APP_MAPVIEW=/tiles/{z}/{x}/{y}.png
-VUE_APP_UPLOAD="http://106.120.102.238:16700/energy-manage-service/api/check/upload"
-VUE_APP_APIPROXY='http://106.120.102.238:16700'
-VUE_APP_MAP=http://106.120.102.238:18080
-VUE_APP_WZLAPIPROXY='http://106.120.102.238:18080/WindTransDev'
-VUE_APP_ETLAPIPROXY='http://106.120.102.238:18080/WindTransDev'
-VUE_APP_AnalysisMultiAPIPROXY='http://106.120.102.238:28999/AnalysisMulti'
-#自定义算法文佳 目前无法使用,可能是服务未启动
-VUE_APP_sAlgorithmAPIPROXY='http://106.120.102.238:58880'
-VUE_APP_databaseApiAPIPROXY='http://106.120.102.238:58880'
-# #暂时不知下载报告内网dev 环境地址
-VUE_APP_downLoadChartAPIPROXY='http://106.120.102.238:58880'
+# VUE_APP_MAPVIEW=/tiles/{z}/{x}/{y}.png
+# VUE_APP_UPLOAD="http://106.120.102.238:16700/energy-manage-service/api/check/upload"
+# VUE_APP_APIPROXY='http://106.120.102.238:16700'
+# VUE_APP_MAP=http://106.120.102.238:18080
+# VUE_APP_WZLAPIPROXY='http://106.120.102.238:18080/WindTransDev'
+# VUE_APP_ETLAPIPROXY='http://106.120.102.238:18080/WindTransDev'
+# VUE_APP_AnalysisMultiAPIPROXY='http://106.120.102.238:28999/AnalysisMulti'
+# #自定义算法文佳 目前无法使用,可能是服务未启动
+# VUE_APP_sAlgorithmAPIPROXY='http://106.120.102.238:58880'
+# VUE_APP_databaseApiAPIPROXY='http://106.120.102.238:58880'
+# # #暂时不知下载报告内网dev 环境地址
+# VUE_APP_downLoadChartAPIPROXY='http://106.120.102.238:58880'
 
 #内网
-# VUE_APP_UPLOAD="http://192.168.50.235/energy-manage-service/api/check/upload"
-# VUE_APP_MAPVIEW=/tiles/{z}/{x}/{y}.png
-# VUE_APP_MAP=http://192.168.50.235
-# VUE_APP_APIPROXY='http://192.168.50.235:16200'
-# VUE_APP_WZLAPIPROXY='http://192.168.50.241:9001'
-# VUE_APP_ETLAPIPROXY='http://192.168.50.241:9001'
-# # #自定义算法文佳 目前无法使用,可能是服务未启动
-# VUE_APP_sAlgorithmAPIPROXY='http://192.168.50.235:8998/AnalysisMulti'
-# VUE_APP_databaseApiAPIPROXY='http://192.168.50.234:3002'
-# #暂时不知健康评估内网dev 环境地址
-# VUE_APP_AnalysisMultiAPIPROXY='http://192.168.50.235:8998/AnalysisMulti'
-# #暂时不知下载报告内网dev 环境地址
-# VUE_APP_downLoadChartAPIPROXY=''
+VUE_APP_UPLOAD="http://192.168.50.235/energy-manage-service/api/check/upload"
+VUE_APP_MAPVIEW=/tiles/{z}/{x}/{y}.png
+VUE_APP_MAP=http://192.168.50.235
+VUE_APP_APIPROXY='http://192.168.50.235:16200'
+VUE_APP_WZLAPIPROXY='http://192.168.50.241:9001'
+VUE_APP_ETLAPIPROXY='http://192.168.50.241:9001'
+# #自定义算法文佳 目前无法使用,可能是服务未启动
+VUE_APP_sAlgorithmAPIPROXY='http://192.168.50.235:8998/AnalysisMulti'
+VUE_APP_databaseApiAPIPROXY='http://192.168.50.234:3002'
+#暂时不知健康评估内网dev 环境地址
+VUE_APP_AnalysisMultiAPIPROXY='http://192.168.50.235:8998/AnalysisMulti'
+#暂时不知下载报告内网dev 环境地址
+VUE_APP_downLoadChartAPIPROXY='http://106.120.102.238:58880'

+ 70 - 0
src/assets/js/constants/echarts-config/doughnut.js

@@ -0,0 +1,70 @@
+/*
+ * @Author: your name
+ * @Date: 2025-08-15 09:58:57
+ * @LastEditTime: 2025-08-15 10:13:36
+ * @LastEditors: bogon
+ * @Description: In User Settings Edit
+ * @FilePath: /performance-test/src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/chartLogic/modules/doughnut.js
+ */
+import { colorPalette } from "../color";
+export const option = {
+  color: colorPalette,
+  title: {
+    text: "风电场发电量来源占比",
+    left: "center",
+  },
+  tooltip: {
+    trigger: "item",
+  },
+  toolbox: {
+    feature: {
+      dataView: { show: true, readOnly: false },
+      restore: { show: true },
+      saveAsImage: { show: true },
+    },
+  },
+  legend: {
+    top: "bottom",
+    left: "left",
+    data: ["风速 1-5 m/s", "风速 5-10 m/s", "风速 10-15 m/s", "风速 15+ m/s"],
+  },
+  series: [
+    {
+      name: "发电量占比",
+      type: "pie",
+      radius: ["40%", "70%"],
+      avoidLabelOverlap: false,
+      padAngle: 5,
+      itemStyle: {
+        borderRadius: 10,
+      },
+      label: {
+        show: false,
+        position: "center",
+      },
+      emphasis: {
+        label: {
+          show: true,
+          fontSize: 40,
+          fontWeight: "bold",
+        },
+      },
+      labelLine: {
+        show: false,
+      },
+      data: [
+        { value: 300, name: "风速 1-5 m/s" },
+        { value: 500, name: "风速 5-10 m/s" },
+        { value: 400, name: "风速 10-15 m/s" },
+        { value: 200, name: "风速 15+ m/s" },
+      ],
+      emphasis: {
+        itemStyle: {
+          shadowBlur: 10,
+          shadowOffsetX: 0,
+          shadowColor: "rgba(0, 0, 0, 0.5)",
+        },
+      },
+    },
+  ],
+};

+ 69 - 0
src/assets/js/constants/echarts-config/lineHighlight.js

@@ -0,0 +1,69 @@
+/*
+ * @Author: your name
+ * @Date: 2025-08-15 09:49:27
+ * @LastEditTime: 2025-08-15 10:08:50
+ * @LastEditors: bogon
+ * @Description: In User Settings Edit
+ * @FilePath: /performance-test/src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/chartLogic/modules/lineHighlight.js
+ */
+import { colorPalette } from "../color";
+export const option = {
+  color: colorPalette,
+  title: {
+    text: "风速-功率曲线图",
+  },
+  tooltip: {
+    trigger: "axis",
+  },
+  legend: {
+    top: "bottom",
+    // data: ["Email", "Union Ads", "Video Ads", "Direct", "Search Engine"],
+  },
+  toolbox: {
+    feature: {
+      dataView: { show: true, readOnly: false },
+      magicType: { show: true, type: ["line", "bar"] },
+      restore: { show: true },
+      saveAsImage: { show: true },
+    },
+  },
+  xAxis: {
+    type: "category",
+    name: "风速 (m/s)",
+    // boundaryGap: false,
+    data: [5, 20, 35, 25, 10, 5],
+  },
+  yAxis: {
+    name: "功率 (kW)",
+    type: "value",
+    nameLocation: "middle", // 设置名称位置,可以是 'start', 'middle' 或 'end'
+    nameTextStyle: {
+      fontSize: 14, // 文字大小
+      color: "#333", // 文字颜色
+      padding: [0, 0, 30, 0], // 文字与轴线的距离
+    },
+  },
+  grid: {
+    top: "20%",
+    right: "20%",
+    bottom: "10%",
+    containLabel: true, // 包含标签在内
+  },
+  series: [
+    {
+      name: "功率曲线",
+      type: "line",
+      smooth: true,
+      data: [300, 22, 249, 345, 234, 56, 73], // 风速与功率对应数据
+      markPoint: {
+        data: [
+          { type: "max", name: "Max" },
+          { type: "min", name: "Min" },
+        ],
+      },
+      markLine: {
+        data: [{ type: "average", name: "Avg" }],
+      },
+    },
+  ],
+};

+ 16 - 0
src/assets/js/constants/index.js

@@ -4,6 +4,10 @@ export const charts = [
     name: "直方图",
   },
   {
+    type: "lineHighlight",
+    name: "曲线图",
+  },
+  {
     type: "scatter",
     name: "散点图",
   },
@@ -20,6 +24,10 @@ export const charts = [
     name: "饼图",
   },
   {
+    type: "doughnut",
+    name: "环形图",
+  },
+  {
     type: "roseChart",
     name: "玫瑰图",
   },
@@ -28,6 +36,14 @@ export const charts = [
     name: "散点折线图",
   },
   {
+    type: "horizontalStackedBar1",
+    name: "横向堆叠柱状图",
+  },
+  {
+    type: "funnelPlot2",
+    name: "漏斗图",
+  },
+  {
     type: "stackedBar",
     name: "堆叠柱状图",
   },

+ 1 - 0
src/icons/svg/doughnut.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755140273468" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="33140" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M855.68 230.63l-11.02-13.32L679.32 383.8l7.16 10.54c53.64 78.96 53.64 182.99 0 261.95l-7.16 10.54 165.34 166.5 11.02-13.32c138.21-170.99 138.21-416.19 0-587.18v-2.2zM627.55 711.79c-61.23 39.85-139.36 47.58-207.84 20.57s-118.14-85.13-132.09-154.62v-11.5H63.97v15.51c16.95 153.39 120.45 285.62 269.7 344.57s320.32 35.17 445.78-61.96l12.57-9.5-157.13-150.07-7.34 7z" fill="#4987bc" p-id="33141" data-spm-anchor-id="a313x.search_index.0.i16.73713a81qwFQqH" class="selected"></path><path d="M128.83 398.38H237.1c25.72-72.97 83.31-131.76 157.91-161.2 74.6-29.45 158.92-26.67 231.21 7.62l75.32-71.81c-60.17-35.06-129.28-53.69-199.79-53.85-177.49-1.46-332.35 114.5-372.92 279.24z m156.91 44.38l-2.62 11.47H63.97v-15.46c16.51-153.38 119.96-285.76 269.4-344.7s320.75-34.96 446.09 62.46l12.55 9.47-156.9 149.6-9.94-6.48c-61.14-39.72-139.15-47.43-207.54-20.51-68.39 26.92-117.96 84.87-131.89 154.15z" fill="#048FFF" p-id="33142"></path></svg>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
src/icons/svg/doughnut1.svg


+ 1 - 0
src/icons/svg/funnelPlot.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755140379861" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="35241" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M0 161.28h1024v184.32H0v-184.32z" fill="#346BAA" p-id="35242"></path><path d="M102.4 370.688h819.2v163.84H102.4v-163.84z" fill="#43A3D4" p-id="35243"></path><path d="M204.8 560.64h614.4v143.36H204.8v-143.36z" fill="#346BAA" p-id="35244"></path><path d="M307.2 739.84h409.6v122.88H307.2v-122.88z" fill="#64B064" p-id="35245"></path></svg>

+ 1 - 0
src/icons/svg/funnelPlot1.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755140490734" class="icon" viewBox="0 0 1280 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="42452" xmlns:xlink="http://www.w3.org/1999/xlink" width="250" height="200"><path d="M1280 0l-128 320H128L0 0z" fill="#5182E4" p-id="42453"></path><path d="M1120 384l-96 320H256l-96-320z" fill="#5182E4" fill-opacity=".3" p-id="42454"></path><path d="M992 768l-256 256H544L288 768z" fill="#5182E4" fill-opacity=".504" p-id="42455"></path></svg>

+ 1 - 0
src/icons/svg/funnelPlot2.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755140402263" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="36256" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M128 288L64 160h896l-64 128z" fill="#2E6BE6" p-id="36257"></path><path d="M224 480l-64-128h704l-64 128z" fill="#82A6F0" p-id="36258"></path><path d="M320 672l-64-128h512l-64 128z" fill="#CEE1FC" p-id="36259"></path><path d="M320 864v-128h384v128z" fill="#82A6F0" p-id="36260"></path></svg>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
src/icons/svg/horizontalStackedBar.svg


+ 1 - 0
src/icons/svg/horizontalStackedBar1.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755141463830" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="48619" data-spm-anchor-id="a313x.search_index.0.i46.73713a81qwFQqH" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M698.181818 300.450909V162.909091H232.727273v139.636364h465.454545z" fill="#ea9518" p-id="48620" data-spm-anchor-id="a313x.search_index.0.i47.73713a81qwFQqH" class="selected"></path><path d="M605.090909 535.272727v-139.636363H232.727273v139.636363z" fill="#4987bc" p-id="48621" data-spm-anchor-id="a313x.search_index.0.i44.73713a81qwFQqH" class=""></path><path d="M791.272727 791.272727v-139.636363H232.727273v139.636363z" fill="#ea9518" p-id="48622" data-spm-anchor-id="a313x.search_index.0.i48.73713a81qwFQqH" class="selected"></path><path d="M176.407273 847.592727V116.363636H116.363636v791.272728h814.545455v-60.043637z" fill="#4987bc" p-id="48623" data-spm-anchor-id="a313x.search_index.0.i43.73713a81qwFQqH" class=""></path></svg>

+ 1 - 0
src/icons/svg/horizontalStackedBar2.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755141424276" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="48412" data-spm-anchor-id="a313x.search_index.0.i38.73713a81qwFQqH" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M42.624 0.736C19.616 0.736 0.864 19.52 0.864 42.496v937.504c0 23.008 18.752 41.76 41.76 41.76s41.76-18.752 41.76-41.76V42.496A41.92 41.92 0 0 0 42.624 0.736z" fill="#4987bc" p-id="48413" data-spm-anchor-id="a313x.search_index.0.i39.73713a81qwFQqH" class=""></path><path d="M1021.632 979.872a41.792 41.792 0 0 0-41.76-41.6H42.496a41.696 41.696 0 0 0 0 83.36h937.504a41.792 41.792 0 0 0 41.6-41.76zM142.304 772.064v123.616c0 1.28 1.024 2.368 2.368 2.368h251.904c1.248 0 2.368-0.96 2.368-2.368v-123.616a2.368 2.368 0 0 0-2.368-2.368H144.64a2.304 2.304 0 0 0-2.368 2.368z m0-208.512v123.648c0 1.248 1.024 2.368 2.368 2.368h476.384c1.28 0 2.368-0.992 2.368-2.368V563.52a2.368 2.368 0 0 0-2.368-2.368H144.672a2.368 2.368 0 0 0-2.368 2.368z m0-208.48v123.616c0 1.248 1.024 2.368 2.368 2.368h380.16c1.216 0 2.368-0.992 2.368-2.368v-123.616a2.368 2.368 0 0 0-2.4-2.4H144.672a2.368 2.368 0 0 0-2.368 2.4z m0-208.384v123.52c0 1.216 1.024 2.368 2.368 2.368H829.44c1.248 0 2.368-1.024 2.368-2.4V146.56a2.368 2.368 0 0 0-2.368-2.368H144.576a2.464 2.464 0 0 0-2.24 2.496z" fill="#4987bc" p-id="48414" data-spm-anchor-id="a313x.search_index.0.i37.73713a81qwFQqH" class=""></path></svg>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
src/icons/svg/lineHighlight.svg


+ 1 - 0
src/icons/svg/styleChart.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755141726605" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="52410" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 0C227.328 0 0 227.328 0 512s227.328 512 512 512c45.568 0 85.504-39.936 85.504-85.504 0-23.04-5.632-39.936-22.528-56.832-11.264-16.896-23.04-34.304-23.04-56.832 0-45.568 39.936-85.504 85.504-85.504h102.4c159.232 0 284.672-124.928 284.672-284.672C1024 204.8 796.672 0 512 0z" fill="#25D6C9" p-id="52411"></path><path d="M824.832 512c-45.568 0-85.504-39.936-85.504-85.504 0-45.568 39.936-85.504 85.504-85.504 45.568 0 85.504 39.936 85.504 85.504 0 45.568-39.936 85.504-85.504 85.504zM654.336 284.16c-45.568 0-85.504-39.936-85.504-85.504s39.936-85.504 85.504-85.504c45.568 0 85.504 39.936 85.504 85.504-0.512 46.08-39.936 85.504-85.504 85.504zM369.664 284.16c-45.568 0-85.504-39.936-85.504-85.504s39.936-85.504 85.504-85.504c45.568 0 85.504 39.936 85.504 85.504 0 46.08-39.936 85.504-85.504 85.504zM199.168 512c-45.568 0-85.504-39.936-85.504-85.504 0-45.568 39.936-85.504 85.504-85.504 45.568 0 85.504 39.936 85.504 85.504 0 45.568-39.936 85.504-85.504 85.504z" fill="#D7FFFF" p-id="52412"></path></svg>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
src/icons/svg/styleChart1.svg


+ 1 - 0
src/store/dragChart.js

@@ -66,6 +66,7 @@ export default {
     },
     // 当前画布添加图表
     addChart(state, data) {
+      console.log(data, "data");
       //   console.log("当前画布添加图表", data);
       if (state.currentChartList.length <= 0) {
         state.currentChartList.push({ ...data, index: 0 });

+ 14 - 7
src/views/performance/components/custonAsCom/dragChart/components/chartConfig/config.js

@@ -7,6 +7,20 @@ export const configApi = [
     desc: "标题组件,包含主标题和副标题。",
   },
   // {
+  //   label: "调色工具栏", //提示文本
+  //   value: "toolbox", //组件名
+  //   icon: "styleChart1", //图标
+  //   name: "configStyleChart", //tab name
+  //   desc: "标题组件,包含主标题和副标题。",
+  // },
+  // {
+  //   label: "背景色",
+  //   value: "backgroundColor",
+  //   desc: "背景色,默认无背景。",
+  //   icon: "styleChart",
+  //   name: "configText",
+  // },
+  // {
   //   label: "雷达图坐标系组件",
   //   value: "radar",
   //   desc: "雷达图坐标系组件,只适用于雷达图。",
@@ -27,11 +41,4 @@ export const configApi = [
   //   icon: "text",
   //   name: "configText",
   // },
-  // {
-  //   label: "背景色",
-  //   value: "backgroundColor",
-  //   desc: "背景色,默认无背景。",
-  //   icon: "text",
-  //   name: "configText",
-  // },
 ];

+ 18 - 3
src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/chartLogic/modules/pie.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2024-11-26 16:33:45
- * @LastEditTime: 2025-01-02 16:22:21
+ * @LastEditTime: 2025-08-15 13:43:37
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/chartLogic/modules/pie.js
@@ -63,10 +63,21 @@ export function handlePieChartLogic(
     item.Ydata = formLabelAlign.Ydata;
   }
   const res = item.Ydata.map((yItem, yIndex) => {
+    console.log(item, "yItem");
     return {
       name: yItem.label,
-      type,
-      radius: "60%",
+      type: type === "doughnut" ? "pie" : type,
+      // radius: "60%",
+      radius: type === "doughnut" ? ["40%", "70%"] : "60%",
+      itemStyle: {
+        borderRadius: 10,
+      },
+      label: {
+        show: false,
+        position: "center",
+      },
+      // avoidLabelOverlap: false,
+      // padAngle: 5,
       progressiveThreshold: 3000, // 当数据量超过3000时启用渐进式渲染
       progressive: true, // 启用渐进式渲染
       renderMode: "webgl", // 启用 WebGL 渲染
@@ -88,5 +99,9 @@ export function handlePieChartLogic(
 
   if (item.Ydata[0]?.data?.length > 0) {
     item.option.series = res;
+    // item.option.legend = {
+    //   top: "5%",
+    //   left: "center",
+    // };
   }
 }

+ 22 - 3
src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/chartTitle.vue

@@ -115,6 +115,7 @@
               v-if="
                 // curEdit.type !== 'roseChart' &&
                 curEdit.type !== 'pie' &&
+                curEdit.type !== 'doughnut' &&
                 curEdit.type !== 'sankeyDiagram' &&
                 curEdit.type !== 'Heatmap'
               "
@@ -157,6 +158,7 @@
                 v-if="
                   // curEdit.type !== 'roseChart' &&
                   curEdit.type !== 'pie' &&
+                  curEdit.type !== 'doughnut' &&
                   curEdit.type !== 'sankeyDiagram' &&
                   curEdit.type !== 'Heatmap'
                 "
@@ -567,6 +569,7 @@
         label="X轴名称"
         v-if="
           curEdit.type !== 'pie' &&
+          curEdit.type !== 'doughnut' &&
           curEdit.type !== 'radar' &&
           curEdit.type !== 'roseChart' &&
           curEdit.type !== 'sankeyDiagram'
@@ -578,6 +581,7 @@
         label="Y轴名称"
         v-if="
           curEdit.type !== 'pie' &&
+          curEdit.type !== 'doughnut' &&
           curEdit.type !== 'radar' &&
           curEdit.type !== 'roseChart' &&
           curEdit.type !== 'pareto' &&
@@ -703,7 +707,7 @@ import {
 import Vue from "vue";
 import { constructNow } from "date-fns";
 export default {
-  name: "title",
+  name: "chartTitle",
   props: {
     curEdit: {
       type: Object,
@@ -830,6 +834,8 @@ export default {
           "radar",
           "scatter",
           "pie",
+          // "doughnut",
+          // "lineHighlight",
           "roseChart",
           "stackedBar",
           "boxPlot",
@@ -896,6 +902,7 @@ export default {
       }
     },
     handleMetrics(type) {
+      console.log(type, "type");
       switch (type) {
         case "init":
           if (
@@ -975,6 +982,7 @@ export default {
             this.formLabelAlign.LineXdata
           );
           break;
+
         case "scatter":
           this.formLabelAlign.ScatterXdata = this.updateAxisData(
             this.formLabelAlign.ScatterXdata
@@ -984,6 +992,7 @@ export default {
     },
     //指标值 处理整合数据
     handleYdata(ind, type) {
+      console.log(type, "type handleYdata");
       switch (type) {
         case "init":
           this.formLabelAlign.Ydata = this.updateAxisData(
@@ -1059,6 +1068,7 @@ export default {
           }
           //这里需要处理this.formFilterAlign.filter(item)
           break;
+
         case "scatter":
           if (this.curEdit.type === "Cp") {
             this.formFilterAlign.splice(
@@ -1081,6 +1091,7 @@ export default {
         case "line":
           this.formLabelAlign.LineXdata.splice(index, 1); // 删除当前项
           break;
+
         case "scatter":
           this.formLabelAlign.ScatterXdata.splice(index, 1); // 删除当前项
           break;
@@ -1296,7 +1307,12 @@ export default {
       // 确保标题和坐标轴对象存在
       item.option.title = item.option.title || {};
       Object.assign(item.option.title, { text: this.formLabelAlign.text });
-      if (this.curEdit.type === "bar" || this.curEdit.type === "line") {
+      console.log(this.curEdit.type, item, "this.curEdit.type");
+      if (
+        this.curEdit.type === "bar" ||
+        this.curEdit.type === "line" ||
+        this.curEdit.type === "lineHighlight"
+      ) {
         handleBarChartLogic(
           item,
           this.formLabelAlign,
@@ -1336,7 +1352,10 @@ export default {
           isFilter,
           this.curEdit.type
         );
-      } else if (this.curEdit.type === "pie") {
+      } else if (
+        this.curEdit.type === "pie" ||
+        this.curEdit.type === "doughnut"
+      ) {
         handlePieChartLogic(
           item,
           this.formLabelAlign,

+ 3 - 2
src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/configFn.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2024-11-12 09:27:50
- * @LastEditTime: 2024-12-27 15:11:28
+ * @LastEditTime: 2025-08-15 11:32:23
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/configFn.js
@@ -23,11 +23,12 @@ export const getFormattedLabels = (index, lableData) => {
 };
 
 export const getFormattedSeries = (data, chartType) => {
+  console.log(chartType, "chartType  Fn 文件");
   let series = [];
   data.forEach((item) => {
     series.push({
       name: item.label,
-      type: chartType,
+      type: chartType === "lineHighlight" ? "line" : chartType,
       progressiveThreshold: 3000, // 当数据量超过3000时启用渐进式渲染
       progressive: true, // 启用渐进式渲染
       renderMode: "webgl", // 启用 WebGL 渲染

+ 1 - 0
src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/index.js

@@ -1,4 +1,5 @@
 export default {
   chartTitle: () => import(/* webpackChunkName:"" */ "./chartTitle.vue"),
+  toolbox: () => import(/*webpackChunkName:"" */ "./toolbox.vue"),
   legend: () => import(/* webpackChunkName:"" */ "./legend.vue"),
 };

+ 1434 - 0
src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/toolbox.vue

@@ -0,0 +1,1434 @@
+<!--
+ * @Author: your name
+ * @Date: 2025-08-14 11:28:28
+ * @LastEditTime: 2025-08-14 13:50:35
+ * @LastEditors: bogon
+ * @Description: In User Settings Edit
+ * @FilePath: /performance-test/src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/toolbox.vue
+-->
+<template>
+  <div>
+    背景颜色
+
+    <el-form
+      label-position="top"
+      :model="formLabelAlign"
+      size="mini"
+      ref="form"
+    >
+      <template v-if="curEdit.type !== 'Cp' && curEdit.type !== 'pareto'">
+        <el-form-item label="背景颜色">
+          <div
+            slot="label"
+            style="
+              display: flex;
+              align-items: center;
+              justify-content: space-between;
+            "
+          >
+            <span>纬度标签</span>
+            <el-tooltip
+              content="添加纬度"
+              placement="bottom-start"
+              v-if="
+                curEdit.type === 'scatter' ||
+                // curEdit.type === 'radar' ||
+                curEdit.type === 'sankeyDiagram' ||
+                curEdit.type === 'Heatmap'
+              "
+            >
+              <i
+                @click="handleLatitude('init')"
+                class="el-icon-circle-plus-outline"
+                style="font-size: 20px"
+              ></i>
+            </el-tooltip>
+          </div>
+          <el-tooltip
+            content="按顺序添加纬度,不添加则不显示图表"
+            placement="bottom-start"
+            v-if="
+              curEdit.type === 'sankeyDiagram' || curEdit.type === 'Heatmap'
+            "
+          >
+            <div
+              v-if="curEdit.type === 'sankeyDiagram'"
+              style="color: red; font-size: 12px"
+            >
+              源纬度-目标纬度
+            </div>
+            <div
+              v-if="curEdit.type === 'Heatmap'"
+              style="color: red; font-size: 12px"
+            >
+              横轴纬度-纵轴纬度
+            </div>
+          </el-tooltip>
+          <template v-for="(item, ind) in formLabelAlign.Xdata">
+            <div class="attributeItemData">
+              <el-select
+                style="margin: 5px 0"
+                :key="ind + 'select'"
+                v-model="formLabelAlign.Xdata[ind].id"
+                placeholder="请先进行数据配置"
+                :disabled="disabled"
+                @change="handleXdata('init')"
+              >
+                <el-option
+                  v-for="item in selectData"
+                  :label="item.label"
+                  :value="item.id"
+                  :key="item.id + ind"
+                ></el-option>
+              </el-select>
+              <el-tooltip
+                v-if="
+                  curEdit.type === 'scatter' ||
+                  // curEdit.type === 'radar' ||
+                  curEdit.type === 'sankeyDiagram' ||
+                  curEdit.type === 'Heatmap'
+                "
+                :content="
+                  formLabelAlign.Xdata.length <= 1
+                    ? '该指标不可删除,最少存在一组指标'
+                    : '删除该指标'
+                "
+                placement="bottom-start"
+              >
+                <el-button
+                  type="text"
+                  :disabled="formLabelAlign.Xdata.length <= 1"
+                  @click="removeXdata(ind, 'init')"
+                >
+                  <i
+                    class="el-icon-delete"
+                    style="font-size: 16px; color: red; padding: 0 0 0 10px"
+                  ></i
+                ></el-button>
+              </el-tooltip>
+            </div>
+          </template>
+        </el-form-item>
+        <el-form-item label="背景颜色">
+          <div
+            slot="label"
+            style="
+              display: flex;
+              align-items: center;
+              justify-content: space-between;
+            "
+          >
+            <span>指标值</span>
+            <el-tooltip
+              content="添加指标值"
+              placement="bottom-start"
+              v-if="
+                // curEdit.type !== 'roseChart' &&
+                curEdit.type !== 'pie' &&
+                curEdit.type !== 'sankeyDiagram' &&
+                curEdit.type !== 'Heatmap'
+              "
+            >
+              <i
+                @click="handleMetrics('init')"
+                class="el-icon-circle-plus-outline"
+                style="font-size: 20px"
+              ></i>
+            </el-tooltip>
+          </div>
+          <el-tooltip
+            content="按顺序添加指标值,不添加则不显示图表"
+            placement="bottom-start"
+            v-if="curEdit.type === 'boxPlot'"
+          >
+            <div style="color: red; font-size: 12px">
+              最小值-Q1-中位数-Q3-最大值
+            </div>
+          </el-tooltip>
+
+          <template v-for="(item, ind) in formLabelAlign.Ydata">
+            <div class="attributeItemData">
+              <el-select
+                style="margin: 5px 0"
+                :key="ind + 'select' + 'zhibiao'"
+                v-model="formLabelAlign.Ydata[ind].id"
+                placeholder="请先进行数据配置"
+                :disabled="disabled"
+                @change="handleYdata(ind, 'init')"
+              >
+                <el-option
+                  v-for="item in selectData"
+                  :label="item.label"
+                  :value="item.id"
+                  :key="item.id + ind"
+                ></el-option>
+              </el-select>
+              <el-tooltip
+                v-if="
+                  // curEdit.type !== 'roseChart' &&
+                  curEdit.type !== 'pie' &&
+                  curEdit.type !== 'sankeyDiagram' &&
+                  curEdit.type !== 'Heatmap'
+                "
+                :content="
+                  formLabelAlign.Ydata.length <= 1
+                    ? '该指标不可删除,最少存在一组指标'
+                    : '删除该指标'
+                "
+                placement="bottom-start"
+              >
+                <el-button
+                  type="text"
+                  :disabled="formLabelAlign.Ydata.length <= 1"
+                  @click="removeYdata(ind, 'init')"
+                >
+                  <i
+                    class="el-icon-delete"
+                    style="font-size: 16px; color: red; padding: 0 0 0 10px"
+                  ></i
+                ></el-button>
+              </el-tooltip>
+            </div>
+          </template>
+        </el-form-item>
+      </template>
+      <el-form-item
+        v-if="curEdit.type === 'pareto' || curEdit.type === 'Cp'"
+        label="线纬度标签"
+      >
+        <div
+          slot="label"
+          style="
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+          "
+        >
+          <span>线纬度标签</span>
+          <el-tooltip
+            content="添加纬度"
+            placement="bottom-start"
+            v-if="curEdit.type === 'Cp'"
+          >
+            <i
+              @click="
+                formLabelAlign.LineXdata.push({ label: '', data: [], id: '' })
+              "
+              class="el-icon-circle-plus-outline"
+              style="font-size: 20px"
+            ></i>
+          </el-tooltip>
+        </div>
+        <template v-for="(item, ind) in formLabelAlign.LineXdata">
+          <div class="attributeItemData">
+            <el-select
+              style="margin: 5px 0"
+              :key="ind + 'select'"
+              v-model="formLabelAlign.LineXdata[ind].id"
+              placeholder="请先进行数据配置"
+              :disabled="disabled"
+              @change="handleXdata('line')"
+            >
+              <el-option
+                v-for="item in selectData"
+                :label="item.label"
+                :value="item.id"
+                :key="item.id + ind"
+              ></el-option>
+            </el-select>
+            <el-tooltip
+              v-if="curEdit.type === 'Cp'"
+              :content="
+                formLabelAlign.LineXdata.length <= 1
+                  ? '该维度不可删除,最少存在一组指标'
+                  : '删除该维度指标'
+              "
+              placement="bottom-start"
+            >
+              <el-button
+                type="text"
+                :disabled="formLabelAlign.LineXdata.length <= 1"
+                @click="removeXdata(ind, 'line')"
+              >
+                <i
+                  class="el-icon-delete"
+                  style="font-size: 16px; color: red; padding: 0 0 0 10px"
+                ></i
+              ></el-button>
+            </el-tooltip>
+          </div>
+        </template>
+      </el-form-item>
+      <el-form-item
+        v-if="curEdit.type === 'pareto' || curEdit.type === 'Cp'"
+        label="线指标值"
+      >
+        <div
+          slot="label"
+          style="
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+          "
+        >
+          <span>线指标值</span>
+          <el-tooltip
+            content="添加线指标值"
+            placement="bottom-start"
+            v-if="curEdit.type !== 'pareto'"
+          >
+            <i
+              @click="handleMetrics('line')"
+              class="el-icon-circle-plus-outline"
+              style="font-size: 20px"
+            ></i>
+          </el-tooltip>
+        </div>
+        <template v-for="(item, ind) in formLabelAlign.LineYdata">
+          <div class="attributeItemData">
+            <el-select
+              style="margin: 5px 0"
+              :key="ind + 'select' + 'zhibiao'"
+              v-model="formLabelAlign.LineYdata[ind].id"
+              placeholder="请先进行数据配置"
+              :disabled="disabled"
+              @change="handleYdata(ind, 'line')"
+            >
+              <el-option
+                v-for="item in selectData"
+                :label="item.label"
+                :value="item.id"
+                :key="item.id + ind"
+              ></el-option>
+            </el-select>
+            <el-tooltip
+              v-if="curEdit.type !== 'pareto'"
+              :content="
+                formLabelAlign.LineYdata.length <= 1
+                  ? '该指标不可删除,最少存在一组指标'
+                  : '删除该指标'
+              "
+              placement="bottom-start"
+            >
+              <el-button
+                type="text"
+                :disabled="formLabelAlign.LineYdata.length <= 1"
+                @click="removeYdata(ind, 'line')"
+              >
+                <i
+                  class="el-icon-delete"
+                  style="font-size: 16px; color: red; padding: 0 0 0 10px"
+                ></i
+              ></el-button>
+            </el-tooltip>
+          </div>
+        </template>
+      </el-form-item>
+      <el-form-item v-if="curEdit.type === 'pareto'" label="柱纬度标签">
+        <div
+          slot="label"
+          style="
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+          "
+        >
+          <span>柱纬度标签</span>
+          <el-tooltip
+            content="添加纬度"
+            placement="bottom-start"
+            v-if="curEdit.type !== 'pareto'"
+          >
+            <i
+              @click="
+                formLabelAlign.BarXdata.push({ label: '', data: [], id: '' })
+              "
+              class="el-icon-circle-plus-outline"
+              style="font-size: 20px"
+            ></i>
+          </el-tooltip>
+        </div>
+        <template v-for="(item, ind) in formLabelAlign.BarXdata">
+          <div class="attributeItemData">
+            <el-select
+              style="margin: 5px 0"
+              :key="ind + 'select'"
+              v-model="formLabelAlign.BarXdata[ind].id"
+              placeholder="请先进行数据配置"
+              :disabled="disabled"
+              @change="handleXdata('bar')"
+            >
+              <el-option
+                v-for="item in selectData"
+                :label="item.label"
+                :value="item.id"
+                :key="item.id + ind"
+              ></el-option>
+            </el-select>
+            <el-tooltip
+              v-if="curEdit.type !== 'pareto'"
+              :content="
+                formLabelAlign.BarXdata.length <= 1
+                  ? '该指标不可删除,最少存在一组指标'
+                  : '删除该指标'
+              "
+              placement="bottom-start"
+            >
+              <el-button
+                type="text"
+                :disabled="formLabelAlign.BarXdata.length <= 1"
+                @click="removeXdata(ind, 'bar')"
+              >
+                <i
+                  class="el-icon-delete"
+                  style="font-size: 16px; color: red; padding: 0 0 0 10px"
+                ></i
+              ></el-button>
+            </el-tooltip>
+          </div>
+        </template>
+      </el-form-item>
+      <el-form-item v-if="curEdit.type === 'pareto'" label="柱指标值">
+        <div
+          slot="label"
+          style="
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+          "
+        >
+          <span>柱指标值</span>
+          <el-tooltip
+            v-if="curEdit.type !== 'pareto'"
+            content="添加柱指标值"
+            placement="bottom-start"
+          >
+            <i
+              @click="handleMetrics('bar')"
+              class="el-icon-circle-plus-outline"
+              style="font-size: 20px"
+            ></i>
+          </el-tooltip>
+        </div>
+        <template v-for="(item, ind) in formLabelAlign.BarYdata">
+          <div class="attributeItemData">
+            <el-select
+              style="margin: 5px 0"
+              :key="ind + 'select' + 'zhibiao'"
+              v-model="formLabelAlign.BarYdata[ind].id"
+              placeholder="请先进行数据配置"
+              :disabled="disabled"
+              @change="handleYdata(ind, 'bar')"
+            >
+              <el-option
+                v-for="item in selectData"
+                :label="item.label"
+                :value="item.id"
+                :key="item.id + ind"
+              ></el-option>
+            </el-select>
+            <el-tooltip
+              v-if="curEdit.type !== 'pareto'"
+              :content="
+                formLabelAlign.BarYdata.length <= 1
+                  ? '该指标不可删除,最少存在一组指标'
+                  : '删除该指标'
+              "
+              placement="bottom-start"
+            >
+              <el-button
+                type="text"
+                :disabled="formLabelAlign.BarYdata.length <= 1"
+                @click="removeYdata(ind, 'bar')"
+              >
+                <i
+                  class="el-icon-delete"
+                  style="font-size: 16px; color: red; padding: 0 0 0 10px"
+                ></i
+              ></el-button>
+            </el-tooltip>
+          </div>
+        </template>
+      </el-form-item>
+      <el-form-item v-if="curEdit.type === 'Cp'" label="点纬度标签">
+        <div
+          slot="label"
+          style="
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+          "
+        >
+          <span>点纬度标签</span>
+          <el-tooltip content="添加纬度" placement="bottom-start">
+            <i
+              @click="
+                formLabelAlign.ScatterXdata.push({
+                  label: '',
+                  data: [],
+                  id: '',
+                })
+              "
+              class="el-icon-circle-plus-outline"
+              style="font-size: 20px"
+            ></i>
+          </el-tooltip>
+        </div>
+        <template v-for="(item, ind) in formLabelAlign.ScatterXdata">
+          <div class="attributeItemData">
+            <el-select
+              style="margin: 5px 0"
+              :key="ind + 'select'"
+              v-model="formLabelAlign.ScatterXdata[ind].id"
+              placeholder="请先进行数据配置"
+              :disabled="disabled"
+              @change="handleXdata('scatter')"
+            >
+              <el-option
+                v-for="item in selectData"
+                :label="item.label"
+                :value="item.id"
+                :key="item.id + ind"
+              ></el-option>
+            </el-select>
+            <el-tooltip
+              :content="
+                formLabelAlign.ScatterXdata.length <= 1
+                  ? '该指标不可删除,最少存在一组指标'
+                  : '删除该指标'
+              "
+              placement="bottom-start"
+            >
+              <el-button
+                type="text"
+                :disabled="formLabelAlign.ScatterXdata.length <= 1"
+                @click="removeXdata(ind, 'scatter')"
+              >
+                <i
+                  class="el-icon-delete"
+                  style="font-size: 16px; color: red; padding: 0 0 0 10px"
+                ></i
+              ></el-button>
+            </el-tooltip>
+          </div>
+        </template>
+      </el-form-item>
+      <el-form-item v-if="curEdit.type === 'Cp'" label="点指标值">
+        <div
+          slot="label"
+          style="
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+          "
+        >
+          <span>点指标值</span>
+          <el-tooltip content="添加点指标值" placement="bottom-start">
+            <i
+              @click="handleMetrics('scatter')"
+              class="el-icon-circle-plus-outline"
+              style="font-size: 20px"
+            ></i>
+          </el-tooltip>
+        </div>
+        <template v-for="(item, ind) in formLabelAlign.ScatterYdata">
+          <div class="attributeItemData">
+            <el-select
+              style="margin: 5px 0"
+              :key="ind + 'select' + 'zhibiao'"
+              v-model="formLabelAlign.ScatterYdata[ind].id"
+              placeholder="请先进行数据配置"
+              :disabled="disabled"
+              @change="handleYdata(ind, 'scatter')"
+            >
+              <el-option
+                v-for="item in selectData"
+                :label="item.label"
+                :value="item.id"
+                :key="item.id + ind"
+              ></el-option>
+            </el-select>
+            <el-tooltip
+              :content="
+                formLabelAlign.ScatterYdata.length <= 1
+                  ? '该指标不可删除,最少存在一组指标'
+                  : '删除该指标'
+              "
+              placement="bottom-start"
+            >
+              <el-button
+                type="text"
+                :disabled="formLabelAlign.ScatterYdata.length <= 1"
+                @click="removeYdata(ind, 'scatter')"
+              >
+                <i
+                  class="el-icon-delete"
+                  style="font-size: 16px; color: red; padding: 0 0 0 10px"
+                ></i
+              ></el-button>
+            </el-tooltip>
+          </div>
+        </template>
+      </el-form-item>
+      <el-form-item label="标题名称">
+        <el-input v-model="formLabelAlign.text"></el-input>
+      </el-form-item>
+      <el-form-item
+        label="X轴名称"
+        v-if="
+          curEdit.type !== 'pie' &&
+          curEdit.type !== 'radar' &&
+          curEdit.type !== 'roseChart' &&
+          curEdit.type !== 'sankeyDiagram'
+        "
+      >
+        <el-input v-model="formLabelAlign.Xlable"></el-input>
+      </el-form-item>
+      <el-form-item
+        label="Y轴名称"
+        v-if="
+          curEdit.type !== 'pie' &&
+          curEdit.type !== 'radar' &&
+          curEdit.type !== 'roseChart' &&
+          curEdit.type !== 'pareto' &&
+          curEdit.type !== 'sankeyDiagram'
+        "
+      >
+        <el-input v-model="formLabelAlign.Ylable"></el-input>
+      </el-form-item>
+      <el-form-item label="柱Y轴名称" v-if="curEdit.type === 'pareto'">
+        <el-input v-model="formLabelAlign.YRightLable"></el-input>
+      </el-form-item>
+      <el-form-item label="线Y轴名称" v-if="curEdit.type === 'pareto'">
+        <el-input v-model="formLabelAlign.YLeftLable"></el-input>
+      </el-form-item>
+    </el-form>
+    <div style="margin: 20px 0">
+      <el-divider style="height: 2px"></el-divider>
+    </div>
+    <el-collapse
+      v-if="filteredYData.length > 0 && filteredYData[0].data.length > 0"
+    >
+      <el-collapse-item
+        v-for="(itemFilter, filterInd) in filteredYData"
+        :title="itemFilter.label || `数据筛选`"
+        :name="itemFilter.id"
+        :key="itemFilter.id + filterInd"
+      >
+        <el-form
+          label-position="top"
+          :model="formFilterAlign[filterInd]"
+          size="mini"
+          :ref="`form${filterInd}`"
+        >
+          <el-form-item label="数据筛选">
+            <el-select
+              v-model="formFilterAlign[filterInd].filters"
+              placeholder="请选择数据"
+              multiple
+              clearable
+              collapse-tags
+              class="filterMutiple"
+            >
+              <el-option
+                v-for="(item, index) in itemFilter?.data"
+                :label="
+                  item[itemFilter?.label] ? `${item[itemFilter?.label]} ` : `0`
+                "
+                :value="item[itemFilter?.label]"
+                :key="item[itemFilter?.label] + '' + index"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="条件过滤">
+            <el-select placeholder="请选择过滤条件" v-model="value">
+              <el-option label="全部" value="all"></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="显示值满足以下条件">
+            <el-select
+              clearable
+              v-model="formFilterAlign[filterInd].filterType1"
+              placeholder="请选择"
+            >
+              <el-option
+                v-for="item in options"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+            <el-input
+              clearable
+              v-model="formFilterAlign[filterInd].number1"
+              type="number"
+            ></el-input>
+            <el-radio v-model="formFilterAlign[filterInd].radio" label="1"
+              >或</el-radio
+            >
+            <el-radio v-model="formFilterAlign[filterInd].radio" label="2"
+              >且</el-radio
+            >
+            <el-select
+              clearable
+              v-model="formFilterAlign[filterInd].filterType2"
+              placeholder="请选择"
+            >
+              <el-option
+                v-for="item in options"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+            <el-input
+              clearable
+              v-model="formFilterAlign[filterInd].number2"
+              type="number"
+            ></el-input>
+          </el-form-item>
+        </el-form>
+      </el-collapse-item>
+    </el-collapse>
+  </div>
+</template>
+<script>
+import { mapState, mapMutations } from "vuex";
+import {
+  handleBarChartLogic,
+  handleScatterChartLogic,
+  handleRadarChartLogic,
+  handleCpChartLogic,
+  handleRoseChartChartLogic,
+  handlePieChartLogic,
+  handlestackedBarChartLogic,
+  handleParetoChartLogic,
+  handleBoxPlotChartLogic,
+  handleSankeyDiagramPlotChartLogic,
+  handleHeatmapPlotChartLogic,
+} from "./chartLogic/index";
+import Vue from "vue";
+import { constructNow } from "date-fns";
+export default {
+  name: "toolbox",
+  props: {
+    curEdit: {
+      type: Object,
+      default: () => ({
+        option: {
+          title: { text: "" },
+          xAxis: { name: "" },
+          yAxis: { name: "" },
+        },
+      }),
+    },
+  },
+  data() {
+    return {
+      value: "all",
+      checkList: [],
+      formFilterAlign: [
+        {
+          filters: [],
+          filterType1: "",
+          number1: null,
+          filterType2: "",
+          number2: null,
+          radio: null,
+        },
+      ],
+      options: [
+        {
+          value: "<",
+          label: "小于",
+        },
+        {
+          value: ">",
+          label: "大于",
+        },
+        {
+          value: "=",
+          label: "等于",
+        },
+      ],
+      formLabelAlign: {
+        ScatterXdata: [
+          {
+            label: "",
+            data: [],
+            id: "",
+          },
+        ],
+        ScatterYdata: [
+          {
+            label: "",
+            data: [],
+            id: "",
+          },
+        ],
+        LineXdata: [
+          {
+            label: "",
+            data: [],
+            id: "",
+          },
+        ],
+        LineYdata: [
+          {
+            label: "",
+            data: [],
+            id: "",
+          },
+        ],
+        BarXdata: [
+          {
+            label: "",
+            data: [],
+            id: "",
+          },
+        ],
+        BarYdata: [
+          {
+            label: "",
+            data: [],
+            id: "",
+          },
+        ],
+        Xdata: [
+          {
+            label: "",
+            data: [],
+            id: "",
+          },
+        ],
+        Ydata: [
+          {
+            label: "",
+            data: [],
+            id: "",
+          },
+        ],
+        text: "",
+        Xlable: "",
+        Ylable: "",
+        YRightLable: "",
+        YLeftLable: "",
+      },
+      disabled: true,
+      selectData: [], //可选择的数据
+    };
+  },
+  computed: {
+    ...mapState("dragChart", {
+      currentChartList: "currentChartList",
+      dataBaseCheckList: "dataBaseCheckList",
+    }),
+    filteredYData() {
+      const { type } = this.curEdit;
+      const { BarYdata, LineYdata, ScatterYdata, Ydata } = this.formLabelAlign;
+      if (type === "pareto") {
+        return [...LineYdata, ...BarYdata];
+      } else if (type === "Cp") {
+        return [...LineYdata, ...ScatterYdata];
+      } else if (
+        [
+          "bar",
+          "line",
+          "radar",
+          "scatter",
+          "pie",
+          "roseChart",
+          "stackedBar",
+          "boxPlot",
+          "sankeyDiagram",
+          "Heatmap",
+        ].includes(type)
+      ) {
+        return Ydata;
+      }
+      return []; // 默认返回空数组
+    },
+  },
+  watch: {
+    curEdit() {
+      this.changeData();
+    },
+    formLabelAlign: {
+      handler(nval) {
+        this.changeChart("filter");
+      },
+      deep: true,
+    },
+    formFilterAlign: {
+      handler(nval) {
+        this.changeChart("filter");
+      },
+      deep: true,
+    },
+    dataBaseCheckList: {
+      handler(newVal) {
+        this.disabled = newVal.length === 0 ? true : false;
+        const objData = newVal.map((item) => item.fileObj);
+
+        const flattenedArray = objData.reduce((acc, subArray) => {
+          return acc.concat(subArray);
+        }, []);
+        this.selectData = flattenedArray;
+      },
+      immediate: true, // 组件加载时立即检查
+      deep: true, // 深度监听
+    },
+  },
+  methods: {
+    ...mapMutations("dragChart", [
+      "updateChart",
+      "setCurEdit",
+      "setFormFilterAlignData",
+    ]),
+    handleLatitude(type) {
+      switch (type) {
+        case "init":
+          if (
+            (this.curEdit.type === "sankeyDiagram" ||
+              this.curEdit.type === "Heatmap") &&
+            this.formLabelAlign.Xdata.length >= 2
+          ) {
+            this.$message.warning(
+              "纬度请根据上方红色字提示的进行添加且只能添加两个纬度标签"
+            );
+            return;
+          }
+          this.formLabelAlign.Xdata.push({ label: "", data: [], id: "" });
+          break;
+      }
+    },
+    handleMetrics(type) {
+      switch (type) {
+        case "init":
+          if (
+            this.curEdit.type === "boxPlot" &&
+            this.formLabelAlign.Ydata.length >= 5
+          ) {
+            this.$message.warning(
+              "箱线图指标只允许添加最小值, Q1, 中位数, Q3, 最大值几位"
+            );
+            return;
+          }
+
+          this.formLabelAlign.Ydata.push({ label: "", data: [], id: "" });
+          this.formFilterAlign.push({
+            filters: [],
+            filterType1: "",
+            number1: null,
+            filterType2: "",
+            number2: null,
+            radio: null,
+          });
+          break;
+        case "bar":
+          this.formLabelAlign.BarYdata.push({ label: "", data: [], id: "" });
+          this.formFilterAlign.push({
+            filters: [],
+            filterType1: "",
+            number1: null,
+            filterType2: "",
+            number2: null,
+            radio: null,
+          });
+          break;
+        case "line":
+          this.formLabelAlign.LineYdata.push({ label: "", data: [], id: "" });
+          this.formFilterAlign.push({
+            filters: [],
+            filterType1: "",
+            number1: null,
+            filterType2: "",
+            number2: null,
+            radio: null,
+          });
+          break;
+        case "scatter":
+          this.formLabelAlign.ScatterYdata.push({
+            label: "",
+            data: [],
+            id: "",
+          });
+          this.formFilterAlign.push({
+            filters: [],
+            filterType1: "",
+            number1: null,
+            filterType2: "",
+            number2: null,
+            radio: null,
+          });
+          break;
+      }
+    },
+    //纬度轴 处理整合数据
+    handleXdata(type) {
+      switch (type) {
+        case "init":
+          this.formLabelAlign.Xdata = this.updateAxisData(
+            this.formLabelAlign.Xdata
+          );
+          break;
+        case "bar":
+          this.formLabelAlign.BarXdata = this.updateAxisData(
+            this.formLabelAlign.BarXdata
+          );
+          break;
+        case "line":
+          this.formLabelAlign.LineXdata = this.updateAxisData(
+            this.formLabelAlign.LineXdata
+          );
+          break;
+        case "scatter":
+          this.formLabelAlign.ScatterXdata = this.updateAxisData(
+            this.formLabelAlign.ScatterXdata
+          );
+          break;
+      }
+    },
+    //指标值 处理整合数据
+    handleYdata(ind, type) {
+      switch (type) {
+        case "init":
+          this.formLabelAlign.Ydata = this.updateAxisData(
+            this.formLabelAlign.Ydata
+          );
+          break;
+        case "bar":
+          this.formLabelAlign.BarYdata = this.updateAxisData(
+            this.formLabelAlign.BarYdata
+          );
+          break;
+        case "line":
+          this.formLabelAlign.LineYdata = this.updateAxisData(
+            this.formLabelAlign.LineYdata
+          );
+          break;
+        case "scatter":
+          this.formLabelAlign.ScatterYdata = this.updateAxisData(
+            this.formLabelAlign.ScatterYdata
+          );
+          break;
+      }
+
+      this.formFilterAlign.forEach((item, index) => {
+        if (ind === index) {
+          {
+            item.filters = [];
+            item.filterType1 = "";
+            item.number1 = null;
+            item.filterType2 = "";
+            item.number2 = null;
+            item.radio = null;
+          }
+        }
+      });
+    },
+    updateAxisData(axisData) {
+      axisData.forEach((item, index) => {
+        let selected = this.selectData.find(
+          (val) => (val && val.id) === (item && item.id)
+        );
+
+        if (selected) {
+          this.dataBaseCheckList.map((baseItem) => {
+            if (selected.parentId === baseItem.parentId) {
+              selected.fileData = baseItem.fileData.map((baseObj) => ({
+                [selected.label]: baseObj[selected.label],
+              }));
+            }
+          });
+          Vue.set(axisData, index, {
+            ...item,
+            label: selected.label || "",
+            data: selected.fileData || [],
+          });
+        }
+      });
+      return axisData;
+    },
+    removeYdata(index, type) {
+      const { BarYdata, LineYdata, ScatterYdata, Ydata } = this.formLabelAlign;
+      switch (type) {
+        case "init":
+          this.formLabelAlign.Ydata.splice(index, 1); // 删除当前项
+          break;
+        case "bar":
+          this.formLabelAlign.BarYdata.splice(index, 1); // 删除当前项
+          break;
+        case "line":
+          this.formLabelAlign.LineYdata.splice(index, 1); // 删除当前项
+          if (this.curEdit.type === "Cp") {
+            this.formFilterAlign.splice(index, 1);
+          }
+          //这里需要处理this.formFilterAlign.filter(item)
+          break;
+        case "scatter":
+          if (this.curEdit.type === "Cp") {
+            this.formFilterAlign.splice(
+              this.formLabelAlign.LineYdata.length + index,
+              1
+            );
+          }
+          this.formLabelAlign.ScatterYdata.splice(index, 1); // 删除当前项
+          break;
+      }
+    },
+    removeXdata(index, type) {
+      switch (type) {
+        case "init":
+          this.formLabelAlign.Xdata.splice(index, 1); // 删除当前项
+          break;
+        case "bar":
+          this.formLabelAlign.BarXdata.splice(index, 1); // 删除当前项
+          break;
+        case "line":
+          this.formLabelAlign.LineXdata.splice(index, 1); // 删除当前项
+          break;
+        case "scatter":
+          this.formLabelAlign.ScatterXdata.splice(index, 1); // 删除当前项
+          break;
+      }
+    },
+    changeData() {
+      if (this.$refs.form) {
+        this.$refs.form.resetFields();
+      }
+      // 图表内容回显图表配置赋值
+      if (this.curEdit && this.curEdit.option) {
+        // 使用 this.$set 替代直接赋值
+        this.$set(this, "formLabelAlign", {
+          text: this.curEdit.option.title?.text || "",
+          Xlable: this.curEdit.option.xAxis?.name || "",
+          Ylable: this.curEdit.option.yAxis?.name || "",
+          YRightLable:
+            this.curEdit.type === "pareto"
+              ? this.curEdit.option.yAxis[1].name
+              : "",
+          YLeftLable:
+            this.curEdit.type === "pareto"
+              ? this.curEdit.option.yAxis[0].name
+              : "",
+          Xdata:
+            this.curEdit.Xdata.length > 0
+              ? this.curEdit.Xdata
+              : [
+                  {
+                    label: "",
+                    data: [],
+                    id: "",
+                  },
+                ],
+          Ydata:
+            this.curEdit.Ydata.length > 0
+              ? this.curEdit.Ydata
+              : [
+                  {
+                    label: "",
+                    data: [],
+                    id: "",
+                  },
+                ],
+          BarXdata:
+            this.curEdit.BarXdata.length > 0
+              ? this.curEdit.BarXdata
+              : [
+                  {
+                    label: "",
+                    data: [],
+                    id: "",
+                  },
+                ],
+          BarYdata:
+            this.curEdit.BarYdata.length > 0
+              ? this.curEdit.BarYdata
+              : [
+                  {
+                    label: "",
+                    data: [],
+                    id: "",
+                  },
+                ],
+          LineXdata:
+            this.curEdit.LineXdata.length > 0
+              ? this.curEdit.LineXdata
+              : [
+                  {
+                    label: "",
+                    data: [],
+                    id: "",
+                  },
+                ],
+          LineYdata:
+            this.curEdit.LineYdata.length > 0
+              ? this.curEdit.LineYdata
+              : [
+                  {
+                    label: "",
+                    data: [],
+                    id: "",
+                  },
+                ],
+          ScatterXdata:
+            this.curEdit.ScatterXdata.length > 0
+              ? this.curEdit.ScatterXdata
+              : [
+                  {
+                    label: "",
+                    data: [],
+                    id: "",
+                  },
+                ],
+          ScatterYdata:
+            this.curEdit.ScatterYdata.length > 0
+              ? this.curEdit.ScatterYdata
+              : [
+                  {
+                    label: "",
+                    data: [],
+                    id: "",
+                  },
+                ],
+        });
+        // 查找是否存在数据
+        const index = this.currentChartList.findIndex(
+          (item) => item.id === this.curEdit.id
+        );
+        if (index !== -1) {
+          this.$set(
+            this,
+            "formFilterAlign",
+            this.curEdit.formFilterAlignData.length > 0
+              ? this.curEdit.formFilterAlignData
+              : this.curEdit.type === "Cp" || this.curEdit.type === "pareto"
+              ? [
+                  {
+                    filters: [],
+                    filterType1: "",
+                    number1: null,
+                    filterType2: "",
+                    number2: null,
+                    radio: null,
+                  },
+                  {
+                    filters: [],
+                    filterType1: "",
+                    number1: null,
+                    filterType2: "",
+                    number2: null,
+                    radio: null,
+                  },
+                ]
+              : [
+                  {
+                    filters: [],
+                    filterType1: "",
+                    number1: null,
+                    filterType2: "",
+                    number2: null,
+                    radio: null,
+                  },
+                ]
+          );
+        } else {
+          this.$set(
+            this,
+            "formFilterAlign",
+            this.curEdit.type === "Cp" || this.curEdit.type === "pareto"
+              ? [
+                  {
+                    filters: [],
+                    filterType1: "",
+                    number1: null,
+                    filterType2: "",
+                    number2: null,
+                    radio: null,
+                  },
+                  {
+                    filters: [],
+                    filterType1: "",
+                    number1: null,
+                    filterType2: "",
+                    number2: null,
+                    radio: null,
+                  },
+                ]
+              : [
+                  {
+                    filters: [],
+                    filterType1: "",
+                    number1: null,
+                    filterType2: "",
+                    number2: null,
+                    radio: null,
+                  },
+                ]
+          );
+        }
+      } else {
+        this.$message.warning("请选择一个图表进行编辑");
+      }
+    },
+    //全部数据渲染
+    changeChart(isFilter) {
+      if (!this.curEdit?.option) return; // 确保 curEdit 和 option 存在
+      const item = JSON.parse(JSON.stringify(this.curEdit));
+      if (this.curEdit.type === "scatter" || this.curEdit.type === "radar") {
+        //判断散点选择的是否为number 或可转为number
+        const isAllNumbers = (data) =>
+          data.every((val) =>
+            val.data.every((vals) => {
+              return !isNaN(
+                Number(vals[val.label] == undefined ? 0 : vals[val.label])
+              );
+            })
+          );
+        const isAllNumbersXdata = isAllNumbers(this.formLabelAlign.Xdata);
+        const isAllNumbersYdata = isAllNumbers(this.formLabelAlign.Ydata);
+        if (
+          this.curEdit.type === "scatter" &&
+          (!isAllNumbersXdata || !isAllNumbersYdata)
+        ) {
+          this.$message.warning("请选择数值项进行散点图绘制");
+          return;
+        }
+        if (this.curEdit.type === "radar" && !isAllNumbersYdata) {
+          this.$message.warning("指标值请选择数值项进行散点图绘制");
+          return;
+        }
+      }
+      // 确保标题和坐标轴对象存在
+      item.option.title = item.option.title || {};
+      Object.assign(item.option.title, { text: this.formLabelAlign.text });
+      if (this.curEdit.type === "bar" || this.curEdit.type === "line") {
+        handleBarChartLogic(
+          item,
+          this.formLabelAlign,
+          this.formFilterAlign,
+          isFilter,
+          this.curEdit.type
+        );
+      } else if (this.curEdit.type === "scatter") {
+        handleScatterChartLogic(
+          item,
+          this.formLabelAlign,
+          this.formFilterAlign,
+          isFilter,
+          this.curEdit.type
+        );
+      } else if (this.curEdit.type === "radar") {
+        handleRadarChartLogic(
+          item,
+          this.formLabelAlign,
+          this.formFilterAlign,
+          isFilter,
+          this.curEdit.type
+        );
+      } else if (this.curEdit.type === "Cp") {
+        handleCpChartLogic(
+          item,
+          this.formLabelAlign,
+          this.formFilterAlign,
+          isFilter,
+          this.curEdit.type
+        );
+      } else if (this.curEdit.type === "roseChart") {
+        handleRoseChartChartLogic(
+          item,
+          this.formLabelAlign,
+          this.formFilterAlign,
+          isFilter,
+          this.curEdit.type
+        );
+      } else if (this.curEdit.type === "pie") {
+        handlePieChartLogic(
+          item,
+          this.formLabelAlign,
+          this.formFilterAlign,
+          isFilter,
+          this.curEdit.type
+        );
+      } else if (this.curEdit.type === "stackedBar") {
+        handlestackedBarChartLogic(
+          item,
+          this.formLabelAlign,
+          this.formFilterAlign,
+          isFilter,
+          this.curEdit.type
+        );
+      } else if (this.curEdit.type === "pareto") {
+        handleParetoChartLogic(
+          item,
+          this.formLabelAlign,
+          this.formFilterAlign,
+          isFilter,
+          this.curEdit.type
+        );
+      } else if (this.curEdit.type === "boxPlot") {
+        handleBoxPlotChartLogic(
+          item,
+          this.formLabelAlign,
+          this.formFilterAlign,
+          isFilter,
+          this.curEdit.type
+        );
+      } else if (this.curEdit.type === "sankeyDiagram") {
+        handleSankeyDiagramPlotChartLogic(
+          item,
+          this.formLabelAlign,
+          this.formFilterAlign,
+          isFilter,
+          this.curEdit.type
+        );
+      } else if (this.curEdit.type === "Heatmap") {
+        handleHeatmapPlotChartLogic(
+          item,
+          this.formLabelAlign,
+          this.formFilterAlign,
+          isFilter,
+          this.curEdit.type
+        );
+      }
+      //设置仓库
+      this.setFormFilterAlignData({
+        id: this.curEdit.id,
+        data: JSON.parse(JSON.stringify(this.formFilterAlign)),
+      });
+      this.updateChart({
+        ...item,
+        LineYdata: this.formLabelAlign.LineYdata,
+        ScatterYdata: this.formLabelAlign.ScatterYdata,
+        BarYdata: this.formLabelAlign.BarYdata,
+        Ydata: this.formLabelAlign.Ydata, //还是给所有的数据保存起来了,并不是过滤后的数据
+        formFilterAlignData: this.formFilterAlign,
+      }); // 更新图表
+    },
+  },
+};
+</script>
+<style scoped lang="scss">
+::v-deep .el-form-item {
+  width: 100% !important;
+  margin-bottom: 5px;
+  .el-form-item__label {
+    width: 100% !important;
+  }
+  .attributeItemData {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+  }
+}
+.el-divider--horizontal {
+  height: 2px;
+}
+::v-deep .filterMutiple .el-select__tags-text {
+  max-width: 40px !important;
+}
+</style>

+ 46 - 24
src/views/performance/components/custonAsCom/dragChart/components/chartsAttributes.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2024-11-01 10:14:11
- * @LastEditTime: 2024-11-27 15:39:28
+ * @LastEditTime: 2025-08-15 09:48:30
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/custonAsCom/dragChart/components/chartsContent.vue
@@ -38,7 +38,7 @@
                 :content="item.label"
                 placement="top-start"
               >
-                <div>
+                <div class="toolbox">
                   <svg-icon
                     :icon-class="item.icon"
                     style="width: 30px; height: 30px"
@@ -81,6 +81,14 @@ export default {
       currentView: "",
       svgIcon: [
         {
+          type: "lineHighlight",
+          name: "曲线图",
+        },
+        {
+          type: "line",
+          name: "折线图",
+        },
+        {
           type: "Cp",
           name: "散点折线图",
         },
@@ -88,15 +96,16 @@ export default {
           type: "scatter",
           name: "散点图",
         },
-        {
-          type: "line",
-          name: "折线图",
-        },
+
         {
           type: "pie",
           name: "饼图",
         },
         {
+          type: "doughnut",
+          name: "环形图",
+        },
+        {
           type: "roseChart",
           name: "玫瑰图",
         },
@@ -104,20 +113,6 @@ export default {
           type: "radar",
           name: "雷达图",
         },
-
-        {
-          type: "sankeyDiagram",
-          name: "流图",
-        },
-        {
-          type: "boxPlot",
-          name: "箱线图",
-        },
-
-        {
-          type: "Heatmap",
-          name: "热力图",
-        },
         {
           type: "bar",
           name: "直方图",
@@ -131,6 +126,27 @@ export default {
           name: "帕累托图",
         },
         // {
+        //   type: "horizontalStackedBar1",
+        //   name: "横向堆叠柱状图",
+        // },
+        {
+          type: "boxPlot",
+          name: "箱线图",
+        },
+        // {
+        //   type: "funnelPlot2",
+        //   name: "漏斗图",
+        // },
+        {
+          type: "sankeyDiagram",
+          name: "流图",
+        },
+        {
+          type: "Heatmap",
+          name: "热力图",
+        },
+
+        // {
         //   type: "hexbin",
         //   name: "蜂巢图",
         // },
@@ -146,7 +162,7 @@ export default {
     };
   },
   created() {
-    this.handleChangeApi("configText");
+    this.handleChangeApi();
   },
   computed: {
     ...mapState("dragChart", {
@@ -162,9 +178,10 @@ export default {
       item.name && this.$message.success(`「${item.name}」添加成功`);
       this.$emit("addChart", item.type);
     },
-    handleChangeApi(value) {
-      const item = this.configApi.find((item) => item.name === value);
+    handleChangeApi() {
+      const item = this.configApi.find((item) => item.name === this.activeName);
       this.description = item && item.desc;
+      console.log("handleChangeApi 参数:", this.activeName, item);
       try {
         this.registerComponent(item.value).then((component) => {
           this.currentView = component;
@@ -193,7 +210,8 @@ export default {
 <style scoped lang="scss">
 .chartContiner {
   background-color: pink;
-  width: 210px;
+  // width: 270px;
+  width: 200px;
   height: 100%;
 
   ::v-deep .card {
@@ -201,6 +219,10 @@ export default {
     border-radius: 0 !important;
     overflow: scroll;
   }
+  .toolbox {
+    width: 50px;
+    text-align: center;
+  }
 }
 ::v-deep .el-divider--horizontal {
   margin: 5px 0;

+ 69 - 1
src/views/performance/components/custonAsCom/dragChart/index.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2024-10-31 16:01:27
- * @LastEditTime: 2024-11-12 15:05:48
+ * @LastEditTime: 2025-08-15 09:45:15
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/custonAsCom/dragChart/index.vue
@@ -12,6 +12,51 @@
       :addChartType="addChartType"
       :config="config"
     ></ChartsContent>
+    <!-- <div class="drawer drawerText">
+      <svg-icon
+        @click="() => (drawer = !drawer)"
+        v-show="!drawer"
+        icon-class="text"
+        style="width: 30px; height: 30px"
+      />
+      <el-drawer
+        :withHeader="false"
+        :visible.sync="drawer"
+        :direction="direction"
+        size="270"
+        :append-to-body="false"
+        :modal="false"
+        :wrapper-closable="false"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        :show-close="false"
+      >
+        <i class="el-icon-s-unfold" @click="() => (drawer = !drawer)"></i>
+        <ChartsAttributes
+          @addChart="addChart"
+          :addChartType="addChartType"
+        ></ChartsAttributes>
+      </el-drawer>
+    </div> -->
+    <!-- <div class="drawer drawerStyle">
+      <svg-icon
+        @click="() => (drawer1 = !drawer1)"
+        v-show="!drawer1"
+        icon-class="styleChart1"
+        style="width: 30px; height: 30px"
+      />
+      <el-drawer
+        :withHeader="false"
+        :visible.sync="drawer1"
+        :direction="direction"
+        size="300"
+        :modal="false"
+        :append-to-body="false"
+      >
+        <i class="el-icon-s-unfold" @click="() => (drawer1 = !drawer1)"></i>
+        <ChartsData :addChartType="addChartType"></ChartsData>
+      </el-drawer>
+    </div> -->
     <ChartsAttributes
       @addChart="addChart"
       :addChartType="addChartType"
@@ -35,6 +80,9 @@ export default {
       options: "",
       config: "",
       configType: "",
+      drawer: false,
+      drawer1: false,
+      direction: "rtl",
     };
   },
   mounted() {},
@@ -63,6 +111,26 @@ export default {
   width: 100%;
   display: flex;
   height: 100%;
+  position: relative;
   //   justify-content: space-between;
+  // .drawer {
+  //   background-color: #fff;
+  //   z-index: 99999;
+  //   height: 100%;
+  //   border: 1px solid #ddd;
+  //   // writing-mode: vertical-rl; /* 文字竖排 */
+  //   cursor: pointer;
+  // }
+  // .drawerText {
+  //   position: absolute;
+  //   top: 0;
+  //   // right: 32px;
+  //   right: 0px;
+  // }
+  // .drawerStyle {
+  //   position: absolute;
+  //   top: 0;
+  //   right: 0px;
+  // }
 }
 </style>

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä