Forráskód Böngészése

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

liujiejie 1 hete
szülő
commit
8295fe29d5

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

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2025-04-14 16:09:13
- * @LastEditTime: 2025-07-10 14:00:17
+ * @LastEditTime: 2025-07-14 15:00:16
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /downLoadServer/src/server/utils/chartsCom/3DDrawingChart.js
@@ -92,6 +92,7 @@ export const generate3DDrawingChart = async (data, bucketName, objectName) => {
           },
           yaxis: {
             type: "category",
+            nticks: 3,
             categoryorder: "array", // 自定义顺序,确保间隔均匀
             categoryarray: [...new Set(chartDataset.yData)],
             gridcolor: "rgb(255,255,255)",
@@ -117,6 +118,7 @@ export const generate3DDrawingChart = async (data, bucketName, objectName) => {
             ticks: "outside", // 设置刻度线在轴线外
             tickcolor: "black",
             tickangle: -90,
+            nticks: 3,
             title: {
               text: data.zaixs,
             },

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

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2025-04-14 17:49:33
- * @LastEditTime: 2025-07-10 13:58:59
+ * @LastEditTime: 2025-07-14 16:04:07
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/downLoadServer/src/server/utils/chartsCom/Time3DChart.js
@@ -108,7 +108,8 @@ export const generateTime3DChart = async (data, bucketName, objectName) => {
             categoryorder: "category ascending", // 按类别字母顺序排列
             type: "date",
             tickformat: "%Y-%m",
-            dtick: "M3",
+            // dtick: "M3",//显式设置每3个月一个刻度
+            nticks: 3,
             gridcolor: "#fff",
             tickcolor: "#e5ecf6",
             backgroundcolor: "#e0e7f1",
@@ -117,7 +118,7 @@ export const generateTime3DChart = async (data, bucketName, objectName) => {
             ticks: "outside",
             tickcolor: "black",
             zeroline: false,
-            // tickangle: 25,
+            tickangle: 25,
             title: {
               text: data.yaixs,
             },
@@ -131,7 +132,8 @@ export const generateTime3DChart = async (data, bucketName, objectName) => {
             ticks: "outside",
             tickcolor: "black",
             zeroline: false,
-            // tickangle: -90,
+            nticks: 3,
+            tickangle: -90,
             title: {
               text: data.zaixs,
             },

+ 3 - 3
src/store/themes.js

@@ -3,7 +3,7 @@ import { theme } from "tailwindcss/stubs/defaultConfig.stub";
 /*
  * @Author: your name
  * @Date: 2024-05-27 15:09:27
- * @LastEditTime: 2025-07-07 10:58:57
+ * @LastEditTime: 2025-07-14 10:23:56
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/store/themes.js
@@ -12,8 +12,8 @@ import { colorSchemes } from "@/views/overview/js/colors";
 export default {
   namespaced: true,
   state: {
-    theme: localStorage.getItem("theme") || "green",
-    // theme: localStorage.getItem("theme") || "blue", //华电默认主题色
+    // theme: localStorage.getItem("theme") || "green",
+    theme: localStorage.getItem("theme") || "blue", //华电默认主题色
     themeColor: [...colorSchemes[0].colors],
   },
   mutations: {

+ 1 - 1
src/views/home/Index.vue

@@ -52,7 +52,7 @@ export default {
   data() {
     return {
       loading: false,
-      isShowHd: false, //true 则展示华电的菜单样式,false 则展示默认的左侧边栏菜单
+      isShowHd: true, //true 则展示华电的菜单样式,false 则展示默认的左侧边栏菜单
     };
   },
   methods: {

+ 8 - 8
src/views/home/components/MenuHD.vue

@@ -408,16 +408,16 @@ export default {
 }
 
 // 非华电公司放开这个注释下面的
-.el-submenu__title * {
-  font-size: 16px;
-}
-.el-menu-item * {
-  font-size: 16px;
-}
+// .el-submenu__title * {
+//   font-size: 16px;
+// }
+// .el-menu-item * {
+//   font-size: 16px;
+// }
 </style>
 
 <!-- /* 华电时的菜单打开这个 */ -->
-<!-- <style lang="scss">
+<style lang="scss">
 .el-menu--popup {
   width: 100% !important;
   min-width: 120px !important;
@@ -434,4 +434,4 @@ export default {
 .el-menu-item * {
   font-size: 20px;
 }
-</style>  -->
+</style>

+ 2 - 2
src/views/login/Index.vue

@@ -2,9 +2,9 @@
   <div class="background-image" v-loading="loadingView">
     <div class="border">
       <div class="leftLogin">
-        <h1>机组功率曲线异常检测数据分析系统</h1>
+        <!-- <h1>机组功率曲线异常检测数据分析系统</h1> -->
         <!-- 华电 -->
-        <!-- <h1>风电机组健康诊断平台</h1> -->
+        <h1>风电机组健康诊断平台</h1>
         <el-divider></el-divider>
         <div class="loginText">
           <el-form

+ 3 - 16
src/views/performance/components/chartsCom/3DDrawingChart.vue

@@ -248,6 +248,7 @@ export default {
             ticks: "outside", // 设置刻度线在轴线外
             fixedrange: true, // 防止缩放
             // tickwidth: 2,
+
             tickcolor: "black",
             tickangle: -10,
             // range:
@@ -264,6 +265,7 @@ export default {
             categoryarray: [...new Set(this.chartData.data[0].yData)], // 以原始数据顺序排序
             tickvals: tickvals,
             ticktext: ticktext,
+            nticks: 3,
             gridcolor: "rgb(255,255,255)",
             tickcolor: "rgb(255,255,255)",
             backgroundcolor: "#e0e7f1",
@@ -282,6 +284,7 @@ export default {
             backgroundcolor: "#e0e7f1",
             showbackground: true,
             fixedrange: true, // 防止缩放
+            nticks: 3,
             // linewidth: 2, // 轴线宽度
             linecolor: "black", // 轴线颜色
             ticks: "outside", // 设置刻度线在轴线外
@@ -342,30 +345,14 @@ export default {
         responsive: true,
         modeBarButtonsToRemove: [
           "sendDataToCloud",
-          // "autoScale2d",
-          // "hoverClosest3d",
           "resetCameraLastSave3d",
           "resetCameraDefault3d",
           "resetCameraLastSave",
           "sendDataToCloud",
-          // "pan2d", // 平移按钮
           "zoom2d", // 缩放按钮
-          // "zoom",
           "zoom3d",
-          // "select2d", // 选择框
-          // "lasso2d", // 套索选择
-          // "resetScale2d", // 重置轴
-          // // "zoomIn", // 放大
-          // // "zoomOut", // 缩小
-          // "home", // 重置
-          // "toImage", // 导出为图片
-          // "hoverClosestCartesian", // 悬浮信息
-          // "zoomIn2d", // 缩放按钮(详细版本)
-          // "zoomOut2d", // 缩放按钮(详细版本)
-          // "autoScale2D",
           "plotlylogo2D",
           "plotlylogo3D",
-          // "Produced with Plotly.js(v2.35.2)", // 删除 Plotly logo
         ],
         displaylogo: false, // 可选:隐藏 Plotly logo
       };

+ 4 - 22
src/views/performance/components/chartsCom/Time3DChart.vue

@@ -220,7 +220,6 @@ export default {
               standoff: 100,
             },
             gridcolor: "#fff",
-            // backgroundcolor: "#CFD4DC",
             backgroundcolor: "#e0e7f1",
             showbackground: true,
             linecolor: "black",
@@ -229,6 +228,7 @@ export default {
             tickcolor: "black",
             zeroline: false,
             tickangle: -10,
+            // nticks: 5,
             dtick: this.chartData.xaixs === "风速(m/s)" ? 1 : undefined,
             // range:
             //   this.chartData.xaixs === "发电机转速(r/min)" ||
@@ -246,10 +246,9 @@ export default {
             categoryorder: "category ascending", // 按类别字母顺序排列
             type: "date",
             tickformat: "%Y-%m",
-            dtick: "M3",
+            // dtick: "M3",//显式设置每3个月一个刻度
             gridcolor: "#fff",
             tickcolor: "#e5ecf6",
-            // backgroundcolor: "#CFD4DC",
             backgroundcolor: "#e0e7f1",
             showbackground: true,
             linecolor: "black",
@@ -257,6 +256,7 @@ export default {
             tickcolor: "black",
             zeroline: false,
             tickangle: 25,
+            nticks: 3,
           },
           zaxis: {
             title: {
@@ -264,7 +264,6 @@ export default {
             },
             gridcolor: "#fff",
             tickcolor: "#fff",
-            // backgroundcolor: "#CFD4DC",
             backgroundcolor: "#e0e7f1",
             showbackground: true,
             linecolor: "black",
@@ -272,6 +271,7 @@ export default {
             tickcolor: "black",
             zeroline: false,
             tickangle: -90,
+            nticks: 3,
           },
           bgcolor: "#e5ecf6",
           aspectratio: {
@@ -301,24 +301,6 @@ export default {
               type: "orthographic",
             },
           },
-          // 添加 annotation 模拟 Y 轴标题
-          // annotations: [
-          //   {
-          //     x: -0.15, // 让标题靠左
-          //     y: 1, // 让标题在 Y 轴顶部
-          //     xref: "paper",
-          //     yref: "paper",
-          //     text: this.chartData.xaixs, // Y 轴标题
-          //     showarrow: false,
-          //     textangle: 90, // 旋转 90°
-          //     font: {
-          //       size: 16,
-          //       color: "black",
-          //     },
-          //     xanchor: "right",
-          //     yanchor: "top", // 避免重叠
-          //   },
-          // ],
         },
         margin: { t: 50, b: 50, l: 50, r: 50 },
         staticPlot: false,

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

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2024-09-11 14:32:12
- * @LastEditTime: 2025-07-14 10:03:35
+ * @LastEditTime: 2025-07-14 13:39:59
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/chartsCom/powerMarkers2DCharts.vue
@@ -267,6 +267,7 @@ export default {
             "%{y} <br>" +
             `时间: %{customdata}<extra></extra>`, // 在 hover 中显示格式化后的时间
           customdata: data.colorbar || data.color, // 将格式化后的时间存入 customdata
+          timedata: data.timeData,
         };
       }
       if (lineData) {
@@ -426,7 +427,7 @@ export default {
           x: xClick, // 点击点的 x 坐标
           y: yClick, // 点击点的 y 坐标
           index: pointIndex, // 点击点的索引
-          time: data.points[0].text, // 点击点的时间信息
+          time: data.points[0]?.data?.timedata[data.points[0].pointIndex], // 点击点的时间信息
         });
 
         // 初始化颜色和大小数组
@@ -472,7 +473,6 @@ export default {
             }
           });
         }
-
         // // 更新选中点的颜色和大小
         this.selectedPoints.forEach((point) => {
           newColors[point.index] = "red";

+ 14 - 33
src/views/performance/components/chartsCom/powerMarkers2DCharts.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2024-09-11 14:32:12
- * @LastEditTime: 2025-07-14 10:21:14
+ * @LastEditTime: 2025-07-14 13:49:33
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/chartsCom/powerMarkers2DCharts.vue
@@ -275,6 +275,7 @@ export default {
             "%{y} <br>" +
             `时间: %{customdata}<extra></extra>`, // 在 hover 中显示格式化后的时间
           customdata: data.colorbar || data.color, // 将格式化后的时间存入 customdata
+          timedata: data.timeData,
         };
       }
       if (lineData) {
@@ -430,13 +431,13 @@ export default {
         const pointIndex = data.points[0].pointIndex;
         const xClick = data.points[0].x;
         const yClick = data.points[0].y;
-        // console.log(data.points[0], "data.points[0]");
+
         // 将点击的点添加到选中的点数组
         this.selectedPoints.push({
           x: xClick, // 点击点的 x 坐标
           y: yClick, // 点击点的 y 坐标
           index: pointIndex, // 点击点的索引
-          time: data.points[0].timeData, // 点击点的时间信息
+          time: data.points[0]?.data?.timedata[data.points[0].pointIndex], // 点击点的时间信息
         });
 
         // 初始化颜色和大小数组
@@ -462,20 +463,17 @@ export default {
 
           // 用于跟踪已添加的 (x, y) 组合
           const addedPoints = {};
-
           // 遍历图表数据中的所有点,检查是否在多边形内
           gd.data[0].x.forEach((xVal, i) => {
             const yVal = gd.data[0].y[i];
             if (inPolygon(xVal, yVal, xv, yv)) {
               const pointKey = `${xVal}-${yVal}`;
               if (!addedPoints[pointKey]) {
-                // console.log(gd.data[0], "gd.data[0]");
                 this.selectedPoints.push({
                   x: gd.data[0].x[i],
                   y: gd.data[0].y[i],
-                  time: gd.data[0].text[i],
+                  time: gd.data[0].timedata[i],
                 });
-
                 newColors[i] = "red"; // 高亮选择的点
                 newSize[i] = 10; // 设置点的大小
                 addedPoints[pointKey] = true;
@@ -490,30 +488,6 @@ export default {
           newSize[point.index] = 10;
         });
 
-        // 使用 Plotly.restyle 更新颜色和大小
-        // Plotly.restyle(gd, {
-        //   "marker.color": [newColors],
-        //   "marker.size": [newSize],
-        // });
-
-        // // 确保选中的点在最上面
-        // const scatterTrace = gd.data[0]; // 原来的散点数据
-        // const selectedTrace = {
-        //   x: this.selectedPoints.map((p) => p.x),
-        //   y: this.selectedPoints.map((p) => p.y),
-        //   mode: "markers",
-        //   type: "scattergl",
-        //   marker: {
-        //     color: "red", // 选中点颜色
-        //     size: 10,
-        //   },
-        // };
-
-        // // 合并数据,并保证选中点在最后
-        // const updatedTraces = [scatterTrace, selectedTrace]; // 选中的点 `selectedTrace` 放在最后
-
-        // // 更新图表
-        // Plotly.react(gd, updatedTraces, gd.layout);
         Plotly.addTraces(gd, {
           x: this.selectedPoints.map((p) => p.x),
           y: this.selectedPoints.map((p) => p.y),
@@ -553,18 +527,25 @@ export default {
       const paramValueTypes = await axios.get("/ETLapi/sysConf/getByType", {
         params: { type: "en_cn_mapping" },
       });
-      // console.log(paramValueTypes, "paramValueTypes");
+      console.log(paramValueTypes, "paramValueTypes");
       const headers = [this.chartData.xaixs, this.chartData.yaixs];
       const csvRows = [headers]; // 保存标头
       // 使用 Set 或 Map 去重
       const uniquePoints = [];
-
       this.selectedPoints.forEach((point) => {
         if (!uniquePoints.some((p) => p.x === point.x && p.y === point.y)) {
           uniquePoints.push(point);
         }
       });
+      const newTimedata = uniquePoints.map((item) => item.time);
+      console.log(newTimedata, "newTimedata");
       console.log(uniquePoints, "uniquePoints");
+      await axios.post("/ETLapi/dataTransfer/getWindTurbineAndTimestamps", {
+        timestamps: [...newTimedata],
+        transferType: "", //分析数据源类型
+        windFarmCode: "", //风场编号
+        windTurbineNumber: "", //风机编号
+      });
       // // 将去重后的点加入 CSV 数据
       // uniquePoints.forEach((point) => {
       //   csvRows.push(`${point.x},${point.y}`);