Browse Source

项目消缺、增加数据准备进度条

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 4 months ago
parent
commit
1c51952d7b

+ 7 - 7
.env.development

@@ -11,29 +11,29 @@ VUE_APP_TITLE = '页面标题'
 # 马力军
 # VUE_APP_LOGIN_URL = 'http://192.168.2.45:48080'
 # 王波
-VUE_APP_LOGIN_URL = 'http://192.168.0.102:48080'
+VUE_APP_LOGIN_URL = 'http://192.168.0.232:48080'
 
 # 发电能力分析
-VUE_APP_GENERAT_URL = 'http://192.168.0.102:9002'
+# VUE_APP_GENERAT_URL = 'http://192.168.0.102:9002'
 # 马力军
 # VUE_APP_GENERAT_URL = 'http://192.168.2.45:9002'
 # 王波
-# VUE_APP_GENERAT_URL = 'http://192.168.2.232:9002'
+VUE_APP_GENERAT_URL = 'http://192.168.2.232:9002'
 
 # 智能报表
-VUE_APP_REPORT_URL = 'http://192.168.0.102:9001'
+# VUE_APP_REPORT_URL = 'http://192.168.0.102:9001'
 # 马力军
 # VUE_APP_REPORT_URL = 'http://192.168.2.45:9001'
 # 王波
-# VUE_APP_REPORT_URL = 'http://192.168.2.232:9001'
+VUE_APP_REPORT_URL = 'http://192.168.2.232:9001'
 
 # 功率预测
 # 徐世利
-VUE_APP_BASE_URL = 'http://192.168.2.150:8086'
+# VUE_APP_BASE_URL = 'http://192.168.2.150:8086'
 # 马力军
 # VUE_APP_BASE_URL = 'http://192.168.2.45:8086'
 # 王波
-# VUE_APP_BASE_URL = 'http://192.168.2.232:8086'
+VUE_APP_BASE_URL = 'http://192.168.2.232:8086'
 
 # 百度地图KEY
 VUE_APP_BAIDU_MAP_KEY = ''

+ 8 - 8
.env.production

@@ -14,8 +14,8 @@ VUE_APP_TITLE = '页面标题'
 # 登录
 # VUE_APP_LOGIN_URL = 'http://123.60.219.66:48080'
 # VUE_APP_LOGIN_URL = 'http://192.168.0.105:48080'
-VUE_APP_LOGIN_URL = 'http://10.127.7.241:48080'
-# VUE_APP_LOGIN_URL = 'http://172.16.12.101:48080'
+# VUE_APP_LOGIN_URL = 'http://10.127.7.241:48080'
+VUE_APP_LOGIN_URL = 'http://172.16.12.101:48080'
 # VUE_APP_LOGIN_URL = 'http://192.168.2.231:48080'
 # VUE_APP_LOGIN_URL = 'http://127.0.0.1:48080'
 
@@ -23,24 +23,24 @@ VUE_APP_LOGIN_URL = 'http://10.127.7.241:48080'
 
 # 发电能力分析
 # VUE_APP_GENERAT_URL = 'http://123.60.219.66:9002'
-VUE_APP_GENERAT_URL = 'http://10.127.7.241:9002'
-# VUE_APP_GENERAT_URL = 'http://172.16.12.101:9002'
+# VUE_APP_GENERAT_URL = 'http://10.127.7.241:9002'
+VUE_APP_GENERAT_URL = 'http://172.16.12.101:9002'
 # VUE_APP_GENERAT_URL = 'http://192.168.2.231:9002'
 # VUE_APP_GENERAT_URL = 'http://127.0.0.1:9002'
 
 # 智能报表
 # VUE_APP_REPORT_URL = 'http://123.60.219.66:9001'
 # VUE_APP_REPORT_URL = 'http://192.168.0.105:9001'
-VUE_APP_REPORT_URL = 'http://10.127.7.241:9001'
-# VUE_APP_REPORT_URL = 'http://172.16.12.101:9001'
+# VUE_APP_REPORT_URL = 'http://10.127.7.241:9001'
+VUE_APP_REPORT_URL = 'http://172.16.12.101:9001'
 # VUE_APP_REPORT_URL = 'http://192.168.2.231:9001'
 # VUE_APP_REPORT_URL = 'http://127.0.0.1:9001'
 
 # 功率预测
 # VUE_APP_BASE_URL = 'http://123.60.219.66:8086'
 # VUE_APP_BASE_URL = 'http://192.168.0.105:8086'
-VUE_APP_BASE_URL = 'http://10.127.7.241:8086'
-# VUE_APP_BASE_URL = 'http://172.16.12.101:8086'
+# VUE_APP_BASE_URL = 'http://10.127.7.241:8086'
+VUE_APP_BASE_URL = 'http://172.16.12.101:8086'
 # VUE_APP_BASE_URL = 'http://192.168.2.231:8086'
 # VUE_APP_BASE_URL = 'http://127.0.0.1:8086'
 

+ 3 - 0
.gitignore

@@ -22,3 +22,6 @@ pnpm-debug.log*
 *.njsproj
 *.sln
 *.sw?
+*.zip
+*.rar
+*.7z

+ 21 - 5
public/static/config/modeConfig.js

@@ -2,7 +2,7 @@
 const localTest = false;
 
 // 服务器地址
-let baseURL = "/current/" // 正式环境
+let baseURL = "/current/"; // 正式环境
 
 // websocket 服务器地址
 let websocketUrl = null;
@@ -18,11 +18,27 @@ const tilesMaxLevel = 18;
 // 切换模块时是否提示当前模块名称(用于对内介绍项目时便捷显示模块名称)
 const showModuleName = 0;
 
-const reportBaseUrl = "http://10.127.7.241:8083";
-// const reportBaseUrl = "http://172.16.12.101:8083";
+// const reportBaseUrl = "http://10.127.7.241:8083";
+const reportBaseUrl = "http://172.16.12.101:8083";
 
-const baseReportUrl = "http://10.127.7.196";
-// const baseReportUrl = "http://172.16.12.101";
+// const baseReportUrl = "http://10.127.7.196";
+const baseReportUrl = "http://172.16.12.101";
+
+// 是否隐藏控制台打印的 log info warn 信息
+const hideLog = false;
+// 是否隐藏控制台打印的 error 信息
+const hideError = false;
+if (hideLog || hideError) {
+    const c = window?.console || {};
+    const replaceFun = () => { };
+    if (hideLog) {
+        c.warn = c.info = c.log = replaceFun;
+    }
+
+    if (hideError) {
+        c.error = replaceFun;
+    }
+}
 
 // if (localTest) {
 //     baseURL = "http://192.168.10.8:9002/" // 联机调试 

+ 75 - 0
src/App.vue

@@ -127,6 +127,18 @@
         <router-view />
       </div>
     </div>
