Prechádzať zdrojové kódy

华电部署解决上一条下一条图片不展示的问题

liujiejie 2 týždňov pred
rodič
commit
41485998b3
23 zmenil súbory, kde vykonal 421 pridanie a 58 odobranie
  1. 1 3
      downLoadServer/src/server/utils/chartsCom/3DDrawingChart.js
  2. 0 3
      downLoadServer/src/server/utils/chartsCom/BarChart.js
  3. 1 5
      downLoadServer/src/server/utils/chartsCom/BoxLineCharts.js
  4. 1 5
      downLoadServer/src/server/utils/chartsCom/BoxMarkersCharts.js
  5. 1 2
      downLoadServer/src/server/utils/chartsCom/GeneratorTemperature.js
  6. 1 2
      downLoadServer/src/server/utils/chartsCom/Time3DChart.js
  7. 3 3
      src/views/overview/components/analysis_information/index.vue
  8. 2 1
      src/views/overview/components/data_integrity_second/index.vue
  9. 2 2
      src/views/overview/components/pitch_power/index.vue
  10. 2 2
      src/views/overview/components/power_scatter/index.vue
  11. 4 4
      src/views/overview/components/speed_power/index.vue
  12. 3 3
      src/views/overview/components/speed_torque/index.vue
  13. 3 3
      src/views/overview/components/wind_direction_frequency/index.vue
  14. 2 2
      src/views/overview/components/wind_speed_frequency/index.vue
  15. 6 6
      src/views/overview/index.vue
  16. 92 2
      src/views/performance/components/PlotlyCharts.vue
  17. 42 3
      src/views/performance/components/chartsCom/Time3DChart.vue
  18. 40 2
      src/views/performance/components/chartsCom/TwoDMarkersChart.vue
  19. 42 2
      src/views/performance/components/chartsCom/TwoDMarkersChart1.vue
  20. 39 1
      src/views/performance/components/chartsCom/WindRoseChart.vue
  21. 45 1
      src/views/performance/components/chartsCom/YewErrorBarChart.vue
  22. 44 0
      src/views/performance/components/chartsCom/yawErrorBarSum.vue
  23. 45 1
      src/views/performance/components/chartsCom/yawErrorLine.vue

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

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2025-04-14 16:09:13
- * @LastEditTime: 2025-07-09 15:34:27
+ * @LastEditTime: 2025-07-10 14:00:17
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /downLoadServer/src/server/utils/chartsCom/3DDrawingChart.js
@@ -121,7 +121,6 @@ export const generate3DDrawingChart = async (data, bucketName, objectName) => {
               text: data.zaixs,
             },
           },
