Browse Source

修改下载报告

liujiejie 3 tháng trước cách đây
mục cha
commit
cdcc096faf
27 tập tin đã thay đổi với 196 bổ sung195 xóa
  1. 3 3
      downLoadServer/src/server/utils/chartsCom/3DDrawingChart.js
  2. 2 2
      downLoadServer/src/server/utils/chartsCom/BarChart.js
  3. 3 3
      downLoadServer/src/server/utils/chartsCom/BoxLineCharts.js
  4. 4 4
      downLoadServer/src/server/utils/chartsCom/BoxMarkersCharts.js
  5. 4 4
      downLoadServer/src/server/utils/chartsCom/ColorbarInitTwoDmarkersChart.js
  6. 6 6
      downLoadServer/src/server/utils/chartsCom/FaultAll.js
  7. 5 5
      downLoadServer/src/server/utils/chartsCom/FaultUnit.js
  8. 4 4
      downLoadServer/src/server/utils/chartsCom/GeneratorTemperature.js
  9. 4 4
      downLoadServer/src/server/utils/chartsCom/HeatmapCharts.js
  10. 4 4
      downLoadServer/src/server/utils/chartsCom/PlotlyCharts.js
  11. 5 5
      downLoadServer/src/server/utils/chartsCom/PlotlyChartsFen.js
  12. 4 4
      downLoadServer/src/server/utils/chartsCom/Radar.js
  13. 4 4
      downLoadServer/src/server/utils/chartsCom/Time3DChart.js
  14. 4 4
      downLoadServer/src/server/utils/chartsCom/TwoDMarkersChart.js
  15. 7 7
      downLoadServer/src/server/utils/chartsCom/TwoDMarkersChart1.js
  16. 6 6
      downLoadServer/src/server/utils/chartsCom/WindRoseChart.js
  17. 5 5
      downLoadServer/src/server/utils/chartsCom/YewErrorBarChart.js
  18. 4 4
      downLoadServer/src/server/utils/chartsCom/lineAndChildLine.js
  19. 4 4
      downLoadServer/src/server/utils/chartsCom/lineChartsFen.js
  20. 6 6
      downLoadServer/src/server/utils/chartsCom/powerMarkers2DCharts.js
  21. 5 5
      downLoadServer/src/server/utils/chartsCom/yawErrorBarSum.js
  22. 5 5
      downLoadServer/src/server/utils/chartsCom/yawErrorLine.js
  23. 5 5
      downLoadServer/src/server/utils/colors.js
  24. 80 79
      src/views/performance/assetssMag.vue
  25. 5 5
      src/views/performance/components/chartsCom/Time3DChart.vue
  26. 3 3
      src/views/performance/components/chartsCom/lineAndChildLine.vue
  27. 5 5
      src/views/performance/components/chartsCom/powerMarkers2DCharts.vue

+ 3 - 3
downLoadServer/src/server/utils/chartsCom/3DDrawingChart.js

