Browse Source

微观选址分析模块图表替换

wangb 3 months ago
parent
commit
632a23a199

+ 2 - 0
components.d.ts

@@ -39,6 +39,7 @@ declare module 'vue' {
     EchartsGaugeComponent: typeof import('./src/components/homeComponent/echartsGaugeComponent.vue')['default']
     EchartsPie: typeof import('./src/components/homeComponent/echartsPie.vue')['default']
     EchartsPie2: typeof import('./src/components/homeComponent/echartsPie2.vue')['default']
+    ElAutoResizer: typeof import('element-plus/es')['ElAutoResizer']
     ElButton: typeof import('element-plus/es')['ElButton']
     ElCard: typeof import('element-plus/es')['ElCard']
     ElCarousel: typeof import('element-plus/es')['ElCarousel']
@@ -80,6 +81,7 @@ declare module 'vue' {
     ElSwitch: typeof import('element-plus/es')['ElSwitch']
     ElTable: typeof import('element-plus/es')['ElTable']
     ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
+    ElTableV2: typeof import('element-plus/es')['ElTableV2']
     ElTabPane: typeof import('element-plus/es')['ElTabPane']
     ElTabs: typeof import('element-plus/es')['ElTabs']
     ElTag: typeof import('element-plus/es')['ElTag']

+ 1 - 2
src/components/powerPredictionComponent/homePageAssembly/globalDialogPage.vue

@@ -397,7 +397,7 @@
                     );
                 }
             },