+    <div class="appProgress" :class="showReadyProgress ? 'show' : 'hidden'">
+      <el-progress
+        :percentage="$store.state.readyProgress"
+        :status="progressType"
+        stroke-width="100%"
+        :duration="30"
+        striped
+        striped-flow
+      >
+        <span>{{ progressFormat($store.state.readyProgress) }}</span>
+      </el-progress>
+    </div>
   </div>
 </template>
 
@@ -180,6 +192,8 @@ export default {
   },
   data() {
     return {
+      progressType: "primary",
+      showReadyProgress: false,
       showHeader: false,
       isShowMenu: false,
       isCollapse: false,
@@ -922,6 +936,11 @@ export default {
       immediate: true,
     },
   },
+
+  async created() {
+    await this.initWebSocket();
+  },
+
   mounted() {
     // if (!JSON.parse(window.sessionStorage.getItem("theme"))) {
     //   document.getElementById("app").style.background = "#040c0b";
@@ -952,8 +971,41 @@ export default {
       this.showMenuData = this.generatingCapDatas;
     }
     // }
+    window.addEventListener("onmessageWS", this.getSocketData);
+  },
+
+  unmounted() {
+    this.$websocket.close();
   },
   methods: {
+    progressFormat(value) {
+      return `${
+        value < 100 ? "数据处理中..." + parseInt(value) + "%" : "数据处理完成"
+      }`;
+    },
+
+    async initWebSocket() {
+      this.$ws.initWebSocket();
+    },
+
+    getSocketData({ detail }) {
+      const res = JSON.parse(detail.data);
+      console.log(11111, res);
+      if (res.type === "message") {
+        this.showReadyProgress = true;
+        this.$store.commit("setReadyProgress", Number(res.content.data) * 100);
+        if (res.content.code === 2001) {
+          this.progressType = "success";
+        }
+      } else if (
+        res.type === "connection" &&
+        this.$store.state.readyProgress === 0
+      ) {
+        this.showReadyProgress = false;
+        this.progressType = "primary";
+      }
+    },
+
     selectMenuItem(index, indexPath, item, routeResult) {
       // console.log("index====>>>>", index);
       // console.log("indexPath====>>>>", indexPath);
@@ -1083,6 +1135,29 @@ export default {
   @import "~@/assets/styles/blueStyle/main.less";
 }
 
+#screen {
+  .appProgress {
+    z-index: 1000;
+    position: absolute;
+    left: 310px;
+    top: 18px;
+    overflow: hidden;
+
+    .el-progress__text {
+      color: #fff;
+    }
+
+    &.show {
+      width: 200px;
+      transition: 0.5s;
+    }
+    &.hidden {
+      width: 0;
+      transition: 0.5s;
+    }
+  }
+}
+
 .windLife {
   height: 100%;
 

+ 1 - 3
src/components/generatingCapacityComponent/table.vue

@@ -170,9 +170,7 @@ export default {
     data(value) {
       this.tableData = value || [];
     },
-    theme(bool) {
-      console.log(1111, bool);
-    },
+    theme(bool) {},
   },
 };
 </script>

+ 28 - 31
src/main.js

@@ -1,37 +1,31 @@
-/*
- * @Date: 2023-06-18 10:09:15
- * @LastEditors: zhubj
- * @LastEditTime: 2023-06-19 16:48:14
- * @Description: 头部注释
- * @FilePath: \own-vue3-vuecli-template\src\main.js
- */
-import { createApp } from 'vue'
-import App from './App.vue'
-import router from './router'
-import utils from '@/utils/index.js'
-import basicTool from '@/tools/basicTool.js'
-import store from './store'
-import axios from 'axios'
+import { createApp } from "vue";
+import App from "./App.vue";
+import router from "./router";
+import utils from "@/utils/index.js";
+import basicTool from "@/tools/basicTool.js";
+import store from "./store";
+import axios from "axios";
 
-import ElementPlus from 'element-plus'
-import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
-import 'element-plus/dist/index.css'
-import * as ElementPlusIconsVue from '@element-plus/icons-vue'
-import * as echarts from 'echarts'
+import ElementPlus from "element-plus";
+import zhCn from "element-plus/dist/locale/zh-cn.mjs";
+import "element-plus/dist/index.css";
+import * as ElementPlusIconsVue from "@element-plus/icons-vue";
+import * as echarts from "echarts";
 
 import API from "@api/axiosPLA";
 
-import L from "leaflet"
-import "leaflet/dist/leaflet.css"
-import "leaflet-contextmenu"
-import "leaflet-canvas-marker"
-import icon from "leaflet/dist/images/marker-icon.png" // 引入leaflet默认图标
+import L from "leaflet";
+import "leaflet/dist/leaflet.css";
+import "leaflet-contextmenu";
+import "leaflet-canvas-marker";
+import icon from "leaflet/dist/images/marker-icon.png"; // 引入leaflet默认图标
 
-import modeConfig from "@public/static/config/modeConfig.js"
+import modeConfig from "@public/static/config/modeConfig.js";
 
+import websocket from "./utils/ws.js";
 
 import "@/lib/global-import.js";
-import './permission' // permission control
+import "./permission"; // permission control
 
 import "./themeDark.less";
 import "./themeBlue.less";
@@ -46,7 +40,7 @@ const debounce = (fn, delay) => {
       fn.apply(context, args);
     }, delay);
   }
