Ver código fonte

修改bug封装时序图组件

liujiejie 8 meses atrás
pai
commit
f869f5c707

+ 1 - 1
src/components/MenuTag.vue

@@ -108,7 +108,7 @@ export default {
     updateArrowVisibility() {
       this.tagsBoxWidth = this.$refs.outBox.offsetWidth;
       this.tagsWidth = this.$refs.box.scrollWidth;
-      console.log();
+
       // this.arrowVisible = this.tagsWidth > this.tagsBoxWidth;
     },
   },

+ 34 - 29
src/utils/allTypesOfAnalysisData.js

@@ -1,3 +1,6 @@
+import { color } from "echarts";
+import { width } from "tailwindcss/defaultTheme";
+
 export const allTypesDatas = [
   {
     //总图分图都存在
@@ -70,25 +73,34 @@ export const allTypesDatas = [
             filesType: "line",
             line_dash: [
               {
+                name: "DE Bearing Temperature",
                 color: "blue",
+                // dash: undefined,
               },
               {
+                name: "NDE Bearing Temperature",
                 color: "green",
+                // dash: undefined,
               },
               {
+                name: "DE Temp. BIAS",
                 color: "blue",
                 dash: "dot",
               },
               {
+                name: "NDE Temp. BIAS",
                 color: "green",
                 dash: "dot",
               },
               {
+                name: "DE-NDE Temp. BIAS",
                 color: "black",
                 dash: "dash",
               },
               {
+                name: "Nacelle Temperature",
                 color: "orange",
+                // dash: undefined,
               },
             ],
             lableConfig: {
@@ -112,69 +124,61 @@ export const allTypesDatas = [
                 ticklen: 5,
                 gridwidth: 1, // 网格线宽度
               },
+              showlegend: true, // 显示图例
               legend: {
                 // 设置图例的X轴和Y轴锚点
+                // 控制图例在X轴上的位置,1是最右边,1.05有间距
+                // 控制图例在Y轴上的位置,0.5表示垂直居中
+                // xanchor: "left", // 图例以左边为锚点,确保有右边间距
+                // yanchor: "middle", // 图例以中间为锚点,垂直居中
+                // 控制图例的边距
                 x: 1.1, // 控制图例在X轴上的位置,1是最右边,1.05有间距
                 y: 0.5, // 控制图例在Y轴上的位置,0.5表示垂直居中
                 xanchor: "left", // 图例以左边为锚点,确保有右边间距
                 yanchor: "middle", // 图例以中间为锚点,垂直居中
-                // 控制图例的边距
                 title: {
                   text: "温度 & 偏差", // 图例的标题
                 },
               },
+              margin: {
+                r: 200,
+              },
               shapes: [
-                // 第一条参考线 y = 5
                 {
                   type: "line",
                   x0: 0,
+                  x1: 1,
                   y0: 5,
-                  x1: 4, // x 轴最大值
                   y1: 5,
-                  line: {
-                    color: "#FFDB58",
-                    width: 2,
-                    dash: "dot", // 虚线样式
-                  },
+                  xref: "paper",
+                  line: { dash: "dot", color: "#FFDB58" },
                 },
-                // 第二条参考线 y = -5
                 {
                   type: "line",
                   x0: 0,
+                  x1: 1,
                   y0: -5,
-                  x1: 4,
                   y1: -5,
-                  line: {
-                    color: "#FFDB58",
-                    width: 2,
-                    dash: "dot",
-                  },
+                  xref: "paper",
+                  line: { dash: "dot", color: "#FFDB58" },
                 },
-                // 第三条参考线 y = 15
                 {
                   type: "line",
                   x0: 0,
+                  x1: 1,
                   y0: 15,
-                  x1: 4,
                   y1: 15,
-                  line: {
-                    color: "red",
-                    width: 2,
-                    dash: "dot",
-                  },
+                  xref: "paper",
+                  line: { dash: "dot", color: "red" },
                 },
-                // 第四条参考线 y = -15
                 {
                   type: "line",
                   x0: 0,
+                  x1: 1,
                   y0: -15,
-                  x1: 4,
                   y1: -15,
-                  line: {
-                    color: "red",
-                    width: 2,
-                    dash: "dot",
-                  },
+                  xref: "paper",
+                  line: { dash: "dot", color: "red" },
                 },
               ],
               autosize: true, // 自适应
@@ -210,6 +214,7 @@ export const allTypesDatas = [
         x: 0.5,
         y: -0.2,
       },
+
       // 添加边框
       annotations: [], // 初始化注释数组
     },

+ 4 - 1
src/views/performance/assetssDetail.vue

@@ -1,13 +1,14 @@
 <!--
  * @Author: your name
  * @Date: 2024-05-27 09:25:45
- * @LastEditTime: 2024-09-29 15:49:05
+ * @LastEditTime: 2024-09-30 14:28:12
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/assetssDetail.vue
 -->
 <template>
   <div class="global-variable" v-loading="loading">
+    <!-- <BoxLineCharts></BoxLineCharts> -->
     <!-- <LineCharts></LineCharts> -->
     <!-- 通过json文件绘制新的图表 -->
     <!-- <CreateNewChart></CreateNewChart> -->
@@ -377,6 +378,7 @@ import {
 } from "@/api/performance";
 import CreateNewChart from "./createNewChart.vue";
 import DetailCharts from "./components/DetailCharts.vue";
+import BoxLineCharts from "./components/chartsCom/BoxLineCharts";
 // import JsonMarkerCharts from "./components/JsonMarkerCharts.vue";
 import PlotlyCharts from "./components/PlotlyCharts.vue";
 import LineCharts from "./components/chartsCom/lineChart.vue";
@@ -392,6 +394,7 @@ export default {
     CreateNewChart,
     PlotlyCharts,
     LineCharts,
+    BoxLineCharts,
   },
   data() {
     return {

+ 0 - 1
src/views/performance/assetssMag.vue

@@ -483,7 +483,6 @@ export default {
     },
     async fetchData() {
       try {
-        console.log("更新 表格");
         const result = await getAnalysisResultList({
           ...this.formInline,
           totalSize: undefined,

+ 80 - 62
src/views/performance/components/EditAnalysis.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2024-05-29 09:14:23
- * @LastEditTime: 2024-09-27 16:20:06
+ * @LastEditTime: 2024-09-30 16:11:40
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/EditAnalysis.vue
@@ -165,69 +165,74 @@
           <template
             v-if="generalFilesData[0] !== null && generalFilesData.length !== 0"
           >
-            <template v-for="(powerCurveDom, ind) in generalFilesData">
-              <el-row>
-                <el-col
-                  :key="ind + 'zongleftCharts'"
-                  :span="12"
-                  v-if="
-                    form.configAnalysis === 'power_curve'
-                    // ||
-                    // form.configAnalysis === 'cp'
-                  "
-                  ><div class="left">
-                    <el-button
-                      @click="
-                        downLoadCsv(
-                          powerCurveDom && powerCurveDom.powerCurveTableData
-                        )
-                      "
-                      >导出表格数据</el-button
-                    >
+            <template
+              v-for="(powerCurveDom, ind) in generalFilesData"
+              :style="{ marginTop: '50px' }"
+            >
+              <!-- <el-row style="height: 600px"> -->
+              <el-col
+                :key="ind + 'zongleftCharts'"
+                :span="12"
+                style="height: 600px"
+                v-if="
+                  form.configAnalysis === 'power_curve'
+                  // ||
+                  // form.configAnalysis === 'cp'
+                "
+                ><div class="left">
+                  <el-button
+                    @click="
+                      downLoadCsv(
+                        powerCurveDom && powerCurveDom.powerCurveTableData
+                      )
+                    "
+                    >导出表格数据</el-button
+                  >
 
-                    <el-table
-                      :data="powerCurveDom && powerCurveDom.powerCurveTableData"
-                      border
-                      max-height="500"
-                      style="width: 100%"
-                      align="center"
-                    >
-                      <el-table-column prop="enginName" label="风机名称">
-                      </el-table-column>
-                      <el-table-column prop="engineTypeName" label="风机机型">
-                      </el-table-column>
-                      <el-table-column prop="xData" label="风速">
-                      </el-table-column>
-                      <el-table-column prop="yData" label="实际功率">
-                      </el-table-column>
-                      <el-table-column
-                        prop="contractPowerCurve"
-                        label="合同功率"
-                      >
-                      </el-table-column>
-                    </el-table>
-                  </div>
-                </el-col>
-                <el-col
-                  :key="ind + 'zongrightCharts'"
-                  v-loading="htmlLoading"
-                  v-if="form.configAnalysis === 'power_curve'"
-                  :span="12"
-                >
-                  <div class="right">
-                    <PlotlyCharts
-                      :ref="`charts-${ind}`"
-                      :inds="`zong${ind}`"
-                      :lineMarkerData="powerCurveDom.chartsData"
-                      :comType="'generalDrawing'"
-                    ></PlotlyCharts>
-                  </div>
-                </el-col>
-              </el-row>
+                  <el-table
+                    :data="powerCurveDom && powerCurveDom.powerCurveTableData"
+                    border
+                    max-height="500"
+                    style="width: 100%"
+                    align="center"
+                  >
+                    <el-table-column prop="enginName" label="风机名称">
+                    </el-table-column>
+                    <el-table-column prop="engineTypeName" label="风机机型">
+                    </el-table-column>
+                    <el-table-column prop="xData" label="风速">
+                    </el-table-column>
+                    <el-table-column prop="yData" label="实际功率">
+                    </el-table-column>
+                    <el-table-column prop="contractPowerCurve" label="合同功率">
+                    </el-table-column>
+                  </el-table>
+                </div>
+              </el-col>
+              <el-col
+                style="height: 600px"
+                :key="ind + 'zongrightCharts'"
+                v-loading="htmlLoading"
+                v-if="form.configAnalysis === 'power_curve'"
+                :span="12"
+              >
+                <div class="right">
+                  <PlotlyCharts
+                    :ref="`charts-${ind}`"
+                    :inds="`zong${ind}`"
+                    :lineMarkerData="powerCurveDom.chartsData"
+                    :comType="'generalDrawing'"
+                  ></PlotlyCharts>
+                </div>
+              </el-col>
+              <!-- </el-row> -->
             </template>
           </template>
           <template v-if="powerHtmlZongData.length > 0">
-            <template v-for="(file, index) in powerHtmlZongData">
+            <template
+              v-for="(file, index) in powerHtmlZongData"
+              :style="{ marginTop: '50px' }"
+            >
               <!-- <div style="margin: 20px 0">11</div> -->
               <el-col
                 class="col_content"
@@ -254,7 +259,7 @@
               分析分图:
             </span>
           </el-col>
-          <el-col>
+          <el-col :span="24">
             <template
               v-if="graphFilesData[0] !== null && graphFilesData.length !== 0"
             >
@@ -540,11 +545,15 @@ import PlotlyCharts from "./PlotlyCharts.vue";
 import { downLoadCsvFile } from "@/utils/common";
 import Papa from "papaparse";
 import axios from "axios";
+import { style } from "plotly.js-with-locales/lib/bar";
 export default {
   components: {
     TinymceEditor,
     PlotlyCharts,
   },
+  props: {
+    activeName: String,
+  },
   data() {
     return {
       tableData: [],
@@ -593,9 +602,18 @@ export default {
       powerHtmlFenData: [],
     };
   },
+  watch: {
+    activeName: {
+      handler(newVal, oldVal) {
+        if (newVal === "second" && this.form.configAnalysis === "") {
+          this.getWindCodeList();
+        }
+      },
+    },
+  },
   created() {
     //获取分析 分析类型、机组编号 列表
-    this.getWindCodeList();
+    // this.getWindCodeList();
   },
   methods: {
     iframeLoad() {

+ 2 - 3
src/views/performance/components/JsonMarkerCharts.vue

@@ -1,8 +1,8 @@
 <!--
  * @Author: your name
  * @Date: 2024-08-16 16:19:19
- * @LastEditTime: 2024-09-05 08:57:40
- * @LastEditors: milo-MacBook-Pro.local
+ * @LastEditTime: 2024-09-30 09:30:43
+ * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/JsonMarkerCharts.vue
 -->
@@ -130,7 +130,6 @@ export default {
               curveNumber: pt.curveNumber,
             });
           });
-          console.log("Selected data:", selectedPoints);
         }
       });
     },

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

@@ -129,7 +129,6 @@ export default {
   },
   methods: {
     updateCharts() {
-      console.log(this.inds, this.lineMarkerData.data, "图表组件数据");
       this.powerCurveData.turbines =
         this.lineMarkerData.data?.filter(
           (item) => item.enginName !== "合同功率曲线"

+ 11 - 1
src/views/performance/components/analysisEvent.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2024-05-29 09:13:51
- * @LastEditTime: 2024-09-19 16:39:40
+ * @LastEditTime: 2024-09-30 16:12:20
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/analysisEvent.vue
@@ -677,6 +677,9 @@ export default {
   components: {
     Map,
   },
+  props: {
+    activeName: String,
+  },
   data() {
     return {
       formInline: {
@@ -740,6 +743,13 @@ export default {
       windDetail: {},
     };
   },
+  watch: {
+    activeName: {
+      handler(newVal, oldVal) {
+        // console.log(newVal, "新值 分析事件");
+      },
+    },
+  },
   created() {
     //获取分析 分析类型、机组编号 列表
     this.getWindCodeList();

+ 138 - 5
src/views/performance/components/chartsCom/BoxLineCharts.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2024-09-11 14:32:51
- * @LastEditTime: 2024-09-29 17:00:00
+ * @LastEditTime: 2024-09-30 14:03:21
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/chartsCom/BoxLineCharts.vue
@@ -10,16 +10,70 @@
   <div>
     boxLineCharts
     <h1>额定功率和风速分析</h1>
-    <div :id="`chart-${inds}`" style="width: 100%; height: 550px"></div>
+    <div
+      :id="`plotDivAbove25-${inds}`"
+      style="width: 100%; height: 550px"
+    ></div>
+    <div
+      :id="`plotDivBelow25-${inds}`"
+      style="width: 100%; height: 550px"
+    ></div>
+    <!-- <div :id="`chart-${inds}`" style="width: 100%; height: 550px"></div> -->
   </div>
 </template>
 <script>
 import { allTypesDatas } from "@/utils/allTypesOfAnalysisData.js";
 import Plotly from "plotly.js-dist";
 export default {
-  props: {},
+  props: {
+    inds: {
+      type: Number,
+      default() {
+        return 0;
+      },
+    },
+  },
   data() {
-    return {};
+    return {
+      turbinesData: [
+        { turbine: "Turbine1", envTemp: 26, windSpeed: 12, activePower: 1200 },
+        { turbine: "Turbine1", envTemp: 26, windSpeed: 12, activePower: 1800 },
+        { turbine: "Turbine1", envTemp: 26, windSpeed: 12, activePower: 1100 },
+        { turbine: "Turbine1", envTemp: 26, windSpeed: 12, activePower: 1400 },
+        { turbine: "Turbine1", envTemp: 26, windSpeed: 12, activePower: 1500 },
+        { turbine: "Turbine1", envTemp: 26, windSpeed: 12, activePower: 1700 },
+        { turbine: "Turbine1", envTemp: 26, windSpeed: 12, activePower: 1350 },
+        { turbine: "Turbine2", envTemp: 26, windSpeed: 11, activePower: 1150 },
+        { turbine: "Turbine2", envTemp: 26, windSpeed: 11, activePower: 1150 },
+        { turbine: "Turbine2", envTemp: 26, windSpeed: 11, activePower: 1450 },
+        { turbine: "Turbine2", envTemp: 26, windSpeed: 11, activePower: 1850 },
+        { turbine: "Turbine2", envTemp: 26, windSpeed: 11, activePower: 1950 },
+        { turbine: "Turbine2", envTemp: 26, windSpeed: 11, activePower: 1250 },
+        { turbine: "Turbine2", envTemp: 26, windSpeed: 11, activePower: 1350 },
+        { turbine: "Turbine3", envTemp: 26, windSpeed: 13, activePower: 1250 },
+        { turbine: "Turbine3", envTemp: 26, windSpeed: 12, activePower: 1800 },
+        { turbine: "Turbine3", envTemp: 26, windSpeed: 12, activePower: 1100 },
+        { turbine: "Turbine3", envTemp: 26, windSpeed: 12, activePower: 1400 },
+        { turbine: "Turbine3", envTemp: 26, windSpeed: 12, activePower: 1500 },
+        { turbine: "Turbine3", envTemp: 26, windSpeed: 12, activePower: 1700 },
+        { turbine: "Turbine3", envTemp: 26, windSpeed: 12, activePower: 1350 },
+        { turbine: "Turbine4", envTemp: 26, windSpeed: 10, activePower: 1100 },
+        { turbine: "Turbine4", envTemp: 26, windSpeed: 10, activePower: 1300 },
+        { turbine: "Turbine4", envTemp: 26, windSpeed: 10, activePower: 1500 },
+        { turbine: "Turbine4", envTemp: 26, windSpeed: 10, activePower: 1700 },
+        { turbine: "Turbine4", envTemp: 26, windSpeed: 10, activePower: 1200 },
+        { turbine: "Turbine4", envTemp: 26, windSpeed: 10, activePower: 1300 },
+        { turbine: "Turbine5", envTemp: 28, windSpeed: 14, activePower: 1200 },
+        { turbine: "Turbine5", envTemp: 28, windSpeed: 14, activePower: 1300 },
+        { turbine: "Turbine5", envTemp: 28, windSpeed: 14, activePower: 1400 },
+        { turbine: "Turbine5", envTemp: 28, windSpeed: 14, activePower: 1100 },
+        { turbine: "Turbine6", envTemp: 26, windSpeed: 10, activePower: 1300 },
+        { turbine: "Turbine6", envTemp: 26, windSpeed: 10, activePower: 1500 },
+        { turbine: "Turbine6", envTemp: 26, windSpeed: 10, activePower: 1700 },
+        { turbine: "Turbine6", envTemp: 26, windSpeed: 10, activePower: 1200 },
+        { turbine: "Turbine6", envTemp: 26, windSpeed: 10, activePower: 1300 },
+      ],
+    };
   },
   mounted() {
     this.initcharts();
@@ -27,8 +81,87 @@ export default {
   methods: {
     initcharts() {
       const lineDatas = allTypesDatas.filter(
-        (item) => item.analysisTypeCode === "temperature_large_components"
+        (item) => item.analysisTypeCode === "rated_power_windspeed"
       )[0];
+      const above25 = this.turbinesData.filter((d) => d.envTemp >= 25);
+      const below25 = this.turbinesData.filter((d) => d.envTemp < 25);
+
+      // 中位数计算
+      const medians = this.calculateMedians();
+
+      const turbineNames = Object.keys(medians);
+      const medianValues = Object.values(medians);
+      const traceAbove25 = {
+        y: above25.map((d) => d.activePower),
+        x: above25.map((d) => d.turbine),
+        type: "box",
+        fillcolor: "#1d90ff",
+        marker: {
+          line: {
+            color: "black",
+          },
+        },
+        whiskerwidth: 1,
+        boxpoints: "outliers",
+        line: {
+          color: "black",
+        },
+        showlegend: false,
+        name: "Ambient Temp >= 25°C",
+      };
+      const traceMedianLine = {
+        x: turbineNames,
+        y: medianValues,
+        mode: "markers",
+        marker: { symbol: "line-ew-open", color: "red", size: 10 },
+        showlegend: false,
+      };
+      const layoutAbove25 = {
+        ...lineDatas.lableConfig,
+        title: "额定全风速10min配电 (环境温度 < 25°C)",
+        // plot_bgcolor: "#e5ecf6",
+        // yaxis: {
+        //   title: "Power",
+        //   tickfont: { size: 10 },
+        //   gridcolor: "rgb(255,255,255)",
+        //   showgrid: true,
+        //   zeroline: false,
+        // },
+        // xaxis: {
+        //   title: "Turbine",
+        //   tickangle: -45,
+        //   type: "category",
+        //   tickfont: { size: 10 },
+        //   gridcolor: "rgb(255,255,255)",
+        //   showgrid: true,
+        //   zeroline: false,
+        // },
+        // boxmode: "group",
+      };
+
+      Plotly.newPlot(
+        `plotDivAbove25-${this.inds}`,
+        [traceAbove25, traceMedianLine],
+        layoutAbove25
+      );
+    },
+    //中位值的计算
+    calculateMedians() {
+      const medians = this.turbinesData.reduce((acc, d) => {
+        if (!acc[d.turbine]) acc[d.turbine] = [];
+        acc[d.turbine].push(d.activePower);
+        return acc;
+      }, {});
+
+      for (let turbine in medians) {
+        const values = medians[turbine].sort((a, b) => a - b);
+        const middle = Math.floor(values.length / 2);
+        medians[turbine] =
+          values.length % 2 === 0
+            ? (values[middle - 1] + values[middle]) / 2
+            : values[middle];
+      }
+      return medians;
     },
   },
 };

+ 79 - 16
src/views/performance/components/chartsCom/lineChart.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2024-09-11 14:23:08
- * @LastEditTime: 2024-09-29 16:50:30
+ * @LastEditTime: 2024-09-30 11:22:10
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/chartsCom/lineChart.vue
@@ -10,6 +10,7 @@
   <div>
     <h1>大部件温度传感器分析</h1>
     <div :id="`chart-${inds}`" style="width: 100%; height: 550px"></div>
+    <div id="chart-types" style="width: 100%; height: 550px"></div>
   </div>
 </template>
 <script>
@@ -19,37 +20,68 @@ import Plotly from "plotly.js-dist";
 export default {
   props: {
     inds: {
-      default: "0",
+      default() {
+        return "0";
+      },
       type: String,
     }, //循环下标防止图表覆盖问题
     lineData: {
-      default: {},
+      default() {
+        return {};
+      },
       type: Object,
     }, //图表数据
     comType: {
-      default: "",
-      type: string,
+      default() {
+        return "";
+      },
+      type: String,
     }, //总图、分图
     chartsType: {
-      default: [],
+      default() {
+        return [];
+      },
       type: Array,
     },
     chartData: {
-      default: [],
+      default: () => {
+        return [
+          {
+            x: [0, 1, 2, 3, 4], // X轴数据
+            y: [0, 1, 4, 9, 16], // Y轴数据
+          },
+          {
+            x: [0, 1, 2, 3, 4], // X轴数据
+            y: [1, 3, 5, 7, 11], // Y轴数据
+          },
+          {
+            x: [0, 1, 2, 3, 4], // X轴数据
+            y: [2, 5, 8, 10, 13], // Y轴数据
+          },
+          {
+            x: [0, 1, 2, 3, 4], // X轴数据
+            y: [3, 6, 9, 12, 15], // Y轴数据
+          },
+          {
+            x: [0, 1, 2, 3, 4], // X轴数据
+            y: [10, 25, 20, 40, 35], // Y轴数据
+          },
+          {
+            x: [0, 1, 2, 3, 4], // X轴数据
+            y: [5, 10, 15, 10, 25], // Y轴数据
+          },
+        ];
+      },
       type: Array,
     },
   },
   name: "LineChart",
   data() {
-    return {
-      chartData: {
-        x: [0, 1, 2, 3, 4], // X轴数据
-        y: [0, 1, 4, 9, 16], // Y轴数据
-      },
-    };
+    return {};
   },
   mounted() {
-    this.initChart();
+    // this.initChart();
+    this.initChartsType();
   },
   methods: {
     initChart() {
@@ -57,9 +89,15 @@ export default {
         (item) => item.analysisTypeCode === "temperature_large_components"
       )[0];
       const trace = {
-        x: this.chartData.x,
-        y: this.chartData.y,
+        x: this.chartData[0].x,
+        y: this.chartData[0].y,
         mode: "lines", // 折线图模式
+        line: {
+          // color: "darkblue",
+          // color:'lightgrey',
+          color: "#2f123a", //齿轮箱高速轴温度分布
+          width: 2,
+        },
         type: "scatter", // 使用散点图的类型生成线
       };
       const layout = { ...lineDatas.lableConfig };
@@ -70,6 +108,31 @@ export default {
       // 使用 Plotly 绘制图表
       Plotly.newPlot(`chart-${this.inds}`, [trace], layout, config);
     },
+    initChartsType() {
+      const lineDatas = allTypesDatas.filter(
+        (item) => item.analysisTypeCode === "temperature_large_components"
+      )[0];
+      const chartsType = lineDatas.chartsType[1].children.filter(
+        (item) => item.name === "发电机温度偏差:"
+      )[0];
+      const trace = chartsType.line_dash.map((item, ind) => {
+        return {
+          x: this.chartData[ind].x,
+          y: this.chartData[ind].y,
+          mode: "lines", // 折线图模式
+          name: item.name,
+          line: { color: item.color, dash: item.dash },
+          type: "scatter", // 使用散点图的类型生成线
+        };
+      });
+      const layout = { ...chartsType.lableConfig };
+      const config = {
+        responsive: true, // 自适应
+      };
+
+      // 使用 Plotly 绘制图表
+      Plotly.newPlot(`chart-types`, trace, layout, config);
+    },
   },
 };
 </script>

+ 1 - 2
src/views/performance/components/dialogCom.vue

@@ -144,7 +144,7 @@ export default {
     async getfileRportType() {
       try {
         const res = await getRportType();
-        console.log(res.data, "res");
+
         this.rportTypeList = res.data;
       } catch (err) {
         console.error(err);
@@ -232,7 +232,6 @@ export default {
     },
     //判断修改文件名称是否以.pdf 后缀
     validateAndSaveFileName(file) {
-      console.log(file.name.trim().endsWith(".pdf"), "file .pdf");
       if (file.name.trim().endsWith(".pdf")) {
         this.saveFileName(file);
       } else {

+ 3 - 3
src/views/performance/editAssets.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2024-05-27 09:26:31
- * @LastEditTime: 2024-09-13 14:36:26
+ * @LastEditTime: 2024-09-30 16:05:33
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/editAssets.vue
@@ -21,10 +21,10 @@
     </el-row>
     <el-tabs v-model="activeName" @tab-click="handleClick">
       <el-tab-pane label="分析事件" name="first">
-        <analysis-event></analysis-event>
+        <analysis-event :activeName="activeName"></analysis-event>
       </el-tab-pane>
       <el-tab-pane label="分析编辑" name="second">
-        <edit-analysis></edit-analysis>
+        <edit-analysis :activeName="activeName"></edit-analysis>
       </el-tab-pane>
     </el-tabs>
   </div>