-            getglobalLine(name, title, xAxis, legend, series, color) {
+            getglobalLine(name, title, xAxis, legend, series) {
                 let yxname =
                     title === "功率" ? "兆瓦(Mw)" : title === "风速" ? "m/s" : "W/㎡";
                 let option = {
@@ -405,7 +405,6 @@
                     title: {
                         text: title,
                     },
-                    color: color,
                     tooltip: {
                         trigger: "axis",
                     },

+ 237 - 8
src/views/generatingCapacity/dataAnalysis/posAnalysis/index.vue

@@ -340,7 +340,35 @@
       modal-class="rightMenuDialog"
       v-model="hotDialog"
     >
-      <combineChart
+      <!-- <combineChart
+        ref="chartRef"
+        width="100%"
+        height="600px"
+        :chartTitle="
+          avgObj.title +
+          '&nbsp;&nbsp;' +
+          '平均Cp值:' +
+          avgObj.cpavg +
+          '; 静风频率:' +
+          avgObj.frequency +
+          '%; 曲线偏差率:' +
+          avgObj.pcratio +
+          '%'
+        "
+        :xAxisData="hotChart.xAxisData"
+        :yAxisData="{ splitLine: { show: false } }"
+        :seriesData="hotChart.seriesData"
+        :showLegend="true"
+        :brushSelected="false"
+        :maxMinData="hotChart.maxMinData"
+        :theme="theme"
+        :echartsTheme="echartsTheme"
+        :dataSet="hotChart.dataSet"
+        :showToolbox="false"
+        tooltipTrigger="axis"
+        @getSelected="funhotChartSelect"
+      /> -->
+      <Wdgl
         ref="chartRef"
         width="100%"
         height="600px"
@@ -399,7 +427,32 @@
         <el-tabs v-model="jjjActiveTab">
           <el-tab-pane label="图表展示" name="1">
             <div style="height: 600px">
-              <combineChart
+              <!-- <combineChart
+                ref="chartRef"
+                width="100%"
+                height="100%"
+                :chartTitle="''"
+                style="margin-top: 3vh"
+                :xAxisData="jjjChart.xAxisData"
+                :yAxisData="{ splitLine: { show: false } }"
+                :seriesData="jjjChart.seriesData"
+                :seriesAllData="jjjChart.seriesAllData"
+                :showLegend="true"
+                :brushSelected="false"
+                :dataSet="jjjChart.dataSet"
+                :theme="theme"
+                :echartsTheme="echartsTheme"
+                @getSelected="funChartSelect"
+              /> -->
+              <p
+                :style="!theme ? 'color: #fff' : 'color: #000'"
+                style="width: 100%; text-align: center"
+              >
+                变桨角度偏差率:{{
+                  jjjChart.angleData ? jjjChart.angleData : 0
+                }}%
+              </p>
+              <JjjChart
                 ref="chartRef"
                 width="100%"
                 height="100%"
@@ -434,7 +487,7 @@
           </el-tab-pane>
           <el-tab-pane label="表格数据" name="3">
             <div style="height: 600px">
-              <table-cop
+              <!-- <table-cop
                 class=""
                 :data="jjjChart.tableData"
                 :column="jjjChart.tableColumn"
@@ -443,7 +496,29 @@
                 tableId="1"
                 :tableName="jjjChart.tableName"
                 :rowstyle="true"
-              ></table-cop>
+              ></table-cop> -->
+              <el-table :data="jjjChart.tableData" :max-height="600">
+                <el-table-column property="time" align="center" label="时间" />
+                <el-table-column property="yp1" align="center" label="叶片1" />
+                <el-table-column property="yp2" align="center" label="叶片2" />
+                <el-table-column property="yp3" align="center" label="叶片3" />
+              </el-table>
+              <!-- <el-auto-resizer>
+                <template #default="{ height, width }">
+                  <el-table-v2
+                    :columns="[
+                      { key: 'time', dataKey: 'time', title: '时间' },
+                      { key: 'yp1', dataKey: 'yp1', title: '叶片1' },
+                      { key: 'yp2', dataKey: 'yp2', title: '叶片2' },
+                      { key: 'yp3', dataKey: 'yp3', title: '叶片3' },
+                    ]"
+                    :width="width"
+                    :height="height"
+                    :data="jjjChart.tableData"
+                    fixed
+                  />
+                </template>
+              </el-auto-resizer> -->
             </div>
           </el-tab-pane>
         </el-tabs>
@@ -472,6 +547,8 @@ import posChart from "./components/posChart.vue";
 import leafletMap from "./components/leafletMap.vue";
 /**combine */
 import combineChart from "../combine/components/current-scatter-chart.vue";
+import Wdgl from "../hotAnalysis/components/current-scatter-chart.vue";
+import JjjChart from "../angleAnalysis/components/current-scatter-chart.vue";
 /**rateAnalysis */
 import barLineChartCop from "../combine/components/barLineChart.vue";
 import barChartCop from "../combine/components/barChart.vue";
@@ -748,9 +825,75 @@ const funHotSubmit = async (obj) => {
     },
   });
 