-}
+};
 
 const _ResizeObserver = window.ResizeObserver;
 window.ResizeObserver = class ResizeObserver extends _ResizeObserver {
@@ -54,7 +48,7 @@ window.ResizeObserver = class ResizeObserver extends _ResizeObserver {
     callback = debounce(callback, 16);
     super(callback);
   }
-}
+};
 
 Date.prototype.formatDate = function (fmt) {
   let o = {
@@ -83,10 +77,12 @@ Date.prototype.formatDate = function (fmt) {
   return fmt;
 };
 
-const app = createApp(App)
+const app = createApp(App);
+
 for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
   app.component(key, component)
 }
+
 app.config.globalProperties.BASE = basicTool;
 app.config.globalProperties.$utils = utils;
 app.config.globalProperties.$echarts = echarts;
@@ -95,5 +91,6 @@ app.config.globalProperties.$axios = axios;
 app.config.globalProperties.icoName = icon;
 app.config.globalProperties.reportBaseUrl = modeConfig?.reportBaseUrl || "";
 app.config.globalProperties.baseReportUrl = modeConfig?.baseReportUrl || "";
-app.use(L);
-app.use(store).use(router).use(ElementPlus, { size: 'small', locale: zhCn }).mount('#app')
+app.config.globalProperties.$ws = websocket;
+
+app.use(L).use(store).use(router).use(ElementPlus, { size: "small", locale: zhCn }).mount("#app");

+ 8 - 1
src/store/index.js

@@ -12,7 +12,8 @@ export default createStore({
   state: {
     theme: false,
     themeName: "dark",
-    moreSty: "blueSty"
+    moreSty: "blueSty",
+    readyProgress: 0,
   },
   getters: {
   },
@@ -20,11 +21,17 @@ export default createStore({
     changeTheme(state, tag) {
       state.theme = tag;
     },
+    setReadyProgress(state, value) {
+      state.readyProgress = value;
+    },
   },
   actions: {
     changeTheme(context, bool) {
       context.commit("changeTheme", bool);
     },
+    setReadyProgress(context, value) {
+      context.commit("setReadyProgress", value);
+    },
   },
   modules: {
     user

+ 122 - 0
src/utils/ws.js

@@ -0,0 +1,122 @@
+import { ElNotification } from "element-plus";
+
+let socket = null; // 实例对象
+let lockReconnect = false; // 是否真正建立连接
+let timeout = 10 * 1000; // 1秒一次心跳|
+let timeoutObj = null; // 心跳倒计时
+let serverTimeoutObj = null; // 服务心跳倒计时
+let timeoutnum = null; // 断开 重连倒计时
+let reLinkNum = 0;
+let reLinkMaxNum = 10;
+
+const initWebSocket = async () => {
+    if ("WebSocket" in window) {
+        if (reLinkNum < reLinkMaxNum) {
+            const wsUrl = `${process.env.VUE_APP_GENERAT_URL}/ws/powerfitting/12345`;
+            socket = new WebSocket(wsUrl);
+            socket.onerror = webSocketOnError;
+            socket.onmessage = webSocketOnMessage;
+            socket.onclose = closeWebsocket;
+            socket.onopen = openWebsocket;
+        }
+    } else {
+        ElNotification.error({
+            title: "错误",
+            message: "您的浏览器不支持websocket,请更换Chrome或者Firefox",
+        });
+    }
+}
+
+//建立连接
+const openWebsocket = (e) => {
+    start();
+}
+
+const start = () => {
+    //开启心跳
+    timeoutObj && clearTimeout(timeoutObj);
+    serverTimeoutObj && clearTimeout(serverTimeoutObj);
+    timeoutObj = setTimeout(() => {
+        //这里发送一个心跳,后端收到后,返回一个心跳消息
+        if (socket.readyState == 1) {
+            if (reLinkNum > 0) {
+                reLinkNum = 0;
+            }
+            //如果连接正常
+            // socket.send("heartbeat");
+        } else {
+            //否则重连
+            reconnect();
+        }
+        serverTimeoutObj = setTimeout(() => {
+            //超时关闭
+            socket.close();
+        }, timeout);
+    }, timeout);
+}
+
+//重新连接
+const reconnect = () => {
+    if (lockReconnect) {
+        return;
+    }
+    lockReconnect = true;
+    //没连接上会一直重连,设置延迟避免请求过多
+    timeoutnum && clearTimeout(timeoutnum);
+    if (reLinkNum < reLinkMaxNum) {
+        reLinkNum++;
+        timeoutnum = setTimeout(() => {
+            console.log(`websocket断线重连第${reLinkNum}次`)
+            //新连接
+            initWebSocket();
+            lockReconnect = false;
+        }, 1000);
+    } else {
+        console.log(`websocket超过最大重连限制,已手动关闭`);
+        socket && socket?.close && socket?.close();
+    }
+}
+
+//重置心跳
+const reset = () => {
+    //清除时间
+    clearTimeout(timeoutObj);
+    clearTimeout(serverTimeoutObj);
+    //重启心跳
+    start();
+}
+
+const sendWebsocket = (e) => {
+    // socket.send(`我发消息了`);
+}
+
+const webSocketOnError = (e) => {
+    initWebSocket();
+    reconnect();
+
+}
+
+//服务器返回的数据
+const webSocketOnMessage = (e) => {
+    //window自定义事件[下面有说明]
+    window.dispatchEvent(
+        new CustomEvent("onmessageWS", {
+            detail: {
+                data: JSON.parse(e?.data),
+            },
+        })
+    );
+    reset();
+}
+
+const closeWebsocket = (e) => {
+    reconnect();
+}
+
+//断开连接
+const close = () => {
+    //WebSocket对象也有发送和关闭的两个方法,只需要在自定义方法中分别调用send()和close()即可实现。
+    socket.close();
+}
+//具体问题具体分析,把需要用到的方法暴露出去
+export default { initWebSocket, sendWebsocket, webSocketOnMessage, close };

+ 3 - 2
src/views/IntegratedAlarm/safe/realWarning/index.vue

@@ -17,7 +17,7 @@
           />
         </div>
       </div>
-      <div class="cardLine">
+      <div class="cardLine" v-if="false">
         <div class="lineItem card">
           <Safecom
             title="光伏报警"
@@ -74,7 +74,8 @@ import Safecom from "@/views/IntegratedAlarm/safe/components/safecomponent.vue";
     height: 100%;
     justify-content: space-around;
     .cardLine {
-      width: calc(100% / 3 - 30px);
+      // width: calc(100% / 3 - 30px);
+      width: calc(100% / 2 - 30px);
       height: 100%;
       display: flex;
       flex-direction: column;

+ 474 - 396
src/views/generatingCapacity/dataAnalysis/angleAnalysis/components/current-scatter-chart.vue

@@ -1,423 +1,501 @@
 <template>
-    <div class="chart" :id="id"></div>
+  <div class="chart" :id="id"></div>
 </template>
 
 <script>
-    import util from "@tools/util";
-    import partten from "@tools/partten";
-    import * as echarts from "echarts";
-    import chartTheme from './current-scatter-chart.json'
+import util from "@tools/util";
+import partten from "@tools/partten";
+import * as echarts from "echarts";
+import chartTheme from "./current-scatter-chart.json";
 
-    export default {
-        name: 'currentScatterChart',
-        props: {
-            // 图表宽度
-            width: {
-                type: String,
-                default: "100%",
-            },
-            // 图表高度
-            height: {
-                type: String,
-                default: "350px",
-            },
-            // 图表主标题
-            chartTitle: {
-                type: String,
-                default: "自定义图表组件",
-            },
-            // X 轴配置项
-            xAxisData: {
-                type: Array,
-                default: () => {
-                    return [];
-                },
-            },
-            // Y 轴配置项
-            yAxisData: {
-                type: Array,
-                default: () => {
-                    return [];
-                },
+export default {
+  name: "currentScatterChart",
+  props: {
+    // 图表宽度
+    width: {
+      type: String,
+      default: "100%",
+    },
+    // 图表高度
+    height: {
+      type: String,
+      default: "350px",
+    },
+    // 图表主标题
+    chartTitle: {
+      type: String,
+      default: "自定义图表组件",
+    },
+    // X 轴配置项
+    xAxisData: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
+    // Y 轴配置项
+    yAxisData: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
+    dataSet: {
+      type: String,
+      default: "",
+    },
+    // 图表核心数据
+    seriesData: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
+    seriesAllData: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
+    // 是否显示图表图例
+    showLegend: {
+      type: Boolean,
+      default: true,
+    },
+    // 是否默认采用笔刷模式
+    brushSelected: {
+      type: Boolean,
+      default: false,
+    },
+    theme: {
+      type: Boolean,
+      default: false,
+    },
+    echartsTheme: {
+      type: String,
+      default: "",
+    },
+  },
+  data() {
+    return {
+      id: "",
+      chart: null,
+      color: [],
+      theme: "dark",
+      chartData: {},
+    };
+  },
+  computed: {
+    collapse() {
+      return this.$store.state.collapse;
+    },
+  },
+  watch: {
+    height() {
+      if (this.chart) {
+        this.chart.resize();
+      }
+    },
+    collapse(val) {
+      if (this.chart) {
+        setTimeout(() => {
+          this.chart.resize();
+        }, 300);
+      }
+    },
+  },
+  methods: {
+    resize() {},
+    getColorFn() {
+      let arr = [];
+      this.seriesAllData.forEach((item, index) => {
+        let obj = {
+          gt: index,
+          lt: index + 1,
+        };
+        if (item.tag === "tj") {
+          obj.color = "#FF5378";
+        } else {
+          obj.color = "#05BB4C";
+        }
+        arr.push(obj);
+      });
+      return arr;
+    },
+    getToolTipFn(params) {
+      let tit = "";
+      this.seriesAllData.forEach((item, index) => {
+        if (
+          params[0].axisValue === item.time &&
+          params[0].data === item.value
+        ) {
+          tit = item.tag === "tj" ? "停机" : "并网";
+        }
+      });
+      let str = `<span style="display:inline-block;margin-bottom: 5px">${params[0].axisValue}</span></br>`;
+      let str2 = `<div style="margin-bottom: 5px">
+                    <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${that.color[index]};\"></span>&nbsp;
+                    <span style="display:inline-block;">${tit}:</span>&nbsp;&nbsp;<span>${params[0].value}</span>
+                        </div>`;
+      return str + str2;
+    },
+    changeColor() {
+      if (this.$store.state.theme) {
+        this.color = [
+          "#67c23a",
+          "rgb(242.5, 208.5, 157.5)",
+          "#f56c6c",
+          "rgb(77, 119, 255)",
+          "rgb(116, 21, 219)",
+        ];
+      } else {
+        this.color = [
+          "#67c23a",
+          "rgb(242.5, 208.5, 157.5)",
+          "#f56c6c",
+          "rgb(77, 119, 255)",
+          "rgb(1, 191, 236)",
+        ];
+      }
+    },
+
+    initChart(markItem = {}) {
+      const that = this;
+      const theme = sessionStorage.getItem("theme") === "true" ? true : false;
+      that.chartData.forEach((ele, index) => {
+        ele.lineStyle = {
+          color: that.color[index],
+        };
+        if (ele.name === "叶片1" && markItem.yp1) {
+          this.markItem = markItem;
+          ele.markPoint = {
+            symbolSize: 36,
+            itemStyle: {
+              color: "#f60", // 特殊颜色
             },
-            dataSet: {
-                type: String,
-                default: ''
+            emphasis: {
+              itemStyle: {
+                color: "#fff",
+              },
             },
-            // 图表核心数据
-            seriesData: {
-                type: Array,
-                default: () => {
-                    return [];
-                },
+            blur: {
+              itemStyle: {
+                opacity: 1,
+              },
             },
-            seriesAllData: {
-                type: Array,
-                default: () => {
-                    return [];
+            data: [
+              {
+                name: `${markItem.date} 异常点`,
+                value: ele.data[markItem.dataIndex],
+                xAxis: markItem.dataIndex, // 使用索引作为 x 坐标
+                yAxis: ele.data[markItem.dataIndex], // 使用实际值作为 y 坐标
+                label: {
+                  formatter: "异常点",
+                  position: "top",
                 },
+              },
+            ],
+          };
+        }
+      });
+
+      let myChart = echarts.init(document.getElementById(this.id), "dark");
+      that.chart = myChart;
+      //指定图表的配置项和数据
+      const option = {
+        backgroundColor: "",
+        //标题
+        title: {
+          text: that.chartTitle,
+          right: 440,
+          top: 4,
+          textStyle: {
+            fontSize: 14,
+          },
+        },
+        toolbox: {
+          show: false,
+          x: "right",
+          position: [10, 10],
+          textStyle: {
+            fontSize: util.vh(16),
+          },
+          iconStyle: {
+            // borderColor: partten.getColor("gray")
+          },
+          emphasis: {
+            iconStyle: {
+              // borderColor: partten.getColor("gray")
             },
-            // 是否显示图表图例
-            showLegend: {
-                type: Boolean,
-                default: true,
+          },
+        },
+        tooltip: {
+          trigger: "axis",
+          axisPointer: {
+            type: "cross",
+          },
+          formatter(data) {
+            let label = ``;
+            data.forEach((ele, index) => {
+              label += `<p>
+                              <span style="background:${
+                                that.color[index]
+                              };margin-right:5px;display:inline-block;width:10px;height:10px;border-radius:50%;over-flow:hidden;"></span>
+                              <span>${
+                                ele.seriesName
+                              }:<span style="font-weight: 700;margin-left:10px">${
+                ele.value || 0
+              }</span></span>
+                            </p>`;
+            });
+            return label;
+          },
+        },
+        brush: {
+          seriesIndex: [2, 3],
+          yAxisIndex: 0,
+          transformable: true,
+          throttleType: "debounce",
+          throttleDelay: 1000,
+          removeOnClick: true,
+          brushType: "polygon",
+          brushMode: "multiple",
+          brushStyle: {
+            borderWidth: 1,
+            borderColor: "#ff2424",
+          },
+        },
+        dataZoom: [
+          {
+            type: "inside", //图表下方的伸缩条
+            show: true, //是否显示
+            realtime: true, //拖动时,是否实时更新系列的视图
+            start: 0, //伸缩条开始位置(1-100),可以随时更改
+            end: 100, //伸缩条结束位置(1-100),可以随时更改
+          },
+          {
+            type: "slider", //图表下方的伸缩条
+            show: true, //是否显示
+            realtime: true, //拖动时,是否实时更新系列的视图
+            start: 0, //伸缩条开始位置(1-100),可以随时更改
+            end: 100, //伸缩条结束位置(1-100),可以随时更改
+          },
+        ],
+        textStyle: {
+          fontSize: util.vh(16),
+          color: theme ? "#000" : "#fff",
+        },
+        //图例-每一条数据的名字
+        legend: {
+          show: that.showLegend,
+          // data: [ "拟合功率", "保证功率","无用点", "有用点", "Cp值"],
+          right: 170,
+          type: "scroll",
+          top: "5",
+          // icon: "circle",
+          itemWidth: 6,
+          // inactiveColor: that.echartsTheme === "dark" ?
+          //     partten.getColor("gray") : "#000",
+          textStyle: {
+            color: theme ? "#000" : "#fff",
+            fontSize: 14,
+          },
+        },
+        grid: {
+          top: 58,
+          left: 40,
+          right: 48,
+          // bottom: 24,
+        },
+        //x轴
+        xAxis: [
+          {
+            name: "时间",
+            nameTextStyle: {
+              color: theme ? "#000" : "#fff",
             },
-            // 是否默认采用笔刷模式
-            brushSelected: {
-                type: Boolean,
-                default: false,
+            type: "category",
+            boundaryGap: true,
+            data: that.xAxisData || [],
+            axisLabel: {
+              formatter: "{value}",
             },
-            theme: {
-                type: Boolean,
-                default: false,
+            splitLine: {
+              show: false,
             },
-            echartsTheme: {
-                type: String,
-                default: '',
+            smooth: true,
+            textStyle: {
+              // color: that.echartsTheme === "dark" ?
+              //     partten.getColor("gray") : "#000",
             },
-        },
-        data() {
-            return {
-                id: "",
-                chart: null,
-                color: [
-                    "#05bb4c",
-                    "#4b55ae",
-                    "#fa8c16",
-                    "#f8de5b",
-                    "#1a93cf",
-                    "#c531c7",
-                    "#bd3338",
-                ],
-                theme: 'dark'
-            };
-        },
-        computed: {
-            collapse() {
-                return this.$store.state.collapse
-            }
-        },
-        watch: {
-            height() {
-                if (this.chart) {
-                    this.chart.resize()
-                }
+          },
+        ],
+        //y轴没有显式设置,根据值自动生成y轴
+        yAxis: [
+          {
+            type: "value",
+            splitLine: {
+              show: false,
             },
-            collapse(val) {
-                if (this.chart) {
-                    setTimeout(() => {
-                        this.chart.resize()
-                    }, 300)
-                }
-            }
-        },
-        methods: {
-            resize() {},
-            getColorFn() {
-                let arr = []
-                this.seriesAllData.forEach((item, index) => {
-                    let obj = {
-                        gt: index,
-                        lt: index + 1
-                    }
-                    if (item.tag === 'tj') {
-                        obj.color = "#FF5378"
-                    } else {
-                        obj.color = "#05BB4C"
-                    }
-                    arr.push(obj)
-                })
-                return arr
+            position: "left",
+            min: 0,
+            max: 100,
+            name: "度",
+            nameTextStyle: {
+              color: theme ? "#000" : "#fff",
             },
-            getToolTipFn(params) {
-                let tit = ''
-                this.seriesAllData.forEach((item, index) => {
-                    if (params[0].axisValue === item.time && params[0].data === item.value) {
-                        tit = item.tag === 'tj' ? '停机' : '并网'
-                    }
-                })
-                let str = `<span style="display:inline-block;margin-bottom: 5px">${params[0].axisValue}</span></br>`
-                let str2 = `<div style="margin-bottom: 5px">
-                    <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${params[0].color};\"></span>&nbsp;
-                    <span style="display:inline-block;">${tit}:</span>&nbsp;&nbsp;<span>${params[0].value}</span>
-                        </div>`
-                return str + str2
+          },
+          {
+            type: "value",
+            splitLine: {
+              show: false,
             },
-            initChart() {
-                const that = this;
-                echarts.registerTheme('chartTheme', chartTheme)
-                let myChart = echarts.init(document.getElementById(this.id), 'dark');
-                that.chart = myChart
-                //指定图表的配置项和数据
-                const option = {
-                    backgroundColor: '',
-                    //标题
-                    title: {
-                        text: that.chartTitle,
-                        right: 440,
-                        top: 4,
-                        textStyle: {
-                            fontSize: 14,
-                            // color: that.echartsTheme === "dark" ? partten.getColor("grayl") : "#000",
-                        },
-                    },
-                    // backgroundColor:
-                    //   that.theme === "dark"
-                    //     ? "rgba(0,0,0,0.4)"
-                    //     : "rgba(255,255,255,0.5)",
-                    //工具箱
-                    // color: [
-                    //     "#cda819",
-                    //     "rgb(255,0,0)",
-                    //     "#0098d9",
-                    //     "#a9e3f199",
-                    //     "#a9e3f199",
-                    //     "#005eaa",
-                    //     "#0a4468",
-                    //     "#32a487"
-                    // ],
-                    color: ['#7981AF', '#1C99FF', '#E57F25'],
-                    toolbox: {
-                        show: false,
-                        x: "right",
-                        position: [10, 10],
-                        // backgroundColor:'rgba(0,0,0,0.4)',
-                        // borderColor: partten.getColor("gray"),
-                        textStyle: {
-                            fontSize: util.vh(16),
-                            // color: partten.getColor("gray")
-                        },
-                        iconStyle: {
-                            // borderColor: partten.getColor("gray")
-                        },
-                        emphasis: {
-                            iconStyle: {
-                                // borderColor: partten.getColor("gray")
-                            },
-                        },
-                    },
-                    tooltip: {
-                        trigger: "axis",
-                        axisPointer: {
-                            type: "cross",
-                        },
-                        // backgroundColor: "rgba(0,0,0,0.4)",
-                        // borderColor: partten.getColor("gray"),
-                        // textStyle: {
-                        //   fontSize: util.vh(16),
-                        //   color: partten.getColor("gray"),
-                        // },
-                        // formatter(params) {
-                        //     let str = that.getToolTipFn(params)
-                        //     return str
-                        //     // return params.value ? .x ?
-                        //     //     `${params.seriesName}<br />风速:${params.value.x}m/s<br />功率:${params.value.y}kW` :
-                        //     //     `${params.name}`;
-                        // },
-                    },
-                    brush: {
-                        seriesIndex: [2, 3],
-                        yAxisIndex: 0,
-                        transformable: true,
-                        throttleType: "debounce",
-                        throttleDelay: 1000,
-                        removeOnClick: true,
-                        brushType: "polygon",
-                        brushMode: "multiple",
-                        brushStyle: {
-                            borderWidth: 1,
-                            borderColor: "#ff2424",
-                        },
-                    },
-                    dataZoom: [{
-                            type: "inside", //图表下方的伸缩条
-                            show: true, //是否显示
-                            realtime: true, //拖动时,是否实时更新系列的视图
-                            start: 0, //伸缩条开始位置(1-100),可以随时更改
-                            end: 5, //伸缩条结束位置(1-100),可以随时更改
-                        },
-                        {
-                            type: "slider", //图表下方的伸缩条
-                            show: true, //是否显示
-                            realtime: true, //拖动时,是否实时更新系列的视图
-                            start: 0, //伸缩条开始位置(1-100),可以随时更改
-                            end: 5, //伸缩条结束位置(1-100),可以随时更改
-                        },
-                    ],
-                    textStyle: {
-                        fontSize: util.vh(16),
-                        color: that.echartsTheme === "dark" ? "#fff" : "#000",
-                    },
-                    // visualMap: {
-                    //     type: "piecewise",
-                    //     show: false,
-                    //     dimension: 0,
-                    //     seriesIndex: 0,
-                    //     // pieces: that.getColorFn()
-                    // },
-                    //图例-每一条数据的名字
-                    legend: {
-                        show: that.showLegend,
-                        // data: [ "拟合功率", "保证功率","无用点", "有用点", "Cp值"],
-                        right: 170,
-                        type: 'scroll',
-                        top: "5",
-                        // icon: "circle",
-                        itemWidth: 6,
-                        // inactiveColor: that.echartsTheme === "dark" ?
-                        //     partten.getColor("gray") : "#000",
-                        textStyle: {
-                            color: that.echartsTheme === "dark" ?
-                                partten.getColor("grayl") : "#000",
-                            fontSize: 14,
-                        },
+            min: 0,
+            max: 25,
+            // splitLine: {
+            //     lineStyle: {
+            //         color: ['#393F4D']
+            //     }
+            // },
+            name: "单位:m/s",
+          },
+        ],
+        animation: true,
+        dataset: that.dataSet.length ? JSON.parse(that.dataSet) : [],
+        //数据-data是最终要显示的数据
+        series: that.chartData,
+      };
 
-                    },
-                    grid: {
-                        top: 58,
-                        left: 40,
-                        right: 48,
-                        // bottom: 24,
-                    },
-                    //x轴
-                    xAxis: [{
-                        name: '时间',
-                        nameTextStyle: {
-                            color: '#838383'
-                        },
-                        type: "category",
-                        boundaryGap: true,
-                        data: that.xAxisData || [],
-                        axisLabel: {
-                            formatter: "{value}",
-                        },
-                        splitLine: {
-                            show: false,
-                        },
-                        smooth: true,
-                        textStyle: {
-                            // color: that.echartsTheme === "dark" ?
-                            //     partten.getColor("gray") : "#000",
-                        },
-                    }, ],
-                    //y轴没有显式设置,根据值自动生成y轴
-                    yAxis: [{
-                        type: 'value',
-                        splitLine: {
-                            show: false
-                        },
-                        position: 'left',
-                        min: 0,
-                        max: 100,
-                        name: '度',
-                        nameTextStyle: {
-                            color: '#838383'
-                        },
-                    }, {
-                        type: 'value',
-                        splitLine: {
-                            show: false
-                        },
-                        min: 0,
-                        max: 25,
-                        // splitLine: {
-                        //     lineStyle: {
-                        //         color: ['#393F4D']
-                        //     }
-                        // },
-                        name: '单位:m/s'
-                    }],
-                    animation: true,
-                    dataset: that.dataSet.length ? JSON.parse(that.dataSet) : [],
-                    //数据-data是最终要显示的数据
-                    series: that.seriesData,
-                };
+      option.legend.selected = {
+        叶片1: true,
+        叶片2: true,
+        叶片3: true,
+        风速: false,
+      };
 
-                option.legend.selected = {
-                    '叶片1': true,
-                    '叶片2': true,
-                    '叶片3': true,
-                    '风速': false
-                };
+      that.resize = function () {
+        myChart.resize();
+      };
 
-                that.resize = function () {
-                    myChart.resize();
-                };
+      window.addEventListener("resize", that.resize);
 
-                window.addEventListener("resize", that.resize);
+      if (markItem.yp1) {
+        option.dataZoom = that.handleRowClick(markItem);
+      }
 
-                myChart.setOption(option);
-                // if (that.brushSelected) {
-                //   myChart.dispatchAction({
-                //     type: "takeGlobalCursor",
-                //     // 如果想变为“可刷选状态”,必须设置。不设置则会关闭“可刷选状态”。
-                //     key: "brush",
-                //     brushOption: {
-                //       seriesIndex: [2,3],
-                //       yAxisIndex: 0,
-                //       transformable: true,
-                //       throttleType: "debounce",
-                //       throttleDelay: 1000,
-                //       removeOnClick: true,
-                //       brushType: "polygon",
-                //       brushMode: "multiple",
-                //       brushStyle: {
-                //         borderWidth: 1,
-                //         color: "rgba(255,36,36,0.2)",
-                //         borderColor: "#ff2424",
-                //       },
-                //     },
-                //   });
-                // }
-                myChart.off("brushSelected");
-                myChart.on("brushSelected", (params) => {
-                    that.$emit("getSelected", params.batch || []);
-                });
-                myChart.off('click')
-                myChart.on('click', params => {
-                    // if(params.componentType === 'markArea'){
-                    //   myChart.dispatchAction({
-                    //     type: 'brush',
-                    //     areas: [
-                    //       {
-                    //         xAxisIndex: 0,
-                    //         brushType: 'lineX',
-                    //         coordRange: [params.data.coord[0][0], params.data.coord[1][0]]
-                    //       },
-                    //     ]
-                    //   });
-                    // }
-                })
-            },
-        },
-        created() {
-            this.id = "chart-" + util.newGUID();
-        },
-        mounted() {
-            // this.$nextTick(() => {
-            this.$el.style.width = this.width;
-            this.$el.style.height = this.height;
-            this.initChart();
-            // });
-        },
-        updated() {
-            // console.log('update')
-            let myChart = echarts.init(document.getElementById(this.id));
-            myChart.dispose();
-            this.$nextTick(() => {
-                this.initChart();
-            });
-        },
-        unmounted() {
-            window.removeEventListener("resize", this.resize);
+      myChart.setOption(option);
+      // if (that.brushSelected) {
+      //   myChart.dispatchAction({
+      //     type: "takeGlobalCursor",
+      //     // 如果想变为“可刷选状态”,必须设置。不设置则会关闭“可刷选状态”。
+      //     key: "brush",
+      //     brushOption: {
+      //       seriesIndex: [2,3],
+      //       yAxisIndex: 0,
+      //       transformable: true,
+      //       throttleType: "debounce",
+      //       throttleDelay: 1000,
+      //       removeOnClick: true,
+      //       brushType: "polygon",
+      //       brushMode: "multiple",
+      //       brushStyle: {
+      //         borderWidth: 1,
+      //         color: "rgba(255,36,36,0.2)",
+      //         borderColor: "#ff2424",
+      //       },
+      //     },
+      //   });
+      // }
+      myChart.off("brushSelected");
+      myChart.on("brushSelected", (params) => {
+        that.$emit("getSelected", params.batch || []);
+      });
+      myChart.off("click");
+      myChart.on("click", (params) => {
+        // if(params.componentType === 'markArea'){
+        //   myChart.dispatchAction({
+        //     type: 'brush',
+        //     areas: [
+        //       {
+        //         xAxisIndex: 0,
+        //         brushType: 'lineX',
+        //         coordRange: [params.data.coord[0][0], params.data.coord[1][0]]
+        //       },
+        //     ]
+        //   });
+        // }
+      });
+    },
+
+    // 处理表格行点击事件
+    handleRowClick(row) {
+      const that = this;
+      const index = row.dataIndex;
+      const totalDataLength = that.chartData[1].data.length;
+
+      // 计算点击点周围的缩放范围
+      let zoomRange = 100; // 可视区域包含的数据点数量
+      // let startIndex = Math.max(index - Math.floor(zoomRange / 2), 0);
+      // let endIndex = Math.min(startIndex + zoomRange, totalDataLength);
+      let startIndex = index - zoomRange / 2 < 0 ? 0 : index - zoomRange / 2;
+      let endIndex =
+        index + zoomRange / 2 > totalDataLength
+          ? totalDataLength
+          : index + zoomRange / 2;
+
+      // 将百分比转换为相对于数据集的百分比
+      let startPercent = parseInt((startIndex / totalDataLength) * 100);
+      let endPercent = parseInt((endIndex / totalDataLength) * 100);
+      return [
+        {
+          // type: "slider",
+          type: "inside",
+          show: false,
+          realtime: true, //拖动时,是否实时更新系列的视图
+          start: startPercent,
+          end: endPercent,
         },
-    };
+      ];
+    },
+  },
+  created() {
+    this.id = "chart-" + util.newGUID();
+    this.changeColor();
+    this.chartData = JSON.parse(JSON.stringify(this.seriesData));
+  },
+  mounted() {
+    this.$el.style.width = this.width;
+    this.$el.style.height = this.height;
+    this.initChart(this.markItem);
+  },
+  updated() {
+    let myChart = echarts.init(document.getElementById(this.id));
+    myChart.dispose();
+    this.$nextTick(() => {
+      this.initChart(this.markItem);
+    });
+  },
+  unmounted() {
+    this.markItem = {};
+    window.removeEventListener("resize", this.resize);
+  },
+
+  watch: {
+    "$store.state.theme"() {
+      this.changeColor();
+      this.initChart(this.markItem);
+    },
+    seriesData(data) {
+      this.chartData = JSON.parse(JSON.stringify(this.seriesData));
+    },
+  },
+};
 </script>
 
 <style lang="less">
-    .chart {
-        width: 100%;
-        height: 100%;
-        display: inline-block;
-    }
+.chart {
+  width: 100%;
+  height: 100%;
+  display: inline-block;
+}
 </style>

+ 91 - 1
src/views/generatingCapacity/dataAnalysis/angleAnalysis/index.vue

@@ -32,6 +32,7 @@
             <el-tab-pane label="图表展示" name="1"> </el-tab-pane>
             <el-tab-pane label="桨距角风速曲线" name="2"> </el-tab-pane>
             <el-tab-pane label="表格数据" name="3"> </el-tab-pane>
+            <el-tab-pane :label="`异常测点 (${abnormalPoint.length}个)`" name="4"> </el-tab-pane>
             <div v-if="activeTab === '3'" :style="{ height: tableHeight }">
               <table-cop
                 class=""
@@ -44,7 +45,7 @@
                 :rowstyle="true"
               ></table-cop>
             </div>
-            <div v-if="activeTab === '1'" :style="{ height: tableHeight }">
+            <div v-show="activeTab === '1'" :style="{ height: tableHeight }">
               <!-- :height="`calc( ${tableHeight})`" -->
               <CurrentScatterChart
                 ref="chartRef"
@@ -76,6 +77,44 @@
                 :series="lineSeries"
               ></bar-chart-cop>
             </div>
+            <div v-if="activeTab === '4'" :style="{ height: tableHeight }">
+              <el-table
+                :data="abnormalPoint"
+                style="width: 100%"
+                :max-height="tableHeight"
+              >
+                <el-table-column
+                  prop="date"
+                  label="异常时间 (点击定位至图表位置)"
+                  width="400"
+                  align="center"
+                >
+                  <template #default="scoped">
+                    <p style="cursor: pointer" @click="createMark(scoped.row)">
+                      <span>{{ scoped.row.date }}</span>
+                    </p>
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  prop="yp1"
+                  label="叶片1"
+                  width="180"
+                  align="center"
+                />
+                <el-table-column
+                  prop="yp2"
+                  label="叶片2"
+                  width="180"
+                  align="center"
+                />
+                <el-table-column
+                  prop="yp3"
+                  label="叶片3"
+                  width="180"
+                  align="center"
+                />
+              </el-table>
+            </div>
           </el-tabs>
         </div>
       </div>
@@ -116,6 +155,12 @@ const funExcelChange = async (obj) => {
     ids: obj.id,
   };
 };
+
+const createMark = (markInfo) => {
+  activeTab.value = "1";
+  chartRef.value.initChart(markInfo);
+};
+
 /**tree 开始 */
 const treeData = ref([]);
 const actTreeNode = ref(null); //当前激活的treeNode
@@ -300,6 +345,26 @@ const funSubmit = async (params) => {
       xAxisIndex: 0,
     },
   ];
+
+  const exPoint = [];
+  seriesData.value?.[0]?.data?.forEach((ele, index) => {
+    const numEqual = [
+      ele,
+      seriesData.value[1].data[index],
+      seriesData.value[2].data[index],
+    ];
+    if (areNumbersDistinct(numEqual)) {
+      exPoint.push({
+        date: exTime[index],
+        yp1: numEqual[0],
+        yp2: numEqual[1],
+        yp3: numEqual[2],
+        dataIndex: index,
+      });
+    }
+  });
+
+  abnormalPoint.value = exPoint;
 };
 const linexAxis = reactive({
   type: "category",
@@ -362,6 +427,7 @@ watch(
   }
 );
 
+const abnormalPoint = ref([]);
 const initPageData = () => {
   treeData.value = funRepeatMap(
     JSON.parse(JSON.stringify(jsonData.treeData)),
@@ -475,9 +541,33 @@ const initPageData = () => {
     speedParams.value = {
       ids: obj.id,
     };
+
+    const exPoint = [];
+    seriesData.value?.[0]?.data?.forEach((ele, index) => {
+      const numEqual = [
+        ele,
+        seriesData.value[1].data[index],
+        seriesData.value[2].data[index],
+      ];
+      if (areNumbersDistinct(numEqual)) {
+        exPoint.push({
+          date: exTime[index],
+          yp1: numEqual[0],
+          yp2: numEqual[1],
+          yp3: numEqual[2],
+          dataIndex: index,
+        });
+      }
+    });
+
+    abnormalPoint.value = exPoint;
   }
 };
 
+const areNumbersDistinct = (arr) => {
+  return arr[0] !== arr[1] || arr[0] !== arr[2] || arr[1] !== arr[2];
+};
+
 /**mounted */
 onMounted(() => {
   initPageData();

+ 0 - 1
src/views/generatingCapacity/dataAnalysis/rateAnalysis/components/lineChart.vue

@@ -62,7 +62,6 @@ const props = defineProps({
 /**定义option */
 const option = computed({
   get() {
-    console.log(props.subtext, props.series);
     return {
       backgroundColor: "",
       color: [

+ 96 - 42
src/views/generatingCapacity/dataAnalysis/rateAnalysis/index.vue

@@ -51,7 +51,7 @@
                 style="height: 45%"
               >
                 <el-icon
-                  :style="!theme ? 'color: #fff' : ''"
+                  :style="`cursor: pointer; ${!theme ? 'color: #fff' : ''}`"
                   size="18"
                   @click="funActCop(item, 'chartCop' + (index + 1))"
                 >
@@ -72,7 +72,7 @@
               </el-col>
               <el-col :span="12" v-if="!!lineSeries.length" style="height: 45%">
                 <el-icon
-                  :style="!theme ? 'color: #fff' : ''"
+                  :style="`cursor: pointer; ${!theme ? 'color: #fff' : ''}`"
                   size="18"
                   @click="
                     funActCop(
@@ -103,7 +103,7 @@
               </el-col>
               <el-col :span="12" v-if="!!lineSeries.length" style="height: 45%">
                 <el-icon
-                  :style="!theme ? 'color: #fff' : ''"
+                  :style="`cursor: pointer; ${!theme ? 'color: #fff' : ''}`"
                   size="18"
                   @click="
                     funActCop(
@@ -193,6 +193,7 @@
       <el-form class="whitespace-nowrap" :inline="true" :model="queryForm">
         <el-form-item label="" class="!mb-0">
           <el-select
+            style="width: 150px"
             v-model="queryForm.checkIds"
             clearable
             @clear="checkAll = false"
@@ -500,25 +501,25 @@ const funSubmit = async () => {
             },
           },
           isRadar: false,
-          series:
-            // chart.roses.length ? chart.roses.map((o, index) => {
-            //     return {
-            //         type: 'bar',
-            //         data: o,
-            //         coordinateSystem: 'polar',
-            //         name: funText(index),
-            //         stack: 'a',
-            //         emphasis: {
-            //             focus: 'series'
-            //         }
-            //     }
-            // }) :
-            {
-              type: "bar",
-              data: chart.roses,
-              coordinateSystem: "polar",
-              name: "方位风速",
-            },
+          series: chart.roses.length
+            ? chart.roses.map((o, index) => {
+                return {
+                  type: "bar",
+                  data: o,
+                  coordinateSystem: "polar",
+                  name: funText(index),
+                  stack: "a",
+                  emphasis: {
+                    focus: "series",
+                  },
+                };
+              })
+            : {
+                type: "bar",
+                data: chart.roses,
+                coordinateSystem: "polar",
+                name: "方位风速",
+              },
         });
         chartId++;
         chartData.value.push({
@@ -603,6 +604,7 @@ const funSubmit = async () => {
       lineDataSet.value[0].source = lineRes.data[0].scatter.map((o) => {
         return [o.x + "", o.y];
       });
+      const lineSeriseMax = Math.max(...lineRes.data[0].count);
       lineSeries.value = [
         {
           name: "对风频次",
@@ -612,6 +614,17 @@ const funSubmit = async () => {
           smooth: true, //这个是把线变成曲线
           data: lineRes.data[0].count,
           yAxisIndex: 1,
+          markLine: {
+            data: [
+              {
+                yAxis: maxValue,
+                label: {
+                  show: false,
+                  formatter: "最高频次: {value}",
+                },
+              },
+            ],
+          },
         },
         {
           type: "effectScatter",
@@ -1042,6 +1055,17 @@ const funDiaSubmit = async () => {
                   data: chart.count,
                   yAxisIndex: 1,
                   large: true,
+                  markLine: {
+                    data: [
+                      {
+                        yAxis: Math.max(chart.count),
+                        label: {
+                          show: false,
+                          formatter: "最高频次: {value}",
+                        },
+                      },
+                    ],
+                  },
                 },
                 {
                   type: "effectScatter",
@@ -1196,6 +1220,7 @@ const initPageData = () => {
 
     chartData.value = [];
     for (const chart of jsonData.rosesData) {
+      let windMap = {};
       chartData.value.push({
         id: chartId,
         title: "",
@@ -1203,31 +1228,47 @@ const initPageData = () => {
         xAxis: {
           type: "category",
           boundaryGap: false,
-          data: ["北", "东北", "东", "东南", "南", "西南", "西", "西北"],
+          data: [
+            "北",
+            "",
+            "东北",
+            "",
+            "东",
+            "",
+            "东南",
+            "",
+            "南",
+            "",
+            "西南",
+            "",
+            "西",
+            "",
+            "西北",
+          ],
           splitLine: {
             show: true,
           },
         },
         isRadar: false,
-        series:
-          // chart.roses.length ? chart.roses.map((o, index) => {
-          //     return {
-          //         type: 'bar',
-          //         data: o,
-          //         coordinateSystem: 'polar',
-          //         name: funText(index),
-          //         stack: 'a',
-          //         emphasis: {
-          //             focus: 'series'
-          //         }
-          //     }
-          // }) :
-          {
-            type: "bar",
-            data: chart.roses,
-            coordinateSystem: "polar",
-            name: "方位风速",
-          },
+        series: chart.roses.length
+          ? chart.roses.map((o, index) => {
+              return {
+                type: "bar",
+                data: o,
+                coordinateSystem: "polar",
+                name: funText(index),
+                stack: "a",
+                emphasis: {
+                  focus: "series",
+                },
+              };
+            })
+          : {
+              type: "bar",
+              data: chart.roses,
+              coordinateSystem: "polar",
+              name: "方位风速",
+            },
       });
       chartId++;
       chartData.value.push({
@@ -1308,6 +1349,8 @@ const initPageData = () => {
     lineDataSet.value[0].source = jsonData.ratioData[0].scatter.map((o) => {
       return [o.x + "", o.y];
     });
+    const lineSeriseMax = Math.max(...jsonData.ratioData[0].count);
+
     lineSeries.value = [
       {
         name: "对风频次",
@@ -1317,6 +1360,17 @@ const initPageData = () => {
         smooth: true, //这个是把线变成曲线
         data: jsonData.ratioData[0].count,
         yAxisIndex: 1,
+        markLine: {
+          data: [
+            {
+              yAxis: lineSeriseMax,
+              label: {
+                show: false,
+                formatter: "最高频次: {value}",
+              },
+            },
+          ],
+        },
       },
       {
         type: "effectScatter",

+ 1 - 0
src/views/generatingCapacity/dataFilter/prepare/search.vue

@@ -136,6 +136,7 @@ export default {
       apiGetpowerpreparedata(query).then((res) => {
         if (res.code === 200) {
           ElMessage.success(res.msg);
+          this.$store.commit("setReadyProgress", 0);
         }
       });
     },

+ 2 - 0
src/views/generatingCapacity/dataFilter/process/index.vue

@@ -285,6 +285,7 @@ const funExport = async () => {
 /**table 结束 */
 /**search 开始 */
 const funSubmit = async (query) => {
+  query.xd = query.xd ? 1 : 0;
   if (!excelCheckIds.value.length) {
     ElMessage.error("请勾选要预处理的项");
     return false;
@@ -293,6 +294,7 @@ const funSubmit = async (query) => {
     ...query,
     ids: excelCheckIds.value.join(","),
   };
+
   const res = await httpRequest.get("/power/process/data", {
     params: params,
   });