-
           aspectratio: {
             x: 2.0000000000000018,
             y: 1.5454545454545465,
@@ -189,7 +188,6 @@ export const generate3DDrawingChart = async (data, bucketName, objectName) => {
         </body>
         </html>
         `;
-      // ... existing code ...
       // 设置页面内容
       await page.setContent(htmlContent, {
         waitUntil: "networkidle0",

+ 0 - 3
downLoadServer/src/server/utils/chartsCom/BarChart.js

@@ -12,9 +12,6 @@ import axios from "axios";
  */
 export const generateBarChart = async (data, bucketName, objectName) => {
   try {
-    // console.log("开始生成图表...");
-    // console.log("数据:", data);
-
     // 创建临时目录
     const tempDir = path.join(process.cwd(), "images");
     await fs.ensureDir(tempDir);

+ 1 - 5
downLoadServer/src/server/utils/chartsCom/BoxLineCharts.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2025-05-12 17:40:10
- * @LastEditTime: 2025-07-10 13:51:46
+ * @LastEditTime: 2025-07-10 13:57:37
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /downLoadServer/src/server/utils/chartsCom/BoxLineCharts.js
@@ -18,7 +18,6 @@ import axios from "axios";
  * @param {Object} data - 图表数据
  * @returns {Promise<String>} - 返回图片URL
  */
-// ... existing code ...
 
 export const generateBoxLineChart = async (data, bucketName, objectName) => {
   try {
@@ -87,7 +86,6 @@ export const generateBoxLineChart = async (data, bucketName, objectName) => {
           type: "scatter",
         };
       }
-
       // 准备布局配置
       const layout = {
         title: {
@@ -234,5 +232,3 @@ const isInDateRange = (timestamp) => {
   const date = new Date(timestamp);
   return date >= new Date(startDate) && date <= new Date(endDate);
 };
-
-// ... existing code ...

+ 1 - 5
downLoadServer/src/server/utils/chartsCom/BoxMarkersCharts.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2025-05-13 11:02:32
- * @LastEditTime: 2025-06-18 15:26:39
+ * @LastEditTime: 2025-07-10 13:59:24
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /downLoadServer/src/server/utils/chartsCom/BoxMarkersCharts.js
@@ -13,7 +13,6 @@ import FormData from "form-data";
 import { colorSchemes } from "../colors.js";
 import axios from "axios";
 
-// ... existing code ...
 // 判断时间戳是否在选择的日期范围内
 const isInDateRange = (timestamp) => {
   const [startDate, endDate] = [];
@@ -51,9 +50,6 @@ const filterData = (group) => {
 };
 
 // 绘制箱线图
-// ... existing code ...
-
-// 绘制箱线图
 export const generateBoxMarkersCharts = async (
   data,
   bucketName,

+ 1 - 2
downLoadServer/src/server/utils/chartsCom/GeneratorTemperature.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2025-05-13 14:33:50
- * @LastEditTime: 2025-07-09 14:30:52
+ * @LastEditTime: 2025-07-10 13:59:10
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /downLoadServer/src/server/utils/chartsCom/GeneratorTemperature.js
@@ -12,7 +12,6 @@ import path from "path";
 import FormData from "form-data";
 import { colorSchemes } from "../colors.js";
 import axios from "axios";
-// ... existing code ...
 
 export const generateGeneratorTemperature = async (
   data,

+ 1 - 2
downLoadServer/src/server/utils/chartsCom/Time3DChart.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2025-04-14 17:49:33
- * @LastEditTime: 2025-07-09 15:35:16
+ * @LastEditTime: 2025-07-10 13:58:59
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/downLoadServer/src/server/utils/chartsCom/Time3DChart.js
@@ -204,7 +204,6 @@ export const generateTime3DChart = async (data, bucketName, objectName) => {
         </body>
         </html>
         `;
-      // ... existing code ...
       // 设置页面内容
       await page.setContent(htmlContent, {
         waitUntil: "networkidle0",

+ 3 - 3
src/views/overview/components/analysis_information/index.vue

@@ -228,9 +228,9 @@ export default {
     },
   },
   mounted() {
-    if (this.$route.query.batchCode) {
-      this.initBatchCode = this.$route.query.batchCode;
-    }
+    // if (this.$route.query.batchCode) {
+    //   this.initBatchCode = this.$route.query.batchCode;
+    // }
     if (this.$route.query.fieldCode) {
       this.fieldInfo.fieldCode = this.$route.query.fieldCode;
     }

+ 2 - 1
src/views/overview/components/data_integrity_second/index.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2025-01-09 17:55:01
- * @LastEditTime: 2025-04-11 16:48:29
+ * @LastEditTime: 2025-07-10 14:41:14
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/overview/data_integrity_second/index.vue
@@ -43,6 +43,7 @@
         <div v-for="(item, index) in generalFilesDatas">
           <HeatmapCharts
             :key="`${new Date().getTime()}` + item.batchCode + index"
+            :inds="`${new Date().getTime()}` + item.batchCode + index"
             :index="`${new Date().getTime()}` + item.batchCode + index"
             :ref="`${new Date().getTime()}` + item.batchCode"
             :fileAddr="item.fileAddr"

+ 2 - 2
src/views/overview/components/pitch_power/index.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2025-01-09 18:09:41
- * @LastEditTime: 2025-07-07 10:12:47
+ * @LastEditTime: 2025-07-10 14:57:20
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/overview/components/pitch_power/index.vue
@@ -57,7 +57,7 @@
           :setUpImgData="setUpImgData"
           v-if="getFileTypeFromUrl(item.fileAddr) === '3D'"
           :key="item.fieldEngineCode + 'Time3DChart'"
-          :index="index + 'fen'"
+          :index="`${new Date().getTime()}` + index + 'fen'"
           :ref="item.fieldEngineCode + 'Time3DChart'"
           :fileAddr="item.fileAddr"
         >

+ 2 - 2
src/views/overview/components/power_scatter/index.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2025-01-09 18:10:22
- * @LastEditTime: 2025-04-11 16:50:14
+ * @LastEditTime: 2025-07-10 14:55:37
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/overview/components/power_scatter/index.vue
@@ -42,7 +42,7 @@
         <Time3DChart
           :setUpImgData="setUpImgData"
           :key="item.fieldEngineCode"
-          :index="index + 'fen'"
+          :index="`${new Date().getTime()}` + index + 'fen'"
           :ref="item.fieldEngineCode"
           :fileAddr="item.fileAddr"
         >

+ 4 - 4
src/views/overview/components/speed_power/index.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2025-01-10 09:09:17
- * @LastEditTime: 2025-04-11 16:52:16
+ * @LastEditTime: 2025-07-10 15:00:05
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/overview/components/speed_power/index.vue
@@ -45,7 +45,7 @@
           v-if="item.batchCode && !item.fieldEngineCode"
           :setUpImgData="setUpImgData"
           :key="item.batchCode + index"
-          :index="index + 'zong'"
+          :index="`${new Date().getTime()}` + index + 'zong'"
           :ref="item.batchCode + index"
           :fileAddr="item.fileAddr"
         >
@@ -55,7 +55,7 @@
             item.fieldEngineCode &&
             getFileTypeFromUrl(item.fileAddr) === 'speed_power'
           "
-          :index="index + 'powerMarkers2DCharts'"
+          :index="`${new Date().getTime()}` + index + 'powerMarkers2DCharts'"
           :setUpImgData="setUpImgData"
           :key="item.fieldEngineCode + 'powerMarkers2DCharts'"
           :ref="item.fieldEngineCode"
@@ -68,7 +68,7 @@
           "
           :setUpImgData="setUpImgData"
           :key="item.fieldEngineCode + 'Time3DChart'"
-          :index="index + 'fen'"
+          :index="`${new Date().getTime()}` + index + 'fen'"
           :ref="item.fieldEngineCode + 'Time3DChart'"
           :fileAddr="item.fileAddr"
         >

+ 3 - 3
src/views/overview/components/speed_torque/index.vue

@@ -36,7 +36,7 @@
           v-if="item.batchCode && !item.fieldEngineCode"
           :setUpImgData="setUpImgData"
           :key="item.batchCode + index"
-          :index="index + 'zong'"
+          :index="`${new Date().getTime()}` + index + 'zong'"
           :ref="item.batchCode + index"
           :fileAddr="item.fileAddr"
         >
@@ -47,7 +47,7 @@
             item.fieldEngineCode &&
             getFileTypeFromUrl(item.fileAddr) === 'speed_torque'
           "
-          :index="index + 'powerMarkers2DCharts'"
+          :index="`${new Date().getTime()}` + index + 'powerMarkers2DCharts'"
           :key="item.fieldEngineCode + 'powerMarkers2DCharts'"
           :ref="item.fieldEngineCode"
           :fileAddr="item.fileAddr"
@@ -58,7 +58,7 @@
             item.fieldEngineCode && getFileTypeFromUrl(item.fileAddr) === '3D'
           "
           :key="item.fieldEngineCode + 'Time3DChart'"
-          :index="index + 'fen'"
+          :index="`${new Date().getTime()}` + index + 'fen'"
           :ref="item.fieldEngineCode + 'Time3DChart'"
           :fileAddr="item.fileAddr"
         >

+ 3 - 3
src/views/overview/components/wind_direction_frequency/index.vue

@@ -1,8 +1,8 @@
 <!--
  * @Author: your name
  * @Date: 2025-01-10 09:11:12
- * @LastEditTime: 2025-07-02 14:36:23
- * @LastEditors: milo-MacBook-Pro.local
+ * @LastEditTime: 2025-07-10 15:06:53
+ * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/overview/components/wind_direction_frequency/index.vue
 -->
@@ -65,7 +65,7 @@
               <WindRoseChart
                 :setUpImgData="setUpImgData"
                 :key="item.fieldEngineCode + itemind"
-                :inds="itemind"
+                :inds="`${new Date().getTime()}` + itemind"
                 :ref="item.fieldEngineCode"
                 :fileAddr="item.fileAddr"
               ></WindRoseChart>

+ 2 - 2
src/views/overview/components/wind_speed_frequency/index.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2025-01-10 09:11:34
- * @LastEditTime: 2025-07-04 16:23:04
+ * @LastEditTime: 2025-07-10 15:07:29
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/overview/components/wind_speed_frequency/index.vue
@@ -42,7 +42,7 @@
         <BarChart
           :setUpImgData="setUpImgData"
           :key="item.fieldEngineCode + index"
-          :inds="index + 'barChart'"
+          :inds="`${new Date().getTime()}` + index + 'barChart'"
           :ref="item.fieldEngineCode"
           :fileAddr="item.fileAddr"
         ></BarChart>

+ 6 - 6
src/views/overview/index.vue

@@ -217,12 +217,12 @@ export default {
     await Promise.all([this.getTreeData(), this.queryAllAnalysisType()]);
     // 初始化逻辑
   },
-  // mounted() {
-  //   if (this.$route.query.batchCode) {
-  //     this.initBatchCode = this.$route.query.batchCode;
-  //     // this.expandedKeys.push(formattedData[0]?.children[0]?.codeNumber);
-  //   }
-  // },
+  mounted() {
+    if (this.$route.query.batchCode) {
+      this.initBatchCode = this.$route.query.batchCode;
+      // this.expandedKeys.push(formattedData[0]?.children[0]?.codeNumber);
+    }
+  },
 
   methods: {
     setIsShow() {

+ 92 - 2
src/views/performance/components/PlotlyCharts.vue

@@ -257,7 +257,52 @@ export default {
       }
 
       // 绘制图表
-      Plotly.newPlot(`power-curve-plot${this.inds}`, data, layout);
+      Plotly.newPlot(`power-curve-plot${this.inds}`, data, layout, {
+        modeBarButtonsToRemove: [
+          "lasso2d", // 移除不需要的工具按钮
+          // 移除不需要的工具按钮
+          "lasso2d",
+          "sendDataToCloud",
+          "resetCameraLastSave3d",
+          "resetCameraDefault3d",
+          "resetCameraLastSave",
+          "sendDataToCloud",
+          "zoom2d", // 缩放按钮
+          "zoom3d",
+          "plotlylogo2D",
+          "plotlylogo3D",
+        ],
+        displaylogo: false,
+      }).then(function (gd) {
+        // 获取工具栏按钮
+        const toolbar = gd.querySelector(".modebar");
+        const buttons = toolbar.querySelectorAll(".modebar-btn");
+
+        // 定义一个映射对象,方便修改按钮提示
+        const titleMap = {
+          "Download plot as a png": "保存图片",
+          Autoscale: "缩放",
+          Pan: "平移",
+          "Zoom out": "放大",
+          "Zoom in": "缩小",
+          "Box Select": "选择框操作",
+          "Lasso Select": "套索选择操作",
+          "Reset axes": "重置操作",
+          "Reset camera to default": "重置相机视角",
+          "Turntable rotation": "转台式旋转",
+          "Orbital rotation": "轨道式旋转",
+        };
+
+        // 遍历所有按钮,修改它们的 title
+        buttons.forEach(function (button) {
+          const dataTitle = button.getAttribute("data-title");
+
+          // 如果标题匹配,修改属性值
+          if (titleMap[dataTitle]) {
+            button.setAttribute("data-title", titleMap[dataTitle]);
+          }
+        });
+      });
     },
 
     //初始化分图
@@ -351,7 +396,52 @@ export default {
             `风速: %{x} m/s<br>合同功率: %{y} kW<br>` +
             `${this.powerCurveData.contractPowerCurve[0].enginName}<extra></extra>`, // 设置 hovertemplate
         });
-        Plotly.newPlot(`chart-${this.inds}`, data, layout);
+        Plotly.newPlot(`chart-${this.inds}`, data, layout, {
+          modeBarButtonsToRemove: [
+            "lasso2d", // 移除不需要的工具按钮
+            // 移除不需要的工具按钮
+            "lasso2d",
+            "sendDataToCloud",
+            "resetCameraLastSave3d",
+            "resetCameraDefault3d",
+            "resetCameraLastSave",
+            "sendDataToCloud",
+            "zoom2d", // 缩放按钮
+            "zoom3d",
+            "plotlylogo2D",
+            "plotlylogo3D",
+          ],
+          displaylogo: false,
+        }).then(function (gd) {
+          // 获取工具栏按钮
+          const toolbar = gd.querySelector(".modebar");
+          const buttons = toolbar.querySelectorAll(".modebar-btn");
+
+          // 定义一个映射对象,方便修改按钮提示
+          const titleMap = {
+            "Download plot as a png": "保存图片",
+            Autoscale: "缩放",
+            Pan: "平移",
+            "Zoom out": "放大",
+            "Zoom in": "缩小",
+            "Box Select": "选择框操作",
+            "Lasso Select": "套索选择操作",
+            "Reset axes": "重置操作",
+            "Reset camera to default": "重置相机视角",
+            "Turntable rotation": "转台式旋转",
+            "Orbital rotation": "轨道式旋转",
+          };
+
+          // 遍历所有按钮,修改它们的 title
+          buttons.forEach(function (button) {
+            const dataTitle = button.getAttribute("data-title");
+
+            // 如果标题匹配,修改属性值
+            if (titleMap[dataTitle]) {
+              button.setAttribute("data-title", titleMap[dataTitle]);
+            }
+          });
+        });
       }
     },
     // 切换图表类型

+ 42 - 3
src/views/performance/components/chartsCom/Time3DChart.vue

@@ -344,11 +344,16 @@ export default {
         ],
         modeBarButtonsToRemove: [
           "sendDataToCloud",
-          // "autoScale2d",
-          "hoverClosest3d",
           "resetCameraLastSave3d",
           "resetCameraDefault3d",
+          "resetCameraLastSave",
+          "sendDataToCloud",
+          "zoom2d", // 缩放按钮
+          "zoom3d",
+          "plotlylogo2D",
+          "plotlylogo3D",
         ],
+        responsive: true,
         displaylogo: false, // 可选:隐藏 Plotly logo
       };
       // 获取x轴和y轴的设置
@@ -371,7 +376,41 @@ export default {
         layout.scene.zaxis.dtick = zChartSetUp.dtick;
         layout.scene.zaxis.range = [zChartSetUp.min, zChartSetUp.max];
       }
-      Plotly.newPlot(`plotly-3d-chart-` + this.index, traces, layout, config);
+      Plotly.newPlot(
+        `plotly-3d-chart-` + this.index,
+        traces,
+        layout,
+        config
+      ).then(function (gd) {
+        // 获取工具栏按钮
+        const toolbar = gd.querySelector(".modebar");
+        const buttons = toolbar.querySelectorAll(".modebar-btn");
+
+        // 定义一个映射对象,方便修改按钮提示
+        const titleMap = {
+          "Download plot as a png": "保存图片",
+          Autoscale: "缩放",
+          Pan: "平移",
+          "Zoom out": "放大",
+          "Zoom in": "缩小",
+          "Box Select": "选择框操作",
+          "Lasso Select": "套索选择操作",
+          "Reset axes": "重置操作",
+          "Reset camera to default": "重置相机视角",
+          "Turntable rotation": "转台式旋转",
+          "Orbital rotation": "轨道式旋转",
+        };
+
+        // 遍历所有按钮,修改它们的 title
+        buttons.forEach(function (button) {
+          const dataTitle = button.getAttribute("data-title");
+
+          // 如果标题匹配,修改属性值
+          if (titleMap[dataTitle]) {
+            button.setAttribute("data-title", titleMap[dataTitle]);
+          }
+        });
+      });
       // 监听图表的 relayout 事件,获取并输出相机视角
       const plotElement = document.getElementById(
         `plotly-3d-chart-` + this.index

+ 40 - 2
src/views/performance/components/chartsCom/TwoDMarkersChart.vue

@@ -338,7 +338,6 @@ export default {
           showbackground: true, // 显示背景
         },
         showlegend: false,
-        // showlegend: true,
         plot_bgcolor: "#e5ecf6",
         gridcolor: "#fff", // 设置网格线颜色
       };
@@ -383,8 +382,18 @@ export default {
           },
         ],
         modeBarButtonsToRemove: [
+          "lasso2d", // 移除不需要的工具按钮
           // 移除不需要的工具按钮
           "lasso2d",
+          "sendDataToCloud",
+          "resetCameraLastSave3d",
+          "resetCameraDefault3d",
+          "resetCameraLastSave",
+          "sendDataToCloud",
+          "zoom2d", // 缩放按钮
+          "zoom3d",
+          "plotlylogo2D",
+          "plotlylogo3D",
         ],
         displaylogo: false,
         editable: true,
