Parcourir la source

修分析图表

liujiejie il y a 1 mois
Parent
commit
b515a62ec8

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

@@ -210,7 +210,7 @@ export default {
       });
     },
     analysisTypeCode(newVal) {
-      console.log(newVal, "分析模型 ");
+      // console.log(newVal, "分析模型 ");
     },
   },
   async created() {

+ 1 - 24
src/views/overview/js/colors.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2025-02-17 15:31:57
- * @LastEditTime: 2025-03-20 14:31:16
+ * @LastEditTime: 2025-06-11 10:22:46
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/overview/js/colors.js
@@ -26,29 +26,6 @@ export const colorSchemes = [
       "#28357A",
       "#1A285E",
     ],
-    // colors: [
-    //   "#6FB99F", // 柔和的蓝绿色
-    //   "#5DA89E",
-    //   "#4C979E",
-    //   "#3B869D",
-    //   "#2D7492",
-    //   "#1F6286",
-
-    //   "#2C1B5E", // 深紫色过渡
-    //   "#27174E",
-    //   "#1F123D",
-    //   "#180C2D",
-    //   "#A76DA8", // 柔和的紫色过渡
-    //   "#95579B",
-    //   "#81408D",
-    //   "#6A297A",
-    //   "#541D67",
-    //   "#3E134E",
-    //   "#985B4A", // 深暖色调
-    //   "#874B3A",
-    //   "#763B2A",
-    //   "#652C1A",
-    // ],
   },
   {
     label: "复古",

+ 4 - 1
src/views/performance/components/PlotlyCharts.vue

@@ -123,7 +123,10 @@ export default {
     };
   },
   mounted() {
-    this.color1 = this.themeColor;
+    this.$nextTick(() => {
+      // this.color1 = this.themeColor;
+      this.color1 = this.colorSchemes[0].colors;
+    });
     this.updateCharts(this.setUpImgData); // 初次渲染
   },
   computed: {

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

@@ -81,9 +81,10 @@ export default {
   data() {
     return {
       color1: [], // 默认颜色
+      // 配色方案列表(每个方案是一个颜色数组)
+      colorSchemes: colorSchemes,
       chartData: {},
       chartType: "scatter", // 当前图表类型(默认是散点图)
-      colorSchemes: [...colorSchemes],
       pointSize: 1, // 默认点大小
     };
   },
@@ -97,7 +98,7 @@ export default {
     themeColor: {
       handler(newval) {
         if (newval.length === 0) {
-          this.color1 = colorSchemes[0].colors;
+          this.color1 = this.colorSchemes[0].colors;
         } else {
           this.color1 = newval;
         }
@@ -113,12 +114,10 @@ export default {
     },
   },
   async mounted() {
-    this.getData();
-    if (this.themeColor.length === 0) {
-      this.color1 = colorSchemes[0].colors;
-    } else {
-      this.color1 = this.themeColor;
-    }
+    this.$nextTick(() => {
+      this.color1 = this.colorSchemes[0].colors;
+      this.getData();
+    });
   },
   methods: {
     async getData() {
@@ -152,12 +151,10 @@ export default {
         }
       }
     },
-
     // 更新配色方案
     updateChartColor() {
       this.renderChart(); // 当配色方案或点大小发生变化时重新渲染图表
     },
-
     // 切换图表类型
     setChartType(type) {
       this.chartType = type;
@@ -180,7 +177,7 @@ export default {
     renderChart() {
       const uniqueColors = [...new Set(this.chartData.data[0].color)];
       if (!this.color1) {
-        this.color1 = colorSchemes[0].colors;
+        this.color1 = this.colorSchemes[0].colors;
       }
       const traces = uniqueColors.map((color, idx) => {
         const colorData = this.chartData.data[0].color.map((c) =>

+ 8 - 8
src/views/performance/components/chartsCom/ColorbarInitTwoDmarkersChart.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2025-03-14 10:30:00
- * @LastEditTime: 2025-04-28 14:08:16
+ * @LastEditTime: 2025-06-11 10:45:29
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/chartsCom/colorbarInitTwoDmarkersChart.vue
@@ -129,12 +129,13 @@ export default {
   },
   mixins: [myMixin],
   async mounted() {
-    this.getData();
-    if (this.themeColor.length === 0) {
-      this.color1 = colorSchemes[4].colors;
-    } else {
-      this.color1 = this.themeColor;
-    }
+    this.$nextTick(() => {
+      this.getData();
+      this.color1 = this.colorSchemes[4].colors;
+      // } else {
+      //   this.color1 = this.themeColor;
+      // }
+    });
   },
   methods: {
     // 根据配色方案设置每个选项的样式
@@ -208,7 +209,6 @@ export default {
           acc[curr] = index + 1;
           return acc;
         }, {});
-        console.log("timeMapping", timeMapping);
         // 获取 colorbar 的最小值和最大值来计算比例值
         const minValue = Math.min(...new Set(uniqueTimeLabels));
         const maxValue = Math.max(...new Set(uniqueTimeLabels));

+ 5 - 3
src/views/performance/components/chartsCom/GeneratorTemperature.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2025-01-21 11:18:49
- * @LastEditTime: 2025-03-13 17:10:32
+ * @LastEditTime: 2025-06-11 10:48:07
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/chartsCom/GeneratorTemperature.vue
@@ -116,8 +116,10 @@ export default {
   },
   mounted() {
     if (this.fileAddr) {
-      this.getData();
-      this.color1 = this.themeColor;
+      this.$nextTick(() => {
+        this.getData();
+        this.color1 = this.colorSchemes[0].colors;
+      });
     }
   },
   methods: {

+ 8 - 6
src/views/performance/components/chartsCom/HeatmapCharts.vue

@@ -70,12 +70,14 @@ export default {
   },
   mounted() {
     if (this.fileAddr) {
-      this.getData();
-      if (this.themeColor.length === 0) {
-        this.color1 = colorSchemes[0].colors;
-      } else {
-        this.color1 = this.themeColor;
-      }
+      this.$nextTick(() => {
+        this.getData();
+        // if (this.themeColor.length === 0) {
+        this.color1 = this.colorSchemes[0].colors;
+        // } else {
+        //   this.color1 = this.themeColor;
+        // }
+      });
     }
   },
 

+ 9 - 7
src/views/performance/components/chartsCom/Time3DChart.vue

@@ -92,7 +92,7 @@ export default {
     themeColor: {
       handler(newval) {
         if (newval.length === 0) {
-          this.color1 = colorSchemes[0].colors;
+          this.color1 = this.colorSchemes[0].colors;
         } else {
           this.color1 = newval;
         }
@@ -108,12 +108,14 @@ export default {
     },
   },
   async mounted() {
-    this.getData();
-    if (this.themeColor.length === 0) {
-      this.color1 = colorSchemes[0].colors;
-    } else {
-      this.color1 = this.themeColor;
-    }
+    this.$nextTick(() => {
+      this.getData();
+      // if (this.themeColor.length === 0) {
+      this.color1 = this.colorSchemes[0].colors;
+      // } else {
+      //   this.color1 = this.themeColor;
+      // }
+    });
   },
 
   methods: {

+ 9 - 7
src/views/performance/components/chartsCom/TwoDMarkersChart.vue

@@ -104,7 +104,7 @@ export default {
     themeColor: {
       handler(newval) {
         if (newval.length === 0) {
-          this.color1 = colorSchemes[0].colors;
+          this.color1 = this.colorSchemes[0].colors;
         } else {
           this.color1 = newval;
         }
@@ -121,12 +121,14 @@ export default {
   },
   mixins: [myMixin],
   async mounted() {
-    this.getData();
-    if (this.themeColor.length === 0) {
-      this.color1 = colorSchemes[0].colors;
-    } else {
-      this.color1 = this.themeColor;
-    }
+    this.$nextTick(() => {
+      this.getData();
+      // if (this.themeColor.length === 0) {
+      this.color1 = this.colorSchemes[0].colors;
+      // } else {
+      //   this.color1 = this.themeColor;
+      // }
+    });
   },
   methods: {
     // 根据配色方案设置每个选项的样式

+ 10 - 8
src/views/performance/components/chartsCom/TwoDMarkersChart1.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2024-09-11 14:32:12
- * @LastEditTime: 2025-06-11 09:19:56
+ * @LastEditTime: 2025-06-11 10:50:36
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/chartsCom/powerMarkers2DCharts.vue
@@ -108,7 +108,7 @@ export default {
     themeColor: {
       handler(newval) {
         if (newval.length === 0) {
-          this.color1 = colorSchemes[5].colors;
+          this.color1 = this.colorSchemes[5].colors;
         } else {
           this.color1 = newval;
         }
@@ -124,12 +124,14 @@ export default {
     },
   },
   async mounted() {
-    this.getData();
-    if (this.themeColor.length === 0) {
-      this.color1 = colorSchemes[5].colors;
-    } else {
-      this.color1 = this.themeColor;
-    }
+    this.$nextTick(() => {
+      this.getData();
+      // if (this.themeColor.length === 0) {
+      this.color1 = this.colorSchemes[5].colors;
+      // } else {
+      //   this.color1 = this.themeColor;
+      // }
+    });
 
     // console.log(this.color1, colorSchemes[0].colors, "color1");
   },

+ 8 - 6
src/views/performance/components/chartsCom/WindRoseChart.vue

@@ -62,12 +62,14 @@ export default {
     },
   },
   mounted() {
-    this.getData();
-    if (this.themeColor.length === 0) {
-      this.color1 = colorSchemes[0].colors;
-    } else {
-      this.color1 = this.themeColor;
-    }
+    this.$nextTick(() => {
+      this.getData();
+      // if (this.themeColor.length === 0) {
+      this.color1 = this.colorSchemes[0].colors;
+      // } else {
+      //   this.color1 = this.themeColor;
+      // }
+    });
   },
   methods: {
     async getData() {

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

@@ -76,7 +76,7 @@ export default {
       chartType: "line", // 默认图表类型是折线图
       color1: [], // 默认颜色
       // 配色方案列表(每个方案是一个颜色数组)
-      colorSchemes: [...colorSchemes],
+      colorSchemes: colorSchemes,
       loading: false,
       isError: false,
       colors: [...colorSchemes[0].colors],
@@ -104,8 +104,10 @@ export default {
   },
   mounted() {
     if (this.fileAddr) {
-      this.color1 = this.themeColor;
-      this.getData();
+      this.$nextTick(() => {
+        this.color1 = this.colorSchemes[0].colors;
+        this.getData();
+      });
     }
   },
   methods: {

+ 11 - 8
src/views/performance/components/chartsCom/powerMarkers2DCharts.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2024-09-11 14:32:12
- * @LastEditTime: 2025-06-11 09:20:53
+ * @LastEditTime: 2025-06-11 10:49:13
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/chartsCom/powerMarkers2DCharts.vue
@@ -109,7 +109,7 @@ export default {
     themeColor: {
       handler(newval) {
         if (newval.length === 0) {
-          this.color1 = colorSchemes[0].colors;
+          this.color1 = this.colorSchemes[0].colors;
         } else {
           this.color1 = newval;
         }
@@ -125,12 +125,15 @@ export default {
     },
   },
   async mounted() {
-    this.getData();
-    if (this.themeColor.length === 0) {
-      this.color1 = colorSchemes[0].colors;
-    } else {
-      this.color1 = this.themeColor;
-    }
+    this.$nextTick(() => {
+      this.getData();
+      // if (this.themeColor.length === 0) {
+      this.color1 = this.colorSchemes[0].colors;
+      // } else {
+      //   this.color1 = this.themeColor;
+      // }
+    });
+
     // console.log(this.color1, colorSchemes[0].colors, "color1");
   },
   methods: {

+ 6 - 3
src/views/performance/components/chartsCom/yawErrorLine.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2025-01-22 09:42:59
- * @LastEditTime: 2025-05-14 11:19:18
+ * @LastEditTime: 2025-06-11 10:55:18
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/chartsCom/yawErrorLine.vue
@@ -108,8 +108,11 @@ export default {
   },
   mounted() {
     if (this.fileAddr) {
-      this.getData();
-      this.color1 = this.themeColor;
+      this.$nextTick(() => {
+        this.getData();
+        // this.color1 = this.themeColor;
+        this.color1 = this.colorSchemes[0].colors;
+      });
     }
   },
   methods: {