@@ -20,7 +20,7 @@ export const generate3DDrawingChart = async (data, bucketName, objectName) => {
     await fs.ensureDir(tempDir);
     const tempFilePath = path.join(
       tempDir,
-      `temp_heatmap_chart_${Date.now()}.jpeg`
+      `temp_heatmap_chart_${Date.now()}.jpeg`,
     );
     // 获取 plotly.js 的绝对路径
     const plotlyPath = path.join(
@@ -28,7 +28,7 @@ export const generate3DDrawingChart = async (data, bucketName, objectName) => {
       "src",
       "public",
       "js",
-      "plotly-3.0.1.min.js"
+      "plotly-3.0.1.min.js",
     );
     const plotlyContent = await fs.readFile(plotlyPath, "utf-8");
 
@@ -213,7 +213,7 @@ export const generate3DDrawingChart = async (data, bucketName, objectName) => {
       // 发送上传请求
       const response = await axios.post(
         `${process.env.API_BASE_URL}/examples/upload`,
-        { filePath: tempFilePath, bucketName, objectName }
+        { filePath: tempFilePath, bucketName, objectName },
       );
       return response?.data?.url;
     } catch (error) {

+ 2 - 2
downLoadServer/src/server/utils/chartsCom/BarChart.js

@@ -23,7 +23,7 @@ export const generateBarChart = async (data, bucketName, objectName) => {
       "src",
       "public",
       "js",
-      "plotly-latest.min.js"
+      "plotly-latest.min.js",
     );
     const plotlyContent = await fs.readFile(plotlyPath, "utf-8");
 
@@ -195,7 +195,7 @@ export const generateBarChart = async (data, bucketName, objectName) => {
       // 发送上传请求
       const response = await axios.post(
         `${process.env.API_BASE_URL}/examples/upload`,
-        { filePath: tempFilePath, bucketName, objectName }
+        { filePath: tempFilePath, bucketName, objectName },
       );
       return response?.data?.url;
     } finally {

+ 3 - 3
downLoadServer/src/server/utils/chartsCom/BoxLineCharts.js

@@ -32,7 +32,7 @@ export const generateBoxLineChart = async (data, bucketName, objectName) => {
       "src",
       "public",
       "js",
-      "plotly-latest.min.js"
+      "plotly-latest.min.js",
     );
     const plotlyContent = await fs.readFile(plotlyPath, "utf-8");
 
@@ -132,7 +132,7 @@ export const generateBoxLineChart = async (data, bucketName, objectName) => {
                   const trace = ${JSON.stringify(trace)};
                   const layout = ${JSON.stringify(layout)};
                   Plotly.newPlot('chart', [trace, ${JSON.stringify(
-                    trace2
+                    trace2,
                   )}], layout).then(() => {
                     window.chartRendered = true;
                   });
@@ -164,7 +164,7 @@ export const generateBoxLineChart = async (data, bucketName, objectName) => {
       formData.append("file", fs.createReadStream(tempFilePath));
       const response = await axios.post(
         `${process.env.API_BASE_URL}/examples/upload`,
-        { filePath: tempFilePath, bucketName, objectName }
+        { filePath: tempFilePath, bucketName, objectName },
       );
       return response?.data?.url;
     } finally {

+ 4 - 4
downLoadServer/src/server/utils/chartsCom/BoxMarkersCharts.js

@@ -53,7 +53,7 @@ const filterData = (group) => {
 export const generateBoxMarkersCharts = async (
   data,
   bucketName,
-  objectName
+  objectName,
 ) => {
   const { data: chartData, xaixs, yaixs, analysisTypeCode } = data;
 
@@ -67,7 +67,7 @@ export const generateBoxMarkersCharts = async (
     "src",
     "public",
     "js",
-    "plotly-3.0.1.min.js"
+    "plotly-3.0.1.min.js",
   );
   const plotlyContent = await fs.readFile(plotlyPath, "utf-8");
 
@@ -174,7 +174,7 @@ export const generateBoxMarkersCharts = async (
     const tempFilePath = path.join(
       process.cwd(),
       "images",
-      `chart_${Date.now()}.jpeg`
+      `chart_${Date.now()}.jpeg`,
     );
     const chartElement = await page.$("#chart");
     await chartElement.screenshot({ path: tempFilePath, type: "jpeg" });
@@ -188,7 +188,7 @@ export const generateBoxMarkersCharts = async (
         filePath: tempFilePath,
         bucketName,
         objectName,
-      }
+      },
     );
 
     return response?.data?.url;

+ 4 - 4
downLoadServer/src/server/utils/chartsCom/ColorbarInitTwoDmarkersChart.js

@@ -16,7 +16,7 @@ import axios from "axios";
 export const generateColorbarInitTwoDmarkersChart = async (
   data,
   bucketName,
-  objectName
+  objectName,
 ) => {
   try {
     const colorsBar = colorSchemes[4].colors;
@@ -25,7 +25,7 @@ export const generateColorbarInitTwoDmarkersChart = async (
     await fs.ensureDir(tempDir);
     const tempFilePath = path.join(
       tempDir,
-      `temp_scatter_chart_${Date.now()}.jpeg`
+      `temp_scatter_chart_${Date.now()}.jpeg`,
     );
 
     // 获取 plotly.js 的绝对路径
@@ -34,7 +34,7 @@ export const generateColorbarInitTwoDmarkersChart = async (
       "src",
       "public",
       "js",
-      "plotly-3.0.1.min.js"
+      "plotly-3.0.1.min.js",
     );
     const plotlyContent = await fs.readFile(plotlyPath, "utf-8");
 
@@ -208,7 +208,7 @@ export const generateColorbarInitTwoDmarkersChart = async (
       // 发送上传请求
       const response = await axios.post(
         `${process.env.API_BASE_URL}/examples/upload`,
-        { filePath: tempFilePath, bucketName, objectName }
+        { filePath: tempFilePath, bucketName, objectName },
       );
       return response?.data?.url;
     } catch (error) {

+ 6 - 6
downLoadServer/src/server/utils/chartsCom/FaultAll.js

@@ -9,7 +9,7 @@ export const getFaultAllCharts = async (
   data,
   bucketName,
   objectName,
-  analysisTypeCode
+  analysisTypeCode,
 ) => {
   // 获取 plotly.js 的绝对路径
   const plotlyPath = path.join(
@@ -17,7 +17,7 @@ export const getFaultAllCharts = async (
     "src",
     "public",
     "js",
-    "plotly-3.0.1.min.js"
+    "plotly-3.0.1.min.js",
   );
   const plotlyContent = await fs.readFile(plotlyPath, "utf-8");
   // console.log(data, "全场故障数据");
@@ -112,7 +112,7 @@ export const getFaultAllCharts = async (
     await fs.ensureDir(tempDir);
     const tempFilePath = path.join(
       tempDir,
-      `temp_fault_all_chart_${Date.now()}.jpeg`
+      `temp_fault_all_chart_${Date.now()}.jpeg`,
     );
 
     // 使用 Puppeteer 生成图表的截图
@@ -142,9 +142,9 @@ export const getFaultAllCharts = async (
             <script>
               window.onload = function() {
                 Plotly.newPlot('chart', [${JSON.stringify(
-                  barTrace
+                  barTrace,
                 )}, ${JSON.stringify(lineTrace)}], ${JSON.stringify(
-        layout
+        layout,
       )}).then(() => {
                   window.chartRendered = true;
                 });
@@ -169,7 +169,7 @@ export const getFaultAllCharts = async (
           filePath: tempFilePath,
           bucketName,
           objectName,
-        }
+        },
       );
       return response?.data?.url;
     } catch (error) {

+ 5 - 5
downLoadServer/src/server/utils/chartsCom/FaultUnit.js

@@ -8,7 +8,7 @@ export const getFaultUnitCharts = async (
   data,
   bucketName,
   objectName,
-  analysisTypeCode
+  analysisTypeCode,
 ) => {
   try {
     // 获取 plotly.js 的绝对路径
@@ -17,7 +17,7 @@ export const getFaultUnitCharts = async (
       "src",
       "public",
       "js",
-      "plotly-3.0.1.min.js"
+      "plotly-3.0.1.min.js",
     );
     const plotlyContent = await fs.readFile(plotlyPath, "utf-8");
 
@@ -101,7 +101,7 @@ export const getFaultUnitCharts = async (
     await fs.ensureDir(tempDir);
     const tempFilePath = path.join(
       tempDir,
-      `temp_fault_unit_chart_${Date.now()}.jpeg`
+      `temp_fault_unit_chart_${Date.now()}.jpeg`,
     );
 
     // 使用 Puppeteer 生成图表的截图
@@ -129,7 +129,7 @@ export const getFaultUnitCharts = async (
             <script>
               window.onload = function() {
                 Plotly.newPlot('chart', ${JSON.stringify(
-                  bubbleData
+                  bubbleData,
                 )}, ${JSON.stringify(layout)}).then(() => {
                   window.chartRendered = true;
                 });
@@ -154,7 +154,7 @@ export const getFaultUnitCharts = async (
           filePath: tempFilePath,
           bucketName,
           objectName,
-        }
+        },
       );
       // console.log("上传成功:", response.data);
       return response?.data?.url;

+ 4 - 4
downLoadServer/src/server/utils/chartsCom/GeneratorTemperature.js

@@ -16,7 +16,7 @@ import axios from "axios";
 export const generateGeneratorTemperature = async (
   data,
   bucketName,
-  objectName
+  objectName,
 ) => {
   try {
     const typeLine = ["solid", "solid", "dot", "dot", "dash", "solid"];
@@ -31,7 +31,7 @@ export const generateGeneratorTemperature = async (
       "src",
       "public",
       "js",
-      "plotly-latest.min.js"
+      "plotly-latest.min.js",
     );
     const plotlyContent = await fs.readFile(plotlyPath, "utf-8");
     const colorDefault = [
@@ -210,7 +210,7 @@ export const generateGeneratorTemperature = async (
                 <script>
                   window.onload = function() {
                     Plotly.newPlot('chart', ${JSON.stringify(
-                      chartData
+                      chartData,
                     )}, ${JSON.stringify(layout)}).then(() => {
                       window.chartRendered = true;
                     });
@@ -242,7 +242,7 @@ export const generateGeneratorTemperature = async (
       formData.append("file", fs.createReadStream(tempFilePath));
       const response = await axios.post(
         `${process.env.API_BASE_URL}/examples/upload`,
-        { filePath: tempFilePath, bucketName, objectName }
+        { filePath: tempFilePath, bucketName, objectName },
       );
       return response?.data?.url;
     } finally {

+ 4 - 4
downLoadServer/src/server/utils/chartsCom/HeatmapCharts.js

@@ -20,7 +20,7 @@ export const generateHeatmapChart = async (data, bucketName, objectName) => {
     await fs.ensureDir(tempDir);
     const tempFilePath = path.join(
       tempDir,
-      `temp_heatmap_chart_${Date.now()}.jpeg`
+      `temp_heatmap_chart_${Date.now()}.jpeg`,
     );
 
     // 获取 plotly.js 的绝对路径
@@ -29,7 +29,7 @@ export const generateHeatmapChart = async (data, bucketName, objectName) => {
       "src",
       "public",
       "js",
-      "plotly-3.0.1.min.js"
+      "plotly-3.0.1.min.js",
     );
     const plotlyContent = await fs.readFile(plotlyPath, "utf-8");
 
@@ -64,7 +64,7 @@ export const generateHeatmapChart = async (data, bucketName, objectName) => {
           [1, "#5783B3"], // 100%
         ],
         text: chartDataset.ZData.map((row) =>
-          row.map((value) => value.toString())
+          row.map((value) => value.toString()),
         ),
         hoverinfo: "text", // Hover时显示文本
         showscale: true, // 显示颜色条
@@ -164,7 +164,7 @@ export const generateHeatmapChart = async (data, bucketName, objectName) => {
       // 发送上传请求
       const response = await axios.post(
         `${process.env.API_BASE_URL}/examples/upload`,
-        { filePath: tempFilePath, bucketName, objectName }
+        { filePath: tempFilePath, bucketName, objectName },
       );
       return response?.data?.url;
     } catch (error) {

+ 4 - 4
downLoadServer/src/server/utils/chartsCom/PlotlyCharts.js

@@ -26,7 +26,7 @@ import { text } from "stream/consumers";
 export const generatePlotlyCharts = async (
   chartData,
   bucketName,
-  objectName
+  objectName,
 ) => {
   const colorSchemesItem = colorSchemes[0].colors;
   const tempDir = path.join(process.cwd(), "images");
@@ -37,7 +37,7 @@ export const generatePlotlyCharts = async (
     // 构建数据
     const data = [];
     const newData = chartData.data.filter(
-      (item) => item.enginName !== "合同功率曲线"
+      (item) => item.enginName !== "合同功率曲线",
     );
 
     newData.forEach((turbine, index) => {
@@ -96,7 +96,7 @@ export const generatePlotlyCharts = async (
       "src",
       "public",
       "js",
-      "plotly-latest.min.js"
+      "plotly-latest.min.js",
     );
     const plotlyContent = await fs.readFile(plotlyPath, "utf-8");
 
@@ -153,7 +153,7 @@ export const generatePlotlyCharts = async (
           filePath: tempFilePath,
           bucketName,
           objectName,
-        }
+        },
       );
 
       const imageUrl = response?.data?.url;

+ 5 - 5
downLoadServer/src/server/utils/chartsCom/PlotlyChartsFen.js

@@ -22,7 +22,7 @@ export const generatePlotlyChartsFen = async (
   data,
   bucketName,
   objectName,
-  fieldEngineCode
+  fieldEngineCode,
 ) => {
   try {
     // 创建临时目录
@@ -30,7 +30,7 @@ export const generatePlotlyChartsFen = async (
     await fs.ensureDir(tempDir);
     const tempFilePath = path.join(
       tempDir,
-      `temp_heatmap_chart_${Date.now()}.jpeg`
+      `temp_heatmap_chart_${Date.now()}.jpeg`,
     );
 
     // 获取 plotly.js 的绝对路径
@@ -39,7 +39,7 @@ export const generatePlotlyChartsFen = async (
       "src",
       "public",
       "js",
-      "plotly-latest.min.js"
+      "plotly-latest.min.js",
     );
     const plotlyContent = await fs.readFile(plotlyPath, "utf-8");
 
@@ -94,7 +94,7 @@ export const generatePlotlyChartsFen = async (
           finalData.push(chartConfig);
         });
       const filterData = data.data.filter(
-        (item) => item.enginName === "合同功率曲线"
+        (item) => item.enginName === "合同功率曲线",
       );
       // 添加合同功率曲线
       if (filterData && filterData[0].enginName === "合同功率曲线") {
@@ -204,7 +204,7 @@ export const generatePlotlyChartsFen = async (
       // 发送上传请求
       const response = await axios.post(
         `${process.env.API_BASE_URL}/examples/upload`,
-        { filePath: tempFilePath, bucketName, objectName }
+        { filePath: tempFilePath, bucketName, objectName },
       );
       return response?.data?.url;
     } finally {

+ 4 - 4
downLoadServer/src/server/utils/chartsCom/Radar.js

@@ -11,7 +11,7 @@ const echartsPath = path.join(
   "src",
   "public",
   "js",
-  "echarts.min.js"
+  "echarts.min.js",
 );
 const echartsScript = await fs.readFile(echartsPath, "utf-8");
 
@@ -124,7 +124,7 @@ export const getRadarCharts = async (
   bucketName,
   objectName,
   fieldInfo,
-  engineTypeCode
+  engineTypeCode,
 ) => {
   const browser = await puppeteer.launch({
     headless: "new",
@@ -145,7 +145,7 @@ export const getRadarCharts = async (
     },
     chartData,
     itemCsvData,
-    engineTypeCode
+    engineTypeCode,
   );
 
   // ✅ 等待 echarts 渲染完成
@@ -167,7 +167,7 @@ export const getRadarCharts = async (
         filePath: tempFilePath,
         bucketName,
         objectName: `${newUrl}/${chartData.wind_turbine_name}.jpg`,
-      }
+      },
     );
 
     return response?.data?.url;

+ 4 - 4
downLoadServer/src/server/utils/chartsCom/Time3DChart.js

@@ -26,7 +26,7 @@ export const generateTime3DChart = async (data, bucketName, objectName) => {
     await fs.ensureDir(tempDir);
     const tempFilePath = path.join(
       tempDir,
-      `temp_heatmap_chart_${Date.now()}.jpeg`
+      `temp_heatmap_chart_${Date.now()}.jpeg`,
     );
 
     // 获取 plotly.js 的绝对路径
@@ -35,7 +35,7 @@ export const generateTime3DChart = async (data, bucketName, objectName) => {
       "src",
       "public",
       "js",
-      "plotly-3.0.1.min.js"
+      "plotly-3.0.1.min.js",
     );
     const plotlyContent = await fs.readFile(plotlyPath, "utf-8");
     // 创建浏览器实例
@@ -55,7 +55,7 @@ export const generateTime3DChart = async (data, bucketName, objectName) => {
       const page = await browser.newPage();
       // 准备图表数据
       const uniqueMonths = Array.from(
-        new Set(data.data[0].yData.map((date) => formatDate(date)))
+        new Set(data.data[0].yData.map((date) => formatDate(date))),
       );
       // 设置每个月份对应的颜色
       const monthColors = colorSchemes[0].colors;
@@ -229,7 +229,7 @@ export const generateTime3DChart = async (data, bucketName, objectName) => {
       // 发送上传请求
       const response = await axios.post(
         `${process.env.API_BASE_URL}/examples/upload`,
-        { filePath: tempFilePath, bucketName, objectName }
+        { filePath: tempFilePath, bucketName, objectName },
       );
       return response?.data?.url;
     } catch (error) {

+ 4 - 4
downLoadServer/src/server/utils/chartsCom/TwoDMarkersChart.js

@@ -17,7 +17,7 @@ import axios from "axios";
 export const generateTwoDMarkersChart = async (
   data,
   bucketName,
-  objectName
+  objectName,
 ) => {
   try {
     // 创建临时目录
@@ -25,7 +25,7 @@ export const generateTwoDMarkersChart = async (
     await fs.ensureDir(tempDir);
     const tempFilePath = path.join(
       tempDir,
-      `temp_scatter_chart_${Date.now()}.jpeg`
+      `temp_scatter_chart_${Date.now()}.jpeg`,
     );
 
     // 获取 plotly.js 的绝对路径
@@ -34,7 +34,7 @@ export const generateTwoDMarkersChart = async (
       "src",
       "public",
       "js",
-      "plotly-3.0.1.min.js"
+      "plotly-3.0.1.min.js",
     );
     const plotlyContent = await fs.readFile(plotlyPath, "utf-8");
 
@@ -195,7 +195,7 @@ export const generateTwoDMarkersChart = async (
       // 发送上传请求
       const response = await axios.post(
         `${process.env.API_BASE_URL}/examples/upload`,
-        { filePath: tempFilePath, bucketName, objectName }
+        { filePath: tempFilePath, bucketName, objectName },
       );
       return response?.data?.url;
     } catch (error) {

+ 7 - 7
downLoadServer/src/server/utils/chartsCom/TwoDMarkersChart1.js

@@ -8,7 +8,7 @@ import axios from "axios";
 export const generateTwoDMarkersChart1 = async (
   data,
   bucketName,
-  objectName
+  objectName,
 ) => {
   try {
     // 创建临时目录
@@ -16,7 +16,7 @@ export const generateTwoDMarkersChart1 = async (
     await fs.ensureDir(tempDir);
     const tempFilePath = path.join(
       tempDir,
-      `temp_scatter_chart_${Date.now()}.jpeg`
+      `temp_scatter_chart_${Date.now()}.jpeg`,
     );
 
     // 获取 plotly.js 的绝对路径
@@ -25,7 +25,7 @@ export const generateTwoDMarkersChart1 = async (
       "src",
       "public",
       "js",
-      "plotly-3.0.1.min.js"
+      "plotly-3.0.1.min.js",
     );
     const plotlyContent = await fs.readFile(plotlyPath, "utf-8");
 
@@ -43,13 +43,13 @@ export const generateTwoDMarkersChart1 = async (
 
       // 提取散点数据和线数据
       const scatterData = data.data.filter(
-        (item) => item.engineName !== "合同功率曲线"
+        (item) => item.engineName !== "合同功率曲线",
       )[0]; // 点数据
 
       const lineData = data.data.filter(
         (item) =>
           item.engineName === "合同功率曲线" ||
-          item.enginName === "合同功率曲线"
+          item.enginName === "合同功率曲线",
       )[0]; // 线数据
 
       // 提取唯一时间标签,并计算 tickvals 和 ticktext
@@ -74,7 +74,7 @@ export const generateTwoDMarkersChart1 = async (
       let colorValues = scatterData.colorbar
         ? scatterData.colorbar.map((date) => timeMapping[date])
         : scatterData.color.map((date) => timeMapping[date]);
-     
+
       // 绘制散点图
       const scatterTrace = {
         x: scatterData.xData,
@@ -197,7 +197,7 @@ export const generateTwoDMarkersChart1 = async (
       // 发送上传请求
       const response = await axios.post(
         `${process.env.API_BASE_URL}/examples/upload`,
-        { filePath: tempFilePath, bucketName, objectName }
+        { filePath: tempFilePath, bucketName, objectName },
       );
       return response?.data?.url;
     } catch (error) {

+ 6 - 6
downLoadServer/src/server/utils/chartsCom/WindRoseChart.js

@@ -9,7 +9,7 @@ export const getWindRoseChart = async (
   data,
   bucketName,
   objectName,
-  analysisTypeCode
+  analysisTypeCode,
 ) => {
   try {
     // 获取 plotly.js 的绝对路径
@@ -18,7 +18,7 @@ export const getWindRoseChart = async (
       "src",
       "public",
       "js",
-      "plotly-3.0.1.min.js"
+      "plotly-3.0.1.min.js",
     );
     const plotlyContent = await fs.readFile(plotlyPath, "utf-8");
 
@@ -28,7 +28,7 @@ export const getWindRoseChart = async (
     await fs.ensureDir(tempDir);
     const tempFilePath = path.join(
       tempDir,
-      `temp_wind_rose_chart_${Date.now()}.jpeg`
+      `temp_wind_rose_chart_${Date.now()}.jpeg`,
     );
 
     // 定义风向的 16 等分
@@ -61,7 +61,7 @@ export const getWindRoseChart = async (
         const { windDirection, windSpeedRange } = item;
         const index = windDirections.findIndex(
           (dir, i) =>
-            windDirection >= dir && windDirection < windDirections[i + 1]
+            windDirection >= dir && windDirection < windDirections[i + 1],
         );
 
         if (index !== -1 && counts[windSpeedRange]) {
@@ -148,7 +148,7 @@ export const getWindRoseChart = async (
             <script>
               window.onload = function() {
                 Plotly.newPlot('chart', ${JSON.stringify(
-                  traces
+                  traces,
                 )}, ${JSON.stringify(layout)}).then(() => {
                   window.chartRendered = true;
                 });
@@ -173,7 +173,7 @@ export const getWindRoseChart = async (
           filePath: tempFilePath,
           bucketName,
           objectName,
-        }
+        },
       );
       return response?.data?.url;
     } catch (error) {

+ 5 - 5
downLoadServer/src/server/utils/chartsCom/YewErrorBarChart.js

@@ -9,7 +9,7 @@ export const getYewErrorBarChart = async (
   data,
   bucketName,
   objectName,
-  analysisTypeCode
+  analysisTypeCode,
 ) => {
   try {
     // 提取机组编号和偏航误差值
@@ -103,7 +103,7 @@ export const getYewErrorBarChart = async (
     await fs.ensureDir(tempDir);
     const tempFilePath = path.join(
       tempDir,
-      `temp_yew_error_bar_chart_${Date.now()}.jpeg`
+      `temp_yew_error_bar_chart_${Date.now()}.jpeg`,
     );
 
     // 获取 plotly.js 的绝对路径
@@ -112,7 +112,7 @@ export const getYewErrorBarChart = async (
       "src",
       "public",
       "js",
-      "plotly-3.0.1.min.js"
+      "plotly-3.0.1.min.js",
     );
     const plotlyContent = await fs.readFile(plotlyPath, "utf-8");
 
@@ -144,7 +144,7 @@ export const getYewErrorBarChart = async (
             <script>
               window.onload = function() {
                 Plotly.newPlot('chart', ${JSON.stringify(
-                  traces
+                  traces,
                 )}, ${JSON.stringify(layout)}).then(() => {
                   window.chartRendered = true;
                 });
@@ -169,7 +169,7 @@ export const getYewErrorBarChart = async (
           filePath: tempFilePath,
           bucketName,
           objectName,
-        }
+        },
       );
       return response?.data?.url;
     } catch (error) {

+ 4 - 4
downLoadServer/src/server/utils/chartsCom/lineAndChildLine.js

@@ -16,7 +16,7 @@ import axios from "axios";
 export const generateLineAndChildLine = async (
   chartData,
   bucketName,
-  objectName
+  objectName,
 ) => {
   try {
     const colorSchemesItem = colorSchemes[0].colors;
@@ -112,7 +112,7 @@ export const generateLineAndChildLine = async (
     await fs.ensureDir(tempDir);
     const tempFilePath = path.join(
       tempDir,
-      `temp_line_chart_${Date.now()}.jpeg`
+      `temp_line_chart_${Date.now()}.jpeg`,
     );
 
     // 获取 plotly.js 的绝对路径
@@ -121,7 +121,7 @@ export const generateLineAndChildLine = async (
       "src",
       "public",
       "js",
-      "plotly-latest.min.js"
+      "plotly-latest.min.js",
     );
     const plotlyContent = await fs.readFile(plotlyPath, "utf-8");
 
@@ -193,7 +193,7 @@ export const generateLineAndChildLine = async (
       // 发送上传请求
       const response = await axios.post(
         `${process.env.API_BASE_URL}/examples/upload`,
-        { filePath: tempFilePath, bucketName, objectName }
+        { filePath: tempFilePath, bucketName, objectName },
       );
       return response?.data?.url;
     } finally {

+ 4 - 4
downLoadServer/src/server/utils/chartsCom/lineChartsFen.js

@@ -14,7 +14,7 @@ export const generateLineChart = async (
   data,
   bucketName,
   objectName,
-  fieldEngineCode
+  fieldEngineCode,
 ) => {
   try {
     // 创建临时目录
@@ -22,7 +22,7 @@ export const generateLineChart = async (
     await fs.ensureDir(tempDir);
     const tempFilePath = path.join(
       tempDir,
-      `temp_line_chart_${Date.now()}.jpeg`
+      `temp_line_chart_${Date.now()}.jpeg`,
     );
 
     // 获取 plotly.js 的绝对路径
@@ -31,7 +31,7 @@ export const generateLineChart = async (
       "src",
       "public",
       "js",
-      "plotly-latest.min.js"
+      "plotly-latest.min.js",
     );
     const plotlyContent = await fs.readFile(plotlyPath, "utf-8");
 
@@ -187,7 +187,7 @@ export const generateLineChart = async (
       // 发送上传请求
       const response = await axios.post(
         `${process.env.API_BASE_URL}/examples/upload`,
-        { filePath: tempFilePath, bucketName, objectName }
+        { filePath: tempFilePath, bucketName, objectName },
       );
       return response?.data?.url;
     } finally {

+ 6 - 6
downLoadServer/src/server/utils/chartsCom/powerMarkers2DCharts.js

@@ -16,7 +16,7 @@ import axios from "axios"; // 导入 axios
 export const generatepowerMarkers2DCharts = async (
   data,
   bucketName,
-  objectName
+  objectName,
 ) => {
   try {
     const colorsBar = colorSchemes[0].colors;
@@ -25,7 +25,7 @@ export const generatepowerMarkers2DCharts = async (
     await fs.ensureDir(tempDir);
     const tempFilePath = path.join(
       tempDir,
-      `temp_scatter_chart_${Date.now()}.jpeg`
+      `temp_scatter_chart_${Date.now()}.jpeg`,
     );
 
     // 获取 plotly.js 的绝对路径
@@ -34,7 +34,7 @@ export const generatepowerMarkers2DCharts = async (
       "src",
       "public",
       "js",
-      "plotly-3.0.1.min.js"
+      "plotly-3.0.1.min.js",
     );
     const plotlyContent = await fs.readFile(plotlyPath, "utf-8");
 
@@ -52,11 +52,11 @@ export const generatepowerMarkers2DCharts = async (
 
       // 提取散点数据和线数据
       const scatterData = data.data.filter(
-        (item) => item.engineName !== "合同功率曲线"
+        (item) => item.engineName !== "合同功率曲线",
       )[0]; // 点数据
 
       const lineData = data.data.filter(
-        (item) => item.engineName === "合同功率曲线"
+        (item) => item.engineName === "合同功率曲线",
       )[0]; // 线数据
 
       // 保存原始颜色和大小
@@ -261,7 +261,7 @@ export const generatepowerMarkers2DCharts = async (
           filePath: tempFilePath,
           bucketName, //桶名称
           objectName, //在 MinIO 中的文件名
-        }
+        },
       );
       // return response.data; // 返回上传结果
       return response?.data?.url;

+ 5 - 5
downLoadServer/src/server/utils/chartsCom/yawErrorBarSum.js

@@ -10,7 +10,7 @@ export const getYawErrorBarSumCharts = async (
   data,
   bucketName,
   objectName,
-  analysisTypeCode
+  analysisTypeCode,
 ) => {
   try {
     // 提取静态偏航误差值和机组数量
@@ -90,7 +90,7 @@ export const getYawErrorBarSumCharts = async (
     await fs.ensureDir(tempDir);
     const tempFilePath = path.join(
       tempDir,
-      `temp_yaw_error_bar_sum_chart_${Date.now()}.jpeg`
+      `temp_yaw_error_bar_sum_chart_${Date.now()}.jpeg`,
     );
     // 获取 plotly.js 的绝对路径
     const plotlyPath = path.join(
@@ -98,7 +98,7 @@ export const getYawErrorBarSumCharts = async (
       "src",
       "public",
       "js",
-      "plotly-3.0.1.min.js"
+      "plotly-3.0.1.min.js",
     );
     const plotlyContent = await fs.readFile(plotlyPath, "utf-8");
 
@@ -129,7 +129,7 @@ export const getYawErrorBarSumCharts = async (
             <script>
               window.onload = function() {
                 Plotly.newPlot('chart', [${JSON.stringify(
-                  trace
+                  trace,
                 )}], ${JSON.stringify(layout)}).then(() => {
                   window.chartRendered = true;
                 });
@@ -154,7 +154,7 @@ export const getYawErrorBarSumCharts = async (
           filePath: tempFilePath,
           bucketName,
           objectName,
-        }
+        },
       );
       return response.data.url;
     } catch (error) {

+ 5 - 5
downLoadServer/src/server/utils/chartsCom/yawErrorLine.js

@@ -16,7 +16,7 @@ import axios from "axios";
 export const generateYawErrorLine = async (
   chartData,
   bucketName,
-  objectName
+  objectName,
 ) => {
   try {
     const data = [];
@@ -27,7 +27,7 @@ export const generateYawErrorLine = async (
       "src",
       "public",
       "js",
-      "plotly-3.0.1.min.js"
+      "plotly-3.0.1.min.js",
     );
     const plotlyContent = await fs.readFile(plotlyPath, "utf-8");
 
@@ -125,7 +125,7 @@ export const generateYawErrorLine = async (
     await fs.ensureDir(tempDir);
     const tempFilePath = path.join(
       tempDir,
-      `temp_yaw_error_chart_${Date.now()}.jpeg`
+      `temp_yaw_error_chart_${Date.now()}.jpeg`,
     );
 
     try {
@@ -147,7 +147,7 @@ export const generateYawErrorLine = async (
             <script>
               window.onload = function() {
                 Plotly.newPlot('chart', ${JSON.stringify(
-                  data
+                  data,
                 )}, ${JSON.stringify(layout)}).then(() => {
                   window.chartRendered = true;
                 });
@@ -175,7 +175,7 @@ export const generateYawErrorLine = async (
           filePath: tempFilePath,
           bucketName,
           objectName,
-        }
+        },
       );
 
       return response?.data?.url;

+ 5 - 5
downLoadServer/src/server/utils/colors.js

@@ -1,8 +1,8 @@
 /*
  * @Author: your name
  * @Date: 2025-04-09 09:35:33
- * @LastEditTime: 2025-04-09 09:38:09
- * @LastEditors: bogon
+ * @LastEditTime: 2026-05-14 14:37:30
+ * @LastEditors: milo-MacBook-Pro.local
  * @Description: In User Settings Edit
  * @FilePath: /downLoadServer/src/server/utils/colors.js
  */
@@ -11,9 +11,9 @@ export const colorSchemes = [
     label: "默认",
     colors: [
       // "#FFFFDF",
-      "#DFEDC1",
-      "#EBF6C1",
-      "#DBEEBC",
+      // "#DFEDC1",
+      // "#EBF6C1",
+      // "#DBEEBC",
       "#A8D7BE",
       "#8ECAC1",
       "#77BDC2",

+ 80 - 79
src/views/performance/assetssMag.vue

@@ -600,90 +600,91 @@ export default {
           console.log(itemField, "itemField");
         }
 
-        const chartFileStem =
-          (itemField.fieldEngineName &&
-            String(itemField.fieldEngineName).trim()) ||
-          itemField.engineTypeCode ||
-          itemField.fieldEngineCode ||
-          "chart";
         const objectname =
           itemAnalysis.analysisTypeCode === "temperature_large_components"
-            ? `${filterAnalysis.filterFileAddr}/${chartFileStem}.jpg`
+            ? filterAnalysis.filterFileAddr + "/" + itemField.fieldEngineName ||
+              itemField.engineTypeCode + ".jpg"
             : itemField.engineTypeCode
-            ? `${urlType}${itemField.engineTypeCode}.jpg`
-            : `${urlType}${chartFileStem}.jpg`;
-
-        const res = await axios.post(
-          `/downLoadChart/chartServer/charts/${urlType}`,
-          {
-            fieldEngineCode: itemField.fieldEngineCode,
-            bucketName: "bucket-zhzn",
-            engineTypeCode: itemField.machineTypeCode,
-            objectName:
-              `charts/${row.fieldCode}/${row.batchCode}/${itemAnalysis.analysisTypeCode}/` +
-              objectname,
-            fieldInfo: this.fieldInfo,
-            fileAddr: itemField.fileAddr,
-            chartType:
-              filterAnalysis.typeDocxName === "production_indicator_unit"
-                ? "radar"
-                : urlType,
-          },
+            ? urlType + itemField.engineTypeCode + ".jpg"
+            : urlType + itemField.fieldEngineName + ".jpg";
+        console.log(
+          objectname,
+          "objectname",
+          itemAnalysis.analysisTypeName,
+          itemField.engineTypeCode,
+          itemAnalysis,
         );
-        // 每完成 10% 提示一次(可调)
-        const percent = Math.floor(
-          (this.progress.current / this.progress.total) * 100,
-        );
-        if (percent % 5 === 0 && !this._shownPercents?.includes(percent)) {
-          this._shownPercents = this._shownPercents || [];
-          this._shownPercents.push(percent);
+        // const res = await axios.post(
+        //   `/downLoadChart/chartServer/charts/${urlType}`,
+        //   {
+        //     fieldEngineCode: itemField.fieldEngineCode,
+        //     bucketName: "bucket-zhzn",
+        //     engineTypeCode: itemField.machineTypeCode,
+        //     objectName:
+        //       `charts/${row.fieldCode}/${row.batchCode}/${itemAnalysis.analysisTypeCode}/` +
+        //       objectname,
+        //     fieldInfo: this.fieldInfo,
+        //     fileAddr: itemField.fileAddr,
+        //     chartType:
+        //       filterAnalysis.typeDocxName === "production_indicator_unit"
+        //         ? "radar"
+        //         : urlType,
+        //   },
+        // );
+        // // 每完成 10% 提示一次(可调)
+        // const percent = Math.floor(
+        //   (this.progress.current / this.progress.total) * 100,
+        // );
+        // if (percent % 5 === 0 && !this._shownPercents?.includes(percent)) {
+        //   this._shownPercents = this._shownPercents || [];
+        //   this._shownPercents.push(percent);
 
-          this.$notify.info(
-            `📈 已完成 ${percent}%/${this.progress.current}张,共 ${this.progress.total} 张图表`,
-          );
-        }
-        let key = `zn-techcn-replace-tags-${filterAnalysis.typeDocxName}-${typeChart}`;
-        if (urlType === "yawErrorBarSumChart") {
-          key = `zn-techcn-replace-tags-${filterAnalysis.typeDocxName}-generalFiles2`;
+        //   this.$notify.info(
+        //     `📈 已完成 ${percent}%/${this.progress.current}张,共 ${this.progress.total} 张图表`,
+        //   );
+        // }
+        // let key = `zn-techcn-replace-tags-${filterAnalysis.typeDocxName}-${typeChart}`;
+        // if (urlType === "yawErrorBarSumChart") {
+        //   key = `zn-techcn-replace-tags-${filterAnalysis.typeDocxName}-generalFiles2`;
 
-          if (!this.fileDataList["yawErrorRows"]) {
-            this.$set(this.fileDataList, "yawErrorRows", []); // Vue 2 中响应式设置对象属性
-          }
-          this.fileDataList["yawErrorRows"] = res?.data?.data?.data;
-        } else if (urlType === "yawErrorChart") {
-          key = `zn-techcn-replace-tags-${filterAnalysis.typeDocxName}-generalFiles1`;
-        }
-        if (filterAnalysis.typeDocxName === "production_indicator_all") {
-          if (!this.fileDataList["rows"]) {
-            this.$set(this.fileDataList, "rows", []); // Vue 2 中响应式设置对象属性
-          }
-          this.fileDataList["rows"] = res?.data?.data?.data;
-        }
-        if (itemField.engineTypeCode === "total_fault_result") {
-          if (!this.fileDataList["faultRows"]) {
-            this.$set(this.fileDataList, "faultRows", []); // Vue 2 中响应式设置对象属性
-          }
-          this.fileDataList["faultRows"] = res?.data?.data?.data;
-        }
-        if (itemField.engineTypeCode === "turbine_fault_result") {
-          if (!this.fileDataList["windTurbineRows"]) {
-            this.$set(this.fileDataList, "windTurbineRows", []); // Vue 2 中响应式设置对象属性
-          }
-          this.fileDataList["windTurbineRows"] = res?.data?.data?.data;
-        }
-        if (filterAnalysis.typeDocxName === "production_indicator_unit") {
-          if (!this.fileDataList[key]) {
-            this.$set(this.fileDataList, key, []); // Vue 2 中响应式设置对象属性
-          }
-          res?.data?.data?.imageUrls.map((imgval) => {
-            this.fileDataList[key].push(imgval);
-          });
-        } else {
-          if (!this.fileDataList[key]) {
-            this.$set(this.fileDataList, key, []); // Vue 2 中响应式设置对象属性
-          }
-          this.fileDataList[key].push(res?.data?.data?.imageUrl);
-        }
+        //   if (!this.fileDataList["yawErrorRows"]) {
+        //     this.$set(this.fileDataList, "yawErrorRows", []); // Vue 2 中响应式设置对象属性
+        //   }
+        //   this.fileDataList["yawErrorRows"] = res?.data?.data?.data;
+        // } else if (urlType === "yawErrorChart") {
+        //   key = `zn-techcn-replace-tags-${filterAnalysis.typeDocxName}-generalFiles1`;
+        // }
+        // if (filterAnalysis.typeDocxName === "production_indicator_all") {
+        //   if (!this.fileDataList["rows"]) {
+        //     this.$set(this.fileDataList, "rows", []); // Vue 2 中响应式设置对象属性
+        //   }
+        //   this.fileDataList["rows"] = res?.data?.data?.data;
+        // }
+        // if (itemField.engineTypeCode === "total_fault_result") {
+        //   if (!this.fileDataList["faultRows"]) {
+        //     this.$set(this.fileDataList, "faultRows", []); // Vue 2 中响应式设置对象属性
+        //   }
+        //   this.fileDataList["faultRows"] = res?.data?.data?.data;
+        // }
+        // if (itemField.engineTypeCode === "turbine_fault_result") {
+        //   if (!this.fileDataList["windTurbineRows"]) {
+        //     this.$set(this.fileDataList, "windTurbineRows", []); // Vue 2 中响应式设置对象属性
+        //   }
+        //   this.fileDataList["windTurbineRows"] = res?.data?.data?.data;
+        // }
+        // if (filterAnalysis.typeDocxName === "production_indicator_unit") {
+        //   if (!this.fileDataList[key]) {
+        //     this.$set(this.fileDataList, key, []); // Vue 2 中响应式设置对象属性
+        //   }
+        //   res?.data?.data?.imageUrls.map((imgval) => {
+        //     this.fileDataList[key].push(imgval);
+        //   });
+        // } else {
+        //   if (!this.fileDataList[key]) {
+        //     this.$set(this.fileDataList, key, []); // Vue 2 中响应式设置对象属性
+        //   }
+        //   this.fileDataList[key].push(res?.data?.data?.imageUrl);
+        // }
       } catch (err) {
         console.error("生成失败:", err);
       }
@@ -698,7 +699,7 @@ export default {
         await this.getAllAnalysis(row.batchCode);
         await this.getFieldDetail(row.batchCode);
         this.$message.info("开始生成word文档");
-        const limit = pLimit(1); // 限制同时并发的请求数量为 5
+        const limit = pLimit(5); // 限制同时并发的请求数量为 5
         const tasks = [];
         for (const itemAnalysis of this.allAnalysis) {
           const filterAnalysis = allAnalysisType.filter(

+ 5 - 5
src/views/performance/components/chartsCom/Time3DChart.vue

@@ -157,8 +157,8 @@ export default {
       // 提取 Y 轴数据中的月份,并去重
       const uniqueMonths = Array.from(
         new Set(
-          this.chartData.data[0].yData.map((date) => this.formatDate(date))
-        )
+          this.chartData.data[0].yData.map((date) => this.formatDate(date)),
+        ),
       );
       if (!this.color1) {
         this.color1 = colorSchemes[0].colors;
@@ -359,7 +359,7 @@ export default {
         `plotly-3d-chart-` + this.index,
         traces,
         layout,
-        config
+        config,
       ).then(function (gd) {
         // 获取工具栏按钮
         const toolbar = gd.querySelector(".modebar");
@@ -392,7 +392,7 @@ export default {
       });
       // 监听图表的 relayout 事件,获取并输出相机视角
       const plotElement = document.getElementById(
-        `plotly-3d-chart-` + this.index
+        `plotly-3d-chart-` + this.index,
       );
       plotElement.on("plotly_relayout", function (eventData) {
         // 在每次布局变更时,打印当前相机视角
@@ -400,7 +400,7 @@ export default {
           console.log(
             "当前相机视角:",
             eventData["scene.camera"],
-            eventData["scene.aspectratio"]
+            eventData["scene.aspectratio"],
           );
         }
       });

+ 3 - 3
src/views/performance/components/chartsCom/lineAndChildLine.vue

@@ -146,7 +146,7 @@ export default {
       } else {
         console.log(
           JSON.parse(JSON.stringify(min_pitch3)),
-          "JSON.parse(JSON.stringify(min_pitch3))"
+          "JSON.parse(JSON.stringify(min_pitch3))",
         );
         this.chartData = JSON.parse(JSON.stringify(min_pitch3));
         // 使用 nextTick 来确保 DOM 渲染完成后绘制图表
@@ -176,7 +176,7 @@ export default {
           index,
           this.color1.length > 0,
           index % this.colors.length,
-          "this.color1.length > 0"
+          "this.color1.length > 0",
         );
         // 判断图表类型,根据类型调整绘制方式
         const chartConfig = {
@@ -238,7 +238,7 @@ export default {
                   Math.max(
                     ...this.chartData.contract_Cp_curve_xData
                       .map(Number)
-                      .filter((val) => !isNaN(val))
+                      .filter((val) => !isNaN(val)),
                   ) * 0.9,
                 ]
               : undefined,

+ 5 - 5
src/views/performance/components/chartsCom/powerMarkers2DCharts.vue

@@ -171,13 +171,13 @@ export default {
       const data =
         this.chartData.data &&
         this.chartData.data.filter(
-          (item) => item.enginName !== "合同功率曲线"
+          (item) => item.enginName !== "合同功率曲线",
         )[0]; // 点数据
 
       const lineData =
         this.chartData.data &&
         this.chartData.data.filter(
-          (item) => item.enginName === "合同功率曲线"
+          (item) => item.enginName === "合同功率曲线",
         )[0]; // 线数据
 
       // 提取唯一时间标签,并计算 tickvals 和 ticktext
@@ -386,7 +386,7 @@ export default {
           this.$refs[`plotlyChart-${this.index}`], // 这里是对 DOM 元素的引用
           traces,
           layout,
-          config
+          config,
         ).then(() => {
           // 确保图表加载完成后设置工具栏按钮
           const plotElement = this.$refs[`plotlyChart-${this.index}`];
@@ -542,7 +542,7 @@ export default {
             transferType: this.chartData.scada || "", //分析数据源类型
             windFarmCode: this.chartData.field_code || "", //风场编号
             windTurbineNumber: this.chartData.data[0].engineCode || "", //风机编号
-          }
+          },
         );
         const allData = result?.data?.datas || [];
         if (!allData.length) {
@@ -555,7 +555,7 @@ export default {
         // 4. 获取可用映射字段
         const mapping = paramValueTypes?.data?.datas || [];
         const matchedMapping = mapping.filter((m) =>
-          firstItem.hasOwnProperty(m.paramKey)
+          firstItem.hasOwnProperty(m.paramKey),
         );
 
         // 5. 构建 CSV 表头(中文)