@@ -400,7 +409,36 @@ export default {
         ).then(() => {
           // 确保在图表加载完成后设置工具栏按钮
           const plotElement = this.$refs[`plotlyChart-${this.index}`];
-          Plotly.relayout(plotElement, layout); // 使用 relayout 来确保自定义按钮应用
+          Plotly.relayout(plotElement, layout).then(function (gd) {
+            // 获取工具栏按钮
+            const toolbar = gd.querySelector(".modebar");
+            const buttons = toolbar.querySelectorAll(".modebar-btn");
+
+            // 定义一个映射对象,方便修改按钮提示
+            const titleMap = {
+              "Download plot as a png": "保存图片",
+              Autoscale: "缩放",
+              Pan: "平移",
+              "Zoom out": "放大",
+              "Zoom in": "缩小",
+              "Box Select": "选择框操作",
+              "Lasso Select": "套索选择操作",
+              "Reset axes": "重置操作",
+              "Reset camera to default": "重置相机视角",
+              "Turntable rotation": "转台式旋转",
+              "Orbital rotation": "轨道式旋转",
+            };
+
+            // 遍历所有按钮,修改它们的 title
+            buttons.forEach(function (button) {
+              const dataTitle = button.getAttribute("data-title");
+
+              // 如果标题匹配,修改属性值
+              if (titleMap[dataTitle]) {
+                button.setAttribute("data-title", titleMap[dataTitle]);
+              }
+            });
+          }); // 使用 relayout 来确保自定义按钮应用
         });
       });
     },