+  // if (chartResponse && chartResponse.code === 200) {
+  //   chartRes = chartResponse.data;
+  //   hotChart.maxMinData = [chartRes.maxhjwd, chartRes.minhjwd];
+  //   avgObj.title = chartRes.obj.path
+  //     .substring(
+  //       chartRes.obj.path.indexOf(chartRes.obj.station + "_") +
+  //         (chartRes.obj.station + "_").length
+  //     )
+  //     .split("_")[0];
+  //   avgObj.cpavg = Number(chartRes.obj.cpavg).toFixed(2);
+  //   avgObj.frequency = Number(chartRes.obj.frequency).toFixed(2);
+  //   avgObj.pcratio = Number(chartRes.obj.pcratio).toFixed(2);
+  //   const color = [
+  //     "#1C99FF",
+  //     "#FF8700",
+  //     "#3D54BE",
+  //     "#fa8c16",
+  //     "#1DA0D7",
+  //     "#DD5044",
+  //   ];
+  //   hotChart.seriesData = [
+  //     {
+  //       name: "拟合功率",
+  //       type: "line",
+  //       symbol: "line", //设定为实心点
+  //       symbolSize: 0, //设定实心点的大小
+  //       smooth: true, //这个是把线变成曲线
+  //       data: chartRes.sjgl,
+  //       xAxisIndex: 0,
+  //     },
+  //     {
+  //       name: "保证功率",
+  //       type: "line",
+  //       symbol: "line", //设定为实心点
+  //       symbolSize: 0, //设定实心点的大小
+  //       smooth: true, //这个是把线变成曲线
+  //       data: chartRes.llgl,
+  //       xAxisIndex: 0,
+  //     },
+  //     {
+  //       type: "effectScatter",
+  //       showEffectOn: "emphasis",
+  //       rippleEffect: {
+  //         scale: 1,
+  //       },
+  //       name: "数据散点",
+  //       symbolSize: 5,
+  //       // symbolSize: (data) => {
+  //       // 	return data.s ? data.s > 10 ? 10 : data.s : 4
+  //       // },
+  //       // datasetIndex: 1,
+  //       // encode: {
+  //       // 	x: 'x',
+  //       // 	y: 'y'
+  //       // },
+  //       data: chartRes.scatter,
+  //       xAxisIndex: 0,
+  //       yAxisIndex: 0,
+  //     },
+  //   ];
+  //   hotDialog.value = true;
+  // }
   if (chartResponse && chartResponse.code === 200) {
     chartRes = chartResponse.data;
     hotChart.maxMinData = [chartRes.maxhjwd, chartRes.minhjwd];
+    markDot.pcl5 = chartRes.obj.pc5ratio;
+    markDot.pcl10 = chartRes.obj.pc10ratio;
+    markDot.pcl12 = chartRes.obj.pc12ratio;
+    markDot.pcl25 = chartRes.obj.pc25ratio;
     avgObj.title = chartRes.obj.path
       .substring(
         chartRes.obj.path.indexOf(chartRes.obj.station + "_") +
@@ -925,28 +1068,90 @@ const jjjChart = reactive({
   lineyAxis: [],
   lineSeries: [],
   dataSet: [],
+  abnormalPoint: [],
+  angleData: 0,
 });
 const funJjjSubmit = async (obj) => {
   const res = await httpRequest.get("/blade/angle", {
     params: {
-      ids: obj.fittingId,
+      ids: obj.processId,
     },
   });
 
+  // let exTime = [];
+  // let yp1 = [],
+  //   yp2 = [],
+  //   yp3 = [],
+  //   speed = [];
+  // res.data.bw.forEach((it) => {
+  //   exTime.push(it.time);
+  //   yp1.push(it.yp1);
+  //   yp2.push(it.yp2);
+  //   yp3.push(it.yp3);
+  //   speed.push(it.speed);
+  // });
+  // jjjChart.tableData = res.data.bw;
+  // jjjChart.seriesAllData = res.data.bw;
+  // jjjChart.xAxisData = exTime;
+
+  // jjjChart.seriesData = [
+  //   {
+  //     name: "叶片1",
+  //     type: "line",
+  //     symbol: "line", //设定为实心点
+  //     symbolSize: 0, //设定实心点的大小
+  //     smooth: false, //这个是把线变成曲线
+  //     data: yp1,
+  //     xAxisIndex: 0,
+  //   },
+  //   {
+  //     name: "叶片2",
+  //     type: "line",
+  //     symbol: "line", //设定为实心点
+  //     symbolSize: 0, //设定实心点的大小
+  //     smooth: false, //这个是把线变成曲线
+  //     data: yp2,
+  //     xAxisIndex: 0,
+  //   },
+  //   {
+  //     name: "叶片3",
+  //     type: "line",
+  //     symbol: "line", //设定为实心点
+  //     symbolSize: 0, //设定实心点的大小
+  //     smooth: false, //这个是把线变成曲线
+  //     data: yp3,
+  //     xAxisIndex: 0,
+  //   },
+  //   {
+  //     name: "风速",
+  //     type: "line",
+  //     yAxisIndex: 1,
+  //     symbol: "line", //设定为实心点
+  //     symbolSize: 0, //设定实心点的大小
+  //     smooth: false, //这个是把线变成曲线
+  //     data: speed,
+  //     xAxisIndex: 0,
+  //   },
+  // ];
+  // jjjDialog.value = true;
+
+  jjjChart.angleData = res.data.angle;
   let exTime = [];
   let yp1 = [],
     yp2 = [],
     yp3 = [],
     speed = [];
-  res.data.bw.forEach((it) => {
+  res.data?.bw?.forEach((it) => {
     exTime.push(it.time);
     yp1.push(it.yp1);
     yp2.push(it.yp2);
     yp3.push(it.yp3);
     speed.push(it.speed);
   });
-  jjjChart.tableData = res.data.bw;
-  jjjChart.seriesAllData = res.data.bw;
+  setTimeout(() => {
+    jjjChart.tableData = res.data?.bw || [];
+  }, 1000);
+  jjjChart.seriesAllData = res.data?.bw || [];
   jjjChart.xAxisData = exTime;
 
   jjjChart.seriesData = [
@@ -988,9 +1193,33 @@ const funJjjSubmit = async (obj) => {
       xAxisIndex: 0,
     },
   ];
+
+  const exPoint = [];
+  jjjChart.seriesData?.[0]?.data?.forEach((ele, index) => {
+    const numEqual = [
+      ele,
+      jjjChart.seriesData[1].data[index],
+      jjjChart.seriesData[2].data[index],
+    ];
+    if (areNumbersDistinct(numEqual)) {
+      exPoint.push({
+        date: exTime[index],
+        yp1: numEqual[0],
+        yp2: numEqual[1],
+        yp3: numEqual[2],
+        dataIndex: index,
+      });
+    }
+  });
+
+  jjjChart.abnormalPoint = exPoint;
   jjjDialog.value = true;
 };
 
+const areNumbersDistinct = (arr) => {
+  return arr[0] !== arr[1] || arr[0] !== arr[2] || arr[1] !== arr[2];
+};
+
 /**combine-chart */
 const combineDialog = ref(false);
 const avgObj = reactive({

+ 6 - 3
src/views/powerPrediction/homePageNoMap.vue

@@ -714,9 +714,10 @@
         watch: {
             "$store.state.theme": {
                 handler: function (newVal, oldVal) {
+                    console.log("theme===>>>", newVal)
                     this.theme = newVal;
                     this.echartsTheme = !newVal ? "dark" : "";
-                    if (oldVal != undefined) {
+                    // if (oldVal != undefined) {
                         // this.getPowerPrediction();
                         // this.getWindSpeed("风速");
                         // this.getCapacity();
@@ -724,7 +725,8 @@
                         // this.getAllStationWeather();
                         // this.getWarningInfo();
                         // this.getWindStstus();
-                    }
+                        this.initPageFn()
+                    // }
                 },
                 immediate: true,
             },
@@ -1963,7 +1965,8 @@
                                 series.push(seriesObj);
                             });
                         }
-                        that.getPowerBar("barChart1", "预测考核分数", xAxis, legend, series);
+                        let color = ['#ea7ccc', '#5470c6', '#91cc75', '#ee6666', '#73c0de', '#fc8452', '#9a60b4', ]
+                        that.getPowerBar("barChart1", "预测考核分数", xAxis, legend, series, color);
                     }
                 });
             },

+ 12 - 1
src/views/powerPrediction/powerPredictionPage.vue

@@ -218,6 +218,7 @@ export default {
           ),
         ];
         this.getStationData();
+        // this.seachData()
       },
       immediate: true,
     },
@@ -1299,12 +1300,22 @@ export default {
               series.push(seriesObj);
             });
           }
+          let color = [
+            "#ea7ccc",
+            "#5470c6",
+            "#91cc75",
+            "#ee6666",
+            "#73c0de",
+            "#fc8452",
+            "#9a60b4",
+          ];
           this.getPowerBar(
             "assessmentChart",
             "预测准确率",
             xAxis,
             legend,
-            series
+            series,
+            color
           );
         }
       });