rui.jiang 4 месяцев назад
Родитель
Сommit
aae7a2bb6d

+ 25 - 25
.env.dev

@@ -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= "http://106.120.102.238:18000/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='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='http://106.120.102.238:58880'

+ 11 - 15
src/assets/js/constants/echarts-config/roseChart.js

@@ -1,18 +1,5 @@
-/*
- * @Author: your name
- * @Date: 2024-11-19 16:18:07
- * @LastEditTime: 2024-11-27 15:05:30
- * @LastEditors: bogon
- * @Description: In User Settings Edit
- * @FilePath: /performance-test/src/assets/js/constants/echarts-config/roseChart.js
- */
-// 风玫瑰图(Wind Rose Chart)
-// 用途:显示不同方向的风速或风力分布。
-// 适用场景:风场选址、风资源评估。
-// 实现建议:
-// ECharts 的极坐标 + 柱状图。
-// 使用 polar 和 radiusAxis 配置。
 import { colorPalette } from "../color";
+
 export const option = {
   color: colorPalette,
   title: {
@@ -41,9 +28,18 @@ export const option = {
       type: "bar",
       radius: [50, 250],
       center: ["50%", "50%"],
-      data: [15, 25, 30, 20, 10, 5, 8, 12], // 风速数据
       coordinateSystem: "polar",
       name: "风速",
+      data: [
+        { value: 15, itemStyle: { color: "#E3F4BF" } },
+        { value: 25, itemStyle: { color: "#BEF7C8" } },
+        { value: 30, itemStyle: { color: "#86E6C8" } },
+        { value: 20, itemStyle: { color: "#36CFC9" } },
+        { value: 10, itemStyle: { color: "#209BDD" } },
+        { value: 5, itemStyle: { color: "#1581E6" } },
+        { value: 8, itemStyle: { color: "#0860BF" } },
+        { value: 12, itemStyle: { color: "#50DCB6" } }, // 可自定义最后一个颜色
+      ],
     },
   ],
   tooltip: {

+ 18 - 18
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-08-15 13:43:37
+ * @LastEditTime: 2025-01-02 16:22:21
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/chartLogic/modules/pie.js
@@ -67,31 +67,35 @@ export function handlePieChartLogic(
     return {
       name: yItem.label,
       type: type === "doughnut" ? "pie" : type,
-      // radius: "60%",
       radius: type === "doughnut" ? ["40%", "70%"] : "60%",
       itemStyle: {
-        borderRadius: 10,
+        borderRadius: type === "doughnut" ? 10 : 0,
       },
       label: {
-        show: false,
-        position: "center",
+        show: true, // 显示标签
+        position: "outside", // 显示在扇区外部
+        formatter: "{d}%", // 显示百分比
+        color: "#000", // 黑色字体
       },
-      // avoidLabelOverlap: false,
-      // padAngle: 5,
-      progressiveThreshold: 3000, // 当数据量超过3000时启用渐进式渲染
-      progressive: true, // 启用渐进式渲染
-      renderMode: "webgl", // 启用 WebGL 渲染
+      labelLine: {
+        show: true, // 显示引导线
+        length: 15, // 引导线第一段长度
+        length2: 10, // 引导线第二段长度
+        smooth: true, // 平滑曲线
+      },
+      progressiveThreshold: 3000,
+      padAngle:  type === "doughnut" ? 5 : 0,
+      progressive: true,
+      renderMode: "webgl",
       data:
         yItem.data &&
         yItem.data.map((val, valIndex) => {
-          // 获取对应的 Xdata 数据
           const xVal =
             item.Xdata[yIndex]?.data?.[valIndex]?.[item.Xdata[yIndex].label] ||
             "";
-
           return {
-            value: (val && val[yItem.label]) || null, // 从 Ydata 获取 value
-            name: xVal, // 从 Xdata 获取 name
+            value: (val && val[yItem.label]) || null,
+            name: xVal,
           };
         }),
     };
@@ -99,9 +103,5 @@ export function handlePieChartLogic(
 
   if (item.Ydata[0]?.data?.length > 0) {
     item.option.series = res;
-    // item.option.legend = {
-    //   top: "5%",
-    //   left: "center",
-    // };
   }
 }

+ 13 - 10
src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/chartLogic/modules/radar.js

@@ -108,18 +108,21 @@ export function handleRadarChartLogic(
     item.option.series = []; // 无数据时清空系列
   }
   item.option.tooltip = {
-    trigger: "item", // 鼠标悬停时触发 tooltip
-    axisPointer: {
-      type: "shadow", // 使用阴影指示
-    },
+    trigger: "item",
     formatter: function (params) {
-      // 获取当前鼠标悬停项对应的维度名称和数据值
-      const indicatorName = params.seriesName; // 获取 series 的名称
-      const indicatorIndex = params.dataIndex; // 获取当前维度的索引
-      const value = params.value[indicatorIndex]; // 获取当前维度的值
+      if (!params.value) return "";
+
+      // 获取雷达图所有维度名称
+      const indicatorNames = item.option.radar.indicator.map((ind) => ind.name);
+      const values = params.value;
+
+      // 构造 tooltip 文本,只显示当前 series 的所有维度值
+      let tooltipText = `<strong>${params.seriesName}</strong><br/>`;
+      indicatorNames.forEach((name, idx) => {
+        tooltipText += `${name}: ${values[idx]}<br/>`;
+      });
 
-      // 返回自定义 tooltip 内容
-      return `${params.name}: ${value}`; // 只显示当前维度的值
+      return tooltipText;
     },
   };
 }

+ 32 - 58
src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/chartLogic/modules/roseChart.js

@@ -1,13 +1,6 @@
-/*
- * @Author: your name
- * @Date: 2024-11-26 16:33:38
- * @LastEditTime: 2024-12-27 15:12:41
- * @LastEditors: bogon
- * @Description: In User Settings Edit
- * @FilePath: /performance-test/src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/chartLogic/modules/roseChart.js
- */
 //玫瑰图
 import { filterData } from "../dargChartFIlter";
+
 export function handleRoseChartChartLogic(
   item,
   formLabelAlign,
@@ -15,46 +8,28 @@ export function handleRoseChartChartLogic(
   isFilter,
   type
 ) {
-  // 封装柱状图的具体逻辑
+  // 数据筛选逻辑
   if (isFilter === "filter") {
-    // 数据筛选逻辑,
     const filterResult = formLabelAlign.Ydata.map((yItem, index) => ({
       label: yItem.label,
       id: yItem.id,
       data: yItem.data.map((val) => {
         const filters = formFilterAlign[index]?.filters || [];
-
-        return val === null ||
-          (filters.length > 0 && !filters.includes(val[yItem.label]))
+        return val === null || (filters.length > 0 && !filters.includes(val[yItem.label]))
           ? null
           : val;
       }),
     }));
-    // 条件筛选逻辑
+
     const filterList = filterResult.map((filteredItem, index) => {
       const filter = formFilterAlign[index];
-      const { filterType1, filterType2, number1, number2 } = filter;
+      const { number1, number2 } = filter;
 
-      if (
-        (number1 === null || number1 === "") &&
-        (number2 === null || number2 === "")
-      ) {
-        return {
-          label: filteredItem.label,
-          id: filteredItem.id,
-          data: filteredItem.data,
-        };
+      if ((number1 === null || number1 === "") && (number2 === null || number2 === "")) {
+        return filteredItem;
       } else {
-        const filterDatas = filterData(
-          filter,
-          filteredItem.data,
-          filteredItem.label
-        );
-        return {
-          label: filteredItem.label,
-          id: filteredItem.id,
-          data: [...filterDatas],
-        };
+        const filterDatas = filterData(filter, filteredItem.data, filteredItem.label);
+        return { ...filteredItem, data: [...filterDatas] };
       }
     });
     item.Xdata = formLabelAlign.Xdata;
@@ -63,34 +38,33 @@ export function handleRoseChartChartLogic(
     item.Xdata = formLabelAlign.Xdata;
     item.Ydata = formLabelAlign.Ydata;
   }
-  const xres = item.Xdata?.map((xitem) => {
-    return {
-      boundaryGap: false,
-      type: "category",
-      data:
-        xitem.data &&
-        xitem.data.map((val) => xitem.label + val[xitem.label] || null),
-    };
-  }).filter((items) => items !== null || items !== undefined);
-  const yres = item.Ydata?.map((yitem) => {
-    return {
-      name: yitem.label,
-      type: "bar",
-      coordinateSystem: "polar",
-      progressiveThreshold: 3000, // 当数据量超过3000时启用渐进式渲染
-      progressive: true, // 启用渐进式渲染
-      renderMode: "webgl", // 启用 WebGL 渲染
-      data:
-        yitem.data &&
-        yitem.data.map((val) => {
-          return (val && val[yitem.label]) || null;
-        }),
-    };
-  }).filter((items) => items !== null || items !== undefined);
+
+  const xres = item.Xdata?.map((xitem) => ({
+    boundaryGap: false,
+    type: "category",
+    data: xitem.data && xitem.data.map((val) => xitem.label + val[xitem.label] || null),
+  })).filter((items) => items);
+
+  const baseColors = ["#E3F4BF", "#BEF7C8", "#86E6C8", "#36CFC9", "#209BDD", "#1581E6", "#0860BF"];
+
+  const yres = item.Ydata?.map((yitem, yIndex) => ({
+    name: yitem.label,
+    type: "bar",
+    coordinateSystem: "polar",
+    progressiveThreshold: 3000,
+    progressive: true,
+    renderMode: "webgl",
+    data: yitem.data && yitem.data.map((val, idx) => ({
+      value: (val && val[yitem.label]) || 0,
+      itemStyle: { color: baseColors[idx % baseColors.length] },
+    })),
+  })).filter((items) => items);
+
   if (item.Ydata[0]?.data?.length > 0) {
     item.option.series = yres;
     item.option.angleAxis = xres;
   }
+
   if (item.Xdata[0]?.data?.length > 0) {
     item.option.tooltip = {
       trigger: "axis",