+ 42 - 2
src/views/performance/components/chartsCom/TwoDMarkersChart1.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2024-09-11 14:32:12
- * @LastEditTime: 2025-07-08 10:13:08
+ * @LastEditTime: 2025-07-10 14:07:08
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/chartsCom/powerMarkers2DCharts.vue
@@ -350,6 +350,17 @@ export default {
         ],
         modeBarButtonsToRemove: [
           "lasso2d", // 移除不需要的工具按钮
+          // 移除不需要的工具按钮
+          "lasso2d",
+          "sendDataToCloud",
+          "resetCameraLastSave3d",
+          "resetCameraDefault3d",
+          "resetCameraLastSave",
+          "sendDataToCloud",
+          "zoom2d", // 缩放按钮
+          "zoom3d",
+          "plotlylogo2D",
+          "plotlylogo3D",
         ],
         displaylogo: false,
         editable: true,
@@ -370,7 +381,36 @@ export default {
         ).then(() => {
           // 确保图表加载完成后设置工具栏按钮
           const plotElement = this.$refs[`plotlyChart-${this.index}`];
-          Plotly.relayout(plotElement, layout); // 使用 relayout 来确保自定义按钮应用
+          Plotly.relayout(plotElement, layout).then(function (gd) {
+            // 获取工具栏按钮
+            const toolbar = gd.querySelector(".modebar");
+            const buttons = toolbar.querySelectorAll(".modebar-btn");
+
+            // 定义一个映射对象,方便修改按钮提示
+            const titleMap = {
+              "Download plot as a png": "保存图片",
+              Autoscale: "缩放",
+              Pan: "平移",
+              "Zoom out": "放大",
+              "Zoom in": "缩小",
+              "Box Select": "选择框操作",
+              "Lasso Select": "套索选择操作",
+              "Reset axes": "重置操作",
+              "Reset camera to default": "重置相机视角",
+              "Turntable rotation": "转台式旋转",
+              "Orbital rotation": "轨道式旋转",
+            };
+
+            // 遍历所有按钮,修改它们的 title
+            buttons.forEach(function (button) {
+              const dataTitle = button.getAttribute("data-title");
+
+              // 如果标题匹配,修改属性值
+              if (titleMap[dataTitle]) {
+                button.setAttribute("data-title", titleMap[dataTitle]);
+              }
+            });
+          }); // 使用 relayout 来确保自定义按钮应用
         });
       });
     },

+ 39 - 1
src/views/performance/components/chartsCom/WindRoseChart.vue

@@ -184,7 +184,45 @@ export default {
         legend: { title: { text: axes.levelname } },
       };
 
-      Plotly.newPlot(`plotDiv-${this.inds}`, traces, layout);
+      Plotly.newPlot(`plotDiv-${this.inds}`, traces, layout, {
+        modeBarButtonsToRemove: [
+          // 移除不需要的工具按钮
+          "select2d", // 对应 "Box Select"
+          "lasso2d", // 对应 "Lasso Select"
+          "zoom2d", // 缩放按钮
+        ],
+        displaylogo: false,
+        responsive: true,
+      }).then(function (gd) {
+        // 获取工具栏按钮
+        const toolbar = gd.querySelector(".modebar");
+        const buttons = toolbar.querySelectorAll(".modebar-btn");
+
+        // 定义一个映射对象,方便修改按钮提示
+        const titleMap = {
+          "Download plot as a png": "保存图片",
+          Autoscale: "缩放",
+          Pan: "平移",
+          "Zoom out": "放大",
+          "Zoom in": "缩小",
+          "Box Select": "选择框操作",
+          "Lasso Select": "套索选择操作",
+          "Reset axes": "重置操作",
+          "Reset camera to default": "重置相机视角",
+          "Turntable rotation": "转台式旋转",
+          "Orbital rotation": "轨道式旋转",
+        };
+
+        // 遍历所有按钮,修改它们的 title
+        buttons.forEach(function (button) {
+          const dataTitle = button.getAttribute("data-title");
+
+          // 如果标题匹配,修改属性值
+          if (titleMap[dataTitle]) {
+            button.setAttribute("data-title", titleMap[dataTitle]);
+          }
+        });
+      });
     },
   },
 };

+ 45 - 1
src/views/performance/components/chartsCom/YewErrorBarChart.vue

@@ -210,8 +210,52 @@ export default {
         layout,
         {
           responsive: true,
+          modeBarButtonsToRemove: [
+            "lasso2d", // 移除不需要的工具按钮
+            // 移除不需要的工具按钮
+            "lasso2d",
+            "sendDataToCloud",
+            "resetCameraLastSave3d",
+            "resetCameraDefault3d",
+            "resetCameraLastSave",
+            "sendDataToCloud",
+            "zoom2d", // 缩放按钮
+            "zoom3d",
+            "plotlylogo2D",
+            "plotlylogo3D",
+          ],
+          displaylogo: false,
         }
-      );
+      ).then(function (gd) {
+        // 获取工具栏按钮
+        const toolbar = gd.querySelector(".modebar");
+        const buttons = toolbar.querySelectorAll(".modebar-btn");
+
+        // 定义一个映射对象,方便修改按钮提示
+        const titleMap = {
+          "Download plot as a png": "保存图片",
+          Autoscale: "缩放",
+          Pan: "平移",
+          "Zoom out": "放大",
+          "Zoom in": "缩小",
+          "Box Select": "选择框操作",
+          "Lasso Select": "套索选择操作",
+          "Reset axes": "重置操作",
+          "Reset camera to default": "重置相机视角",
+          "Turntable rotation": "转台式旋转",
+          "Orbital rotation": "轨道式旋转",
+        };
+
+        // 遍历所有按钮,修改它们的 title
+        buttons.forEach(function (button) {
+          const dataTitle = button.getAttribute("data-title");
+
+          // 如果标题匹配,修改属性值
+          if (titleMap[dataTitle]) {
+            button.setAttribute("data-title", titleMap[dataTitle]);
+          }
+        });
+      });
     },
     // 切换图表类型
     toggleChartType() {

+ 44 - 0
src/views/performance/components/chartsCom/yawErrorBarSum.vue

@@ -157,6 +157,50 @@ export default {
       // 渲染图表
       Plotly.newPlot(`bar-chart-sums` + this.index, [trace], layout, {
         responsive: true,
+        displaylogo: false,
+        modeBarButtonsToRemove: [
+          "lasso2d", // 移除不需要的工具按钮
+          // 移除不需要的工具按钮
+          "lasso2d",
+          "sendDataToCloud",
+          "resetCameraLastSave3d",
+          "resetCameraDefault3d",
+          "resetCameraLastSave",
+          "sendDataToCloud",
+          "zoom2d", // 缩放按钮
+          "zoom3d",
+          "plotlylogo2D",
+          "plotlylogo3D",
+        ],
+      }).then(function (gd) {
+        // 获取工具栏按钮
+        const toolbar = gd.querySelector(".modebar");
+        const buttons = toolbar.querySelectorAll(".modebar-btn");
+
+        // 定义一个映射对象,方便修改按钮提示
+        const titleMap = {
+          "Download plot as a png": "保存图片",
+          Autoscale: "缩放",
+          Pan: "平移",
+          "Zoom out": "放大",
+          "Zoom in": "缩小",
+          "Box Select": "选择框操作",
+          "Lasso Select": "套索选择操作",
+          "Reset axes": "重置操作",
+          "Reset camera to default": "重置相机视角",
+          "Turntable rotation": "转台式旋转",
+          "Orbital rotation": "轨道式旋转",
+        };
+
+        // 遍历所有按钮,修改它们的 title
+        buttons.forEach(function (button) {
+          const dataTitle = button.getAttribute("data-title");
+
+          // 如果标题匹配,修改属性值
+          if (titleMap[dataTitle]) {
+            button.setAttribute("data-title", titleMap[dataTitle]);
+          }
+        });
       });
     },
     // 切换图表类型

+ 45 - 1
src/views/performance/components/chartsCom/yawErrorLine.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2025-01-22 09:42:59
- * @LastEditTime: 2025-06-11 10:55:18
+ * @LastEditTime: 2025-07-10 14:10:26
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/chartsCom/yawErrorLine.vue
@@ -235,6 +235,50 @@ export default {
       // 使用 Plotly.react 来更新图表
       Plotly.react(`bar-chart${this.index}`, data, layout, {
         responsive: true,
+        modeBarButtonsToRemove: [
+          "lasso2d", // 移除不需要的工具按钮
+          // 移除不需要的工具按钮
+          "lasso2d",
+          "sendDataToCloud",
+          "resetCameraLastSave3d",
+          "resetCameraDefault3d",
+          "resetCameraLastSave",
+          "sendDataToCloud",
+          "zoom2d", // 缩放按钮
+          "zoom3d",
+          "plotlylogo2D",
+          "plotlylogo3D",
+        ],
+        displaylogo: false,
+      }).then(function (gd) {
+        // 获取工具栏按钮
+        const toolbar = gd.querySelector(".modebar");
+        const buttons = toolbar.querySelectorAll(".modebar-btn");
+
+        // 定义一个映射对象,方便修改按钮提示
+        const titleMap = {
+          "Download plot as a png": "保存图片",
+          Autoscale: "缩放",
+          Pan: "平移",
+          "Zoom out": "放大",
+          "Zoom in": "缩小",
+          "Box Select": "选择框操作",
+          "Lasso Select": "套索选择操作",
+          "Reset axes": "重置操作",
+          "Reset camera to default": "重置相机视角",
+          "Turntable rotation": "转台式旋转",
+          "Orbital rotation": "轨道式旋转",
+        };
+
+        // 遍历所有按钮,修改它们的 title
+        buttons.forEach(function (button) {
+          const dataTitle = button.getAttribute("data-title");
+
+          // 如果标题匹配,修改属性值
+          if (titleMap[dataTitle]) {
+            button.setAttribute("data-title", titleMap[dataTitle]);
+          }
+        });
       });
     },