Selaa lähdekoodia

修改合并问题性能分析-添加新逻辑

liujiejie 11 kuukautta sitten
vanhempi
commit
71f1e39848

+ 64 - 0
package-lock.json

@@ -41,6 +41,7 @@
         "vue-quill-editor": "^3.0.6",
         "vue-router": "^3.5.1",
         "vue-ruler-tool": "^1.2.4",
+        "vue-virtual-scroller": "^1.1.2",
         "vuex": "^3.6.2",
         "vuex-persistedstate": "^4.1.0",
         "workbox-webpack-plugin": "^7.1.0",
@@ -17836,6 +17837,12 @@
         "compute-scroll-into-view": "^1.0.20"
       }
     },
+    "node_modules/scrollparent": {
+      "version": "2.1.0",
+      "resolved": "https://repo.huaweicloud.com/repository/npm/scrollparent/-/scrollparent-2.1.0.tgz",
+      "integrity": "sha512-bnnvJL28/Rtz/kz2+4wpBjHzWoEzXhVg/TE8BeVGJHUqE8THNIRnDxDWMktwM+qahvlRdvlLdsQfYe+cuqfZeA==",
+      "license": "ISC"
+    },
     "node_modules/select-hose": {
       "version": "2.0.0",
       "resolved": "https://registry.npmmirror.com/select-hose/-/select-hose-2.0.0.tgz",
@@ -21179,6 +21186,12 @@
         }
       }
     },
+    "node_modules/vue-observe-visibility": {
+      "version": "0.4.6",
+      "resolved": "https://repo.huaweicloud.com/repository/npm/vue-observe-visibility/-/vue-observe-visibility-0.4.6.tgz",
+      "integrity": "sha512-xo0CEVdkjSjhJoDdLSvoZoQrw/H2BlzB5jrCBKGZNXN2zdZgMuZ9BKrxXDjNP2AxlcCoKc8OahI3F3r3JGLv2Q==",
+      "license": "MIT"
+    },
     "node_modules/vue-quill-editor": {
       "version": "3.0.6",
       "resolved": "https://registry.npmmirror.com/vue-quill-editor/-/vue-quill-editor-3.0.6.tgz",
@@ -21239,6 +21252,15 @@
         "node": ">=0.10"
       }
     },
+    "node_modules/vue-resize": {
+      "version": "0.4.5",
+      "resolved": "https://repo.huaweicloud.com/repository/npm/vue-resize/-/vue-resize-0.4.5.tgz",
+      "integrity": "sha512-bhP7MlgJQ8TIkZJXAfDf78uJO+mEI3CaLABLjv0WNzr4CcGRGPIAItyWYnP6LsPA4Oq0WE+suidNs6dgpO4RHg==",
+      "license": "MIT",
+      "peerDependencies": {
+        "vue": "^2.3.0"
+      }
+    },
     "node_modules/vue-router": {
       "version": "3.6.5",
       "resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-3.6.5.tgz",
@@ -21290,6 +21312,20 @@
       "dev": true,
       "license": "MIT"
     },
+    "node_modules/vue-virtual-scroller": {
+      "version": "1.1.2",
+      "resolved": "https://repo.huaweicloud.com/repository/npm/vue-virtual-scroller/-/vue-virtual-scroller-1.1.2.tgz",
+      "integrity": "sha512-SkUyc7QHCJFB5h1Fya7LxVizlVzOZZuFVipBGHYoTK8dwLs08bIz/tclvRApYhksaJIm/nn51inzO2UjpGJPMQ==",
+      "license": "MIT",
+      "dependencies": {
+        "scrollparent": "^2.0.1",
+        "vue-observe-visibility": "^0.4.4",
+        "vue-resize": "^0.4.5"
+      },
+      "peerDependencies": {
+        "vue": "^2.6.11"
+      }
+    },
     "node_modules/vuex": {
       "version": "3.6.2",
       "resolved": "https://registry.npmmirror.com/vuex/-/vuex-3.6.2.tgz",
@@ -31793,6 +31829,7 @@
     },
     "mapbox-gl-shaders": {
       "version": "git+ssh://git@github.com/mapbox/mapbox-gl-shaders.git#de2ab007455aa2587c552694c68583f94c9f2747",
+      "integrity": "sha512-cWc3vjb+Hdq4+ZJ8PVTcQcKgLXy3UTX0uxITAFZn6KFbYxfE5sszbDBpqjr1sBCdh3EgAtjI9LueDZGgj1Vgrg==",
       "from": "mapbox-gl-shaders@github:mapbox/mapbox-gl-shaders#de2ab007455aa2587c552694c68583f94c9f2747",
       "requires": {
         "brfs": "^1.4.0"
@@ -31800,6 +31837,7 @@
     },
     "mapbox-gl-style-spec": {
       "version": "git+ssh://git@github.com/mapbox/mapbox-gl-style-spec.git#83b1a3e5837d785af582efd5ed1a212f2df6a4ae",
+      "integrity": "sha512-xRKZNeS0hOfIlz2Rn6t82+y5nPBNqjAGCl/laCq14rbg2qZCFiJJfI6CkWucdUlKLYzm766ghzXmGLyorp17Ow==",
       "from": "mapbox-gl-style-spec@github:mapbox/mapbox-gl-style-spec#83b1a3e5837d785af582efd5ed1a212f2df6a4ae",
       "requires": {
         "csscolorparser": "~1.0.2",
@@ -34834,6 +34872,11 @@
         "compute-scroll-into-view": "^1.0.20"
       }
     },
+    "scrollparent": {
+      "version": "2.1.0",
+      "resolved": "https://repo.huaweicloud.com/repository/npm/scrollparent/-/scrollparent-2.1.0.tgz",
+      "integrity": "sha512-bnnvJL28/Rtz/kz2+4wpBjHzWoEzXhVg/TE8BeVGJHUqE8THNIRnDxDWMktwM+qahvlRdvlLdsQfYe+cuqfZeA=="
+    },
     "select-hose": {
       "version": "2.0.0",
       "resolved": "https://registry.npmmirror.com/select-hose/-/select-hose-2.0.0.tgz",
@@ -37242,6 +37285,11 @@
         "watchpack": "^2.4.0"
       }
     },
+    "vue-observe-visibility": {
+      "version": "0.4.6",
+      "resolved": "https://repo.huaweicloud.com/repository/npm/vue-observe-visibility/-/vue-observe-visibility-0.4.6.tgz",
+      "integrity": "sha512-xo0CEVdkjSjhJoDdLSvoZoQrw/H2BlzB5jrCBKGZNXN2zdZgMuZ9BKrxXDjNP2AxlcCoKc8OahI3F3r3JGLv2Q=="
+    },
     "vue-quill-editor": {
       "version": "3.0.6",
       "resolved": "https://registry.npmmirror.com/vue-quill-editor/-/vue-quill-editor-3.0.6.tgz",
@@ -37291,6 +37339,12 @@
         }
       }
     },
+    "vue-resize": {
+      "version": "0.4.5",
+      "resolved": "https://repo.huaweicloud.com/repository/npm/vue-resize/-/vue-resize-0.4.5.tgz",
+      "integrity": "sha512-bhP7MlgJQ8TIkZJXAfDf78uJO+mEI3CaLABLjv0WNzr4CcGRGPIAItyWYnP6LsPA4Oq0WE+suidNs6dgpO4RHg==",
+      "requires": {}
+    },
     "vue-router": {
       "version": "3.6.5",
       "resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-3.6.5.tgz",
@@ -37338,6 +37392,16 @@
       "integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==",
       "dev": true
     },
+    "vue-virtual-scroller": {
+      "version": "1.1.2",
+      "resolved": "https://repo.huaweicloud.com/repository/npm/vue-virtual-scroller/-/vue-virtual-scroller-1.1.2.tgz",
+      "integrity": "sha512-SkUyc7QHCJFB5h1Fya7LxVizlVzOZZuFVipBGHYoTK8dwLs08bIz/tclvRApYhksaJIm/nn51inzO2UjpGJPMQ==",
+      "requires": {
+        "scrollparent": "^2.0.1",
+        "vue-observe-visibility": "^0.4.4",
+        "vue-resize": "^0.4.5"
+      }
+    },
     "vuex": {
       "version": "3.6.2",
       "resolved": "https://registry.npmmirror.com/vuex/-/vuex-3.6.2.tgz",

+ 1 - 0
package.json

@@ -41,6 +41,7 @@
     "vue-quill-editor": "^3.0.6",
     "vue-router": "^3.5.1",
     "vue-ruler-tool": "^1.2.4",
+    "vue-virtual-scroller": "^1.1.2",
     "vuex": "^3.6.2",
     "vuex-persistedstate": "^4.1.0",
     "workbox-webpack-plugin": "^7.1.0",

BIN
src.zip


+ 2 - 2
src/components/map/index.vue

@@ -196,8 +196,8 @@ export default {
         new TileLayer({
           source: new XYZ({
             // url: "http://127.0.0.1:8010/tiles/{z}/{x}/{y}.png", //本地
-            // url: "http://192.168.50.235/tiles/{z}/{x}/{y}.png", //内网
-            url: "http://106.120.102.238:18000/tiles/{z}/{x}/{y}.png", //外网
+            url: "http://192.168.50.235/tiles/{z}/{x}/{y}.png", //内网
+            // url: "http://106.120.102.238:18000/tiles/{z}/{x}/{y}.png", //外网
             // url: "http://10.96.137.5:9080/tiles/{z}/{x}/{y}.png", //大~#@唐
           }),
         }),

+ 3 - 0
src/main.js

@@ -34,8 +34,11 @@ Vue.prototype.$qs = qs;
 
 // dialog拖拽全屏
 import dialogDrag from "./views/health/dialogDrag";
+import { RecycleScroller } from "vue-virtual-scroller";
+
 Vue.directive("dialogDrag", dialogDrag);
 
+Vue.component("RecycleScroller", RecycleScroller);
 Vue.use(ElementUI);
 // 引入tailwind
 // https://www.tailwindcss.cn/docs/installation

+ 4 - 2
src/views/overview/components/cp_trend/index.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2025-01-09 18:06:09
- * @LastEditTime: 2025-01-16 16:14:46
+ * @LastEditTime: 2025-01-17 09:23:02
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/overview/components/cp_trend/index.vue
@@ -62,7 +62,9 @@
       </el-tabs>
       <el-row type="flex" class="row-bg" justify="end">
         <el-col :span="2" style="margin: 20px">
-          <el-button type="primary" size="small">提交评论</el-button>
+          <el-button type="primary" size="small" @click="handleComment"
+            >提交评论</el-button
+          >
         </el-col>
       </el-row>
     </div>

+ 27 - 2
src/views/overview/components/data_integrity_minute/index.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2025-01-09 17:54:02
- * @LastEditTime: 2025-01-14 15:00:53
+ * @LastEditTime: 2025-01-17 09:23:35
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/overview/data_integrity_minute/index.vue
@@ -51,7 +51,9 @@
       </el-tabs>
       <el-row type="flex" class="row-bg" justify="end">
         <el-col :span="2" style="margin: 20px">
-          <el-button type="primary" size="small">提交评论</el-button>
+          <el-button type="primary" size="small" @click="handleComment"
+            >提交评论</el-button
+          >
         </el-col>
       </el-row>
     </div>
@@ -118,6 +120,29 @@ export default {
     }
   },
   methods: {
+    async handleComment() {
+      try {
+        await analysisCommentEdit({
+          batchCode: this.initBatchCode,
+          analysisTypeCode: this.analysisTypeCode,
+          commentList: this.editableTabs.map((item) => {
+            return {
+              commentTypeCode: item.commentTypeCode,
+              comment: item.commentTypeName === "分析评论" ? this.comment : "",
+            };
+          }),
+        });
+        this.$message({
+          type: "success",
+          message: "保存成功",
+        });
+        this.comment = "";
+        this.getAnalysisDetail();
+      } catch (e) {
+        console.error(e);
+        this.loading = false;
+      }
+    },
     onSubmit() {
       console.log("submit!");
     },

+ 4 - 2
src/views/overview/components/fault_all/index.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2025-01-13 13:56:55
- * @LastEditTime: 2025-01-16 16:12:21
+ * @LastEditTime: 2025-01-17 09:23:56
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/overview/components/fault_all/index.vue
@@ -94,7 +94,9 @@
       </el-tabs>
       <el-row type="flex" class="row-bg" justify="end">
         <el-col :span="2" style="margin: 20px">
-          <el-button type="primary" size="small">提交评论</el-button>
+          <el-button type="primary" size="small" @click="handleComment"
+            >提交评论</el-button
+          >
         </el-col>
       </el-row>
     </div>

+ 4 - 2
src/views/overview/components/fault_unit/index.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2025-01-13 13:56:12
- * @LastEditTime: 2025-01-16 15:01:03
+ * @LastEditTime: 2025-01-17 09:24:03
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/overview/components/fault_unit/index.vue
@@ -88,7 +88,9 @@
       </el-tabs>
       <el-row type="flex" class="row-bg" justify="end">
         <el-col :span="2" style="margin: 20px">
-          <el-button type="primary" size="small">提交评论</el-button>
+          <el-button type="primary" size="small" @click="handleComment"
+            >提交评论</el-button
+          >
         </el-col>
       </el-row>
     </div>

+ 6 - 1
src/views/overview/components/min_pitch/index.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2025-01-09 18:08:13
- * @LastEditTime: 2025-01-16 15:47:47
+ * @LastEditTime: 2025-01-16 18:34:34
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/overview/components/min_pitch/index.vue
@@ -315,4 +315,9 @@ export default {
     overflow: hidden;
   }
 }
+.titleCharts {
+  font-size: 16px;
+  font-weight: 500;
+  margin-top: 20px;
+}
 </style>

+ 3 - 1
src/views/overview/components/pitch_tsr_cp/index.vue

@@ -59,7 +59,9 @@
       </el-tabs>
       <el-row type="flex" class="row-bg" justify="end">
         <el-col :span="2" style="margin: 20px">
-          <el-button type="primary" size="small">提交评论</el-button>
+          <el-button type="primary" size="small" @click="handleComment"
+            >提交评论</el-button
+          >
         </el-col>
       </el-row>
     </div>

+ 27 - 2
src/views/overview/components/power_curve/index.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2025-01-09 18:10:08
- * @LastEditTime: 2025-01-16 17:32:41
+ * @LastEditTime: 2025-01-17 09:24:38
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/overview/components/power_curve/index.vue
@@ -153,7 +153,9 @@
       </el-tabs>
       <el-row type="flex" class="row-bg" justify="end">
         <el-col :span="2" style="margin: 20px">
-          <el-button type="primary" size="small">提交评论</el-button>
+          <el-button type="primary" size="small" @click="handleComment"
+            >提交评论</el-button
+          >
         </el-col>
       </el-row>
     </div>
@@ -233,6 +235,29 @@ export default {
     }
   },
   methods: {
+    async handleComment() {
+      try {
+        await analysisCommentEdit({
+          batchCode: this.initBatchCode,
+          analysisTypeCode: this.analysisTypeCode,
+          commentList: this.editableTabs.map((item) => {
+            return {
+              commentTypeCode: item.commentTypeCode,
+              comment: item.commentTypeName === "分析评论" ? this.comment : "",
+            };
+          }),
+        });
+        this.$message({
+          type: "success",
+          message: "保存成功",
+        });
+        this.comment = "";
+        this.getAnalysisDetail();
+      } catch (e) {
+        console.error(e);
+        this.loading = false;
+      }
+    },
     onSubmit() {
       console.log("submit!");
     },

+ 281 - 1
src/views/overview/components/power_scatter_2D/index.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2025-01-09 18:10:35
- * @LastEditTime: 2025-01-10 09:17:39
+ * @LastEditTime: 2025-01-17 09:25:08
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/overview/components/power_scatter_2D/index.vue
@@ -15,3 +15,283 @@ export default {
 };
 </script>
 <style scoped lang="scss"></style>
+<template>
+  <div class="type-variable">
+    <!-- 逐月有功功率散点2D分析 -->
+    <div class="left">
+      <FilterChart
+        :windList="windEngineGroupList"
+        @getEnfineList="getEnfineList"
+        @handlePrevious="handlePrevious"
+        @handleNext="handleNext"
+      ></FilterChart>
+      <el-alert type="info" :closable="false">
+        <template v-slot:title>
+          <div style="display: flex; align-items: center">
+            <i
+              class="el-icon-info"
+              style="font-size: 20px; margin-right: 5px"
+            ></i>
+            <h3>分析说明:</h3>
+          </div>
+        </template>
+        <div style="font-size: 12px; margin-top: 10px">
+          风向玫瑰图是一种表示某地不同风向出现频率分布的图表。
+        </div>
+      </el-alert>
+      <div class="titleCharts">分析分图 :</div>
+      <div class="charts" v-if="diagramRelationsDatas">
+        <template v-for="(itemChart, indChart) in diagramRelationsDatas">
+          <WindRoseChart
+            :key="itemChart.fieldEngineCode + indChart"
+            :inds="indChart"
+            :ref="itemChart.fieldEngineCode"
+            :fileAddr="itemChart.fileAddr"
+          ></WindRoseChart>
+        </template>
+      </div>
+      <el-empty description="暂无分析记录" v-else></el-empty>
+
+      <el-tabs value="first">
+        <el-tab-pane label="意见描述" name="first">
+          <TinymceEditor
+            ref="editor"
+            v-model="comment"
+            @input="handleEditorInput($event)"
+            @onClick="onClick"
+          >
+          </TinymceEditor>
+        </el-tab-pane>
+      </el-tabs>
+      <el-row type="flex" class="row-bg" justify="end">
+        <el-col :span="2" style="margin: 20px">
+          <el-button type="primary" size="small" @click="handleComment"
+            >提交评论</el-button
+          >
+        </el-col>
+      </el-row>
+    </div>
+    <div class="right">
+      <DicCard
+        :batchCode="initBatchCode"
+        :analysisTypeCode="analysisTypeCode"
+        :commentDescriptionVos="commentDescriptionVos"
+      >
+      </DicCard>
+    </div>
+  </div>
+</template>
+
+<script>
+import WindRoseChart from "@/views/performance/components/chartsCom/WindRoseChart.vue";
+import DicCard from "@/views/overview/components/dicCard/index.vue";
+import FilterChart from "@/views/overview/components/filterChart/index.vue";
+import TinymceEditor from "@/components/Tinymce.vue";
+import { analysisDetail, queryAnalysisedEngine } from "@/api/performance";
+
+export default {
+  name: "windDirectionFrequency",
+  components: {
+    DicCard,
+    FilterChart,
+    TinymceEditor,
+    WindRoseChart,
+  },
+  props: {
+    initBatchCode: {
+      default: "",
+      type: String,
+    },
+    analysisTypeCode: {
+      default: "",
+      type: String,
+    },
+    batchCodeList: {
+      default: "",
+      type: Array,
+    },
+  },
+  data() {
+    return {
+      form: {
+        value2: "",
+      },
+      comment: "",
+      options: [],
+      windEngineGroupList: [], //批次风机列表
+      fieldEngineCodes: [], //选中风机
+      generalFilesDatas: [], //总图
+      diagramRelationsDatas: [], //分图
+      commentDescriptionVos: [], //评论列表
+      editableTabs: [],
+    };
+  },
+  watch: {
+    initBatchCode(newVal) {
+      if (newVal) {
+        this.fetchData(); // 调用合并后的函数
+      }
+    },
+    analysisTypeCode(newVal) {
+      if (newVal) {
+        this.fetchData(); // 调用合并后的函数
+      }
+    },
+  },
+  mounted() {
+    if (this.initBatchCode && this.analysisTypeCode) {
+      this.fetchData(); // 调用合并后的函数
+    }
+  },
+  methods: {
+    async handleComment() {
+      try {
+        await analysisCommentEdit({
+          batchCode: this.initBatchCode,
+          analysisTypeCode: this.analysisTypeCode,
+          commentList: this.editableTabs.map((item) => {
+            return {
+              commentTypeCode: item.commentTypeCode,
+              comment: item.commentTypeName === "分析评论" ? this.comment : "",
+            };
+          }),
+        });
+        this.$message({
+          type: "success",
+          message: "保存成功",
+        });
+        this.comment = "";
+        this.getAnalysisDetail();
+      } catch (e) {
+        console.error(e);
+        this.loading = false;
+      }
+    },
+    onSubmit() {
+      console.log("submit!");
+    },
+    // 合并后的函数,处理数据请求
+    async fetchData() {
+      try {
+        console.log(
+          this.initBatchCode,
+          this.analysisTypeCode,
+          "请求详情 分钟级"
+        );
+        // 获取分析详情
+        await this.getAnalysisDetail();
+
+        // 获取风机列表
+        await this.getWindEnfineList(this.initBatchCode, this.analysisTypeCode);
+      } catch (err) {
+        console.error("Failed to fetch data:", err);
+      }
+    },
+    // 获取分析详情接口
+    async getAnalysisDetail() {
+      try {
+        const result = await analysisDetail({
+          batchCode: this.initBatchCode,
+          analysisTypeCode: this.analysisTypeCode,
+          fieldEngineCodes:
+            this.fieldEngineCodes.length === 0
+              ? undefined
+              : this.fieldEngineCodes.join(","),
+        });
+        if (
+          result.data &&
+          result.data[0] &&
+          result.data[0].commentTypeRelations
+        ) {
+          this.editableTabs = result.data[0].commentTypeRelations;
+        }
+        //当前评论展示获取
+        if (
+          result.data &&
+          result.data[0] &&
+          result.data[0].commentDescriptionVos
+        ) {
+          this.commentDescriptionVos = result.data[0].commentDescriptionVos;
+        }
+        this.generalFilesDatas =
+          result.data && result.data[0] && result.data[0].generalFiles; //总图数据
+        this.diagramRelationsDatas =
+          result.data &&
+          result.data[0] &&
+          result.data[0].diagramRelations.filter((item) =>
+            item.fileAddr.endsWith(".json")
+          );
+        console.log(this.diagramRelationsDatas, "this.diagramRelationsDatas");
+      } catch (err) {
+        console.error("Failed to fetch analysis details:", err);
+      }
+    },
+
+    // 请求风机列表
+    async getWindEnfineList(batchCode, analysisTypeCode) {
+      // console.log("请求风机列表 分钟级");
+      const resEngineList = await queryAnalysisedEngine({
+        batchCode: batchCode,
+        analysisTypeCode,
+      });
+      this.windEngineGroupList = resEngineList.data;
+    },
+    handleEditorInput(index, newVal) {
+      // 更新对应的 comment 值
+      // 如果该功能没有实现,可以删除这个方法
+    },
+    //获取选中风机list
+    getEnfineList(data) {
+      this.fieldEngineCodes = data;
+      this.getAnalysisDetail();
+    },
+    //下一条
+    handleNext() {
+      const index = this.batchCodeList.findIndex(
+        (item) => item === this.initBatchCode
+      );
+      if (index === this.batchCodeList.length - 1) {
+        this.$message.warning("已经是最后一个分析结果了");
+        return;
+      }
+      this.$emit("setInitBathCode", this.batchCodeList[index + 1]);
+    },
+    //上一条
+    handlePrevious() {
+      const index = this.batchCodeList.findIndex(
+        (item) => item === this.initBatchCode
+      );
+      if (index === 0) {
+        this.$message.warning("没有上一条了");
+        return;
+      }
+      this.$emit("setInitBathCode", this.batchCodeList[index - 1]);
+    },
+    onClick() {},
+  },
+};
+</script>
+<style scoped lang="scss">
+.type-variable {
+  display: flex;
+  height: 90%;
+  overflow: hidden;
+  .left {
+    width: 30%;
+    height: 100%;
+    overflow: auto;
+    padding: 20px;
+    flex: 1;
+  }
+  .right {
+    width: 250px;
+    height: 100%;
+    overflow: hidden;
+  }
+}
+.titleCharts {
+  font-size: 16px;
+  font-weight: 500;
+  margin-top: 20px;
+}
+</style>

+ 305 - 3
src/views/overview/components/rated_power_windspeed/index.vue

@@ -1,17 +1,319 @@
 <!--
  * @Author: your name
  * @Date: 2025-01-09 18:10:47
- * @LastEditTime: 2025-01-10 09:17:15
+ * @LastEditTime: 2025-01-17 09:25:18
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/overview/components/rated_power_windspeed/index.vue
 -->
+
 <template>
-  <div>额定功率和风速分析</div>
+  <div class="type-variable">
+    <!-- 额定功率和风速分析--只有分图不存在总图 -->
+    <div class="left">
+      <FilterChart
+        :windList="windEngineGroupList"
+        @getEnfineList="getEnfineList"
+        @handlePrevious="handlePrevious"
+        @handleNext="handleNext"
+      ></FilterChart>
+      <el-alert type="info" :closable="false">
+        <template v-slot:title>
+          <div style="display: flex; align-items: center">
+            <i
+              class="el-icon-info"
+              style="font-size: 20px; margin-right: 5px"
+            ></i>
+            <h3>分析说明:</h3>
+          </div>
+        </template>
+        <div style="font-size: 12px; margin-top: 10px">
+          在风力发电机组中,额定功率是指风机在特定设计条件下能够安全、有效地输出的最大功率。这个值是基于风机设计和电气系统的能力确定的,通常是在一定的风速下测定,称为额定风速。达到额定风速时,风机可以产生最大的功率输出,而不会超过其机械和电气组件的设计极限。
+        </div>
+      </el-alert>
+      <div class="titleCharts">分析总图 :</div>
+      <div
+        class="charts"
+        v-if="generalFilesDatas && generalFilesDatas.length > 0"
+      >
+        <template v-for="(itemChart, indChart) in generalFilesDatas">
+          <BoxLineCharts
+            :key="itemChart.batchCode + indChart"
+            @getResult="getResult"
+            @changeRequestNum="changeRequestNum"
+            :result="requestResult"
+            :index="indChart"
+            :ref="itemChart.batchCode + indChart"
+            :fileAddr="itemChart.fileAddr"
+          >
+          </BoxLineCharts>
+        </template>
+      </div>
+      <el-empty description="暂无分析记录" v-else></el-empty>
+      <el-tabs value="first">
+        <el-tab-pane label="意见描述" name="first">
+          <TinymceEditor
+            ref="editor"
+            v-model="comment"
+            @input="handleEditorInput($event)"
+            @onClick="onClick"
+          >
+          </TinymceEditor>
+        </el-tab-pane>
+      </el-tabs>
+      <el-row type="flex" class="row-bg" justify="end">
+        <el-col :span="2" style="margin: 20px">
+          <el-button type="primary" size="small" @click="handleComment"
+            >提交评论</el-button
+          >
+        </el-col>
+      </el-row>
+    </div>
+    <div class="right">
+      <DicCard
+        :batchCode="initBatchCode"
+        :analysisTypeCode="analysisTypeCode"
+        :commentDescriptionVos="commentDescriptionVos"
+      >
+      </DicCard>
+    </div>
+  </div>
 </template>
 <script>
+import DicCard from "@/views/overview/components/dicCard/index.vue";
+import FilterChart from "@/views/overview/components/filterChart/index.vue";
+import BoxLineCharts from "@/views/performance/components/chartsCom/BoxLineCharts.vue";
+import TinymceEditor from "@/components/Tinymce.vue";
+import { analysisDetail, queryAnalysisedEngine } from "@/api/performance";
+
 export default {
   name: "ratedPowerWindspeed",
+  components: {
+    DicCard,
+    FilterChart,
+    BoxLineCharts,
+    TinymceEditor,
+  },
+  props: {
+    initBatchCode: {
+      default: "",
+      type: String,
+    },
+    analysisTypeCode: {
+      default: "",
+      type: String,
+    },
+    batchCodeList: {
+      default: "",
+      type: Array,
+    },
+  },
+  data() {
+    return {
+      form: {
+        value2: "",
+      },
+
+      windEngineGroupList: [], //批次风机列表
+      fieldEngineCodes: [], //选中风机
+      comment: "",
+      options: [],
+      generalFilesDatas: [], //总图
+      diagramRelationsDatas: [], //分图,
+      requestResult: [], // 请求结果
+      requestRecord: [],
+      commentDescriptionVos: [], //评论列表
+      editableTabs: [],
+    };
+  },
+  watch: {
+    initBatchCode(newVal) {
+      if (newVal) {
+        this.fetchData(); // 调用合并后的函数
+      }
+    },
+    analysisTypeCode(newVal) {
+      if (newVal) {
+        this.fetchData(); // 调用合并后的函数
+      }
+    },
+  },
+  mounted() {
+    if (this.initBatchCode && this.analysisTypeCode) {
+      this.fetchData(); // 调用合并后的函数
+    }
+  },
+  methods: {
+    async handleComment() {
+      try {
+        await analysisCommentEdit({
+          batchCode: this.initBatchCode,
+          analysisTypeCode: this.analysisTypeCode,
+          commentList: this.editableTabs.map((item) => {
+            return {
+              commentTypeCode: item.commentTypeCode,
+              comment: item.commentTypeName === "分析评论" ? this.comment : "",
+            };
+          }),
+        });
+        this.$message({
+          type: "success",
+          message: "保存成功",
+        });
+        this.comment = "";
+        this.getAnalysisDetail();
+      } catch (e) {
+        console.error(e);
+        this.loading = false;
+      }
+    },
+    getResult({ index, result }) {
+      console.log(index, result);
+      this.$set(this.requestResult, index, result);
+      // this.requestResult[index] = result
+      this.requestRecord[index] = result;
+    },
+    changeRequestNum(index) {
+      if (index <= 1) {
+        this.$set(this.requestRecord, index, "start");
+        return;
+      }
+      if (index > 1) {
+        if (
+          this.requestRecord.every((item) =>
+            ["success", "error"].includes(item)
+          )
+        ) {
+          this.$set(this.requestRecord, index, "start");
+          this.$set(this.requestResult, index, "start");
+        } else {
+          this.$set(this.requestRecord, index, "start");
+        }
+      }
+    },
+    onSubmit() {
+      console.log("submit!");
+    },
+    // 合并后的函数,处理数据请求
+    async fetchData() {
+      try {
+        console.log(
+          this.initBatchCode,
+          this.analysisTypeCode,
+          "请求详情 分钟级"
+        );
+        // 获取分析详情
+        await this.getAnalysisDetail();
+
+        // 获取风机列表
+        await this.getWindEnfineList(this.initBatchCode, this.analysisTypeCode);
+      } catch (err) {
+        console.error("Failed to fetch data:", err);
+      }
+    },
+    // 获取分析详情接口
+    async getAnalysisDetail() {
+      try {
+        const result = await analysisDetail({
+          batchCode: this.initBatchCode,
+          analysisTypeCode: this.analysisTypeCode,
+          fieldEngineCodes:
+            this.fieldEngineCodes.length === 0
+              ? undefined
+              : this.fieldEngineCodes.join(","),
+        });
+        if (
+          result.data &&
+          result.data[0] &&
+          result.data[0].commentTypeRelations
+        ) {
+          this.editableTabs = result.data[0].commentTypeRelations;
+        }
+        //当前评论展示获取
+        if (
+          result.data &&
+          result.data[0] &&
+          result.data[0].commentDescriptionVos
+        ) {
+          this.commentDescriptionVos = result.data[0].commentDescriptionVos;
+        }
+        this.generalFilesDatas =
+          result.data && result.data[0] && result.data[0].generalFiles; //总图数据
+        this.diagramRelationsDatas =
+          result.data && result.data[0] && result.data[0].diagramRelations;
+      } catch (err) {
+        console.error("Failed to fetch analysis details:", err);
+      }
+    },
+
+    // 请求风机列表
+    async getWindEnfineList(batchCode, analysisTypeCode) {
+      // console.log("请求风机列表 分钟级");
+      const resEngineList = await queryAnalysisedEngine({
+        batchCode: batchCode,
+        analysisTypeCode,
+      });
+      this.windEngineGroupList = resEngineList.data;
+    },
+    handleEditorInput(index, newVal) {
+      // 更新对应的 comment 值
+      // 如果该功能没有实现,可以删除这个方法
+    },
+    //获取选中风机list
+    getEnfineList(data) {
+      this.fieldEngineCodes = data;
+      this.getAnalysisDetail();
+      console.log(this.fieldEngineCodes, "this.fieldEngineCodes");
+    },
+    //下一条
+    handleNext() {
+      const index = this.batchCodeList.findIndex(
+        (item) => item === this.initBatchCode
+      );
+      if (index === this.batchCodeList.length - 1) {
+        this.$message.warning("已经是最后一个分析结果了");
+        return;
+      }
+      this.$emit("setInitBathCode", this.batchCodeList[index + 1]);
+    },
+    //上一条
+    handlePrevious() {
+      const index = this.batchCodeList.findIndex(
+        (item) => item === this.initBatchCode
+      );
+      if (index === 0) {
+        this.$message.warning("没有上一条了");
+        return;
+      }
+      this.$emit("setInitBathCode", this.batchCodeList[index - 1]);
+    },
+    onClick() {},
+  },
 };
 </script>
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+.type-variable {
+  display: flex;
+  height: 90%;
+  overflow: hidden;
+
+  .left {
+    width: 30%;
+    height: 100%;
+    overflow: auto;
+    padding: 20px;
+    flex: 1;
+  }
+
+  .right {
+    width: 250px;
+    height: 100%;
+    overflow: hidden;
+  }
+}
+.titleCharts {
+  font-size: 16px;
+  font-weight: 500;
+  margin-top: 20px;
+}
+</style>

+ 5 - 171
src/views/overview/components/tsr_trend/index.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2025-01-10 09:10:39
- * @LastEditTime: 2025-01-16 16:46:39
+ * @LastEditTime: 2025-01-16 17:43:47
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/overview/components/tsr_trend/index.vue
@@ -44,7 +44,6 @@
             :index="indChart"
             :ref="itemChart.fieldEngineCode"
             :fileAddr="itemChart.fileAddr"
-            :chartData="chartData"
           >
           </BoxMarkersCharts>
         </template>
@@ -63,7 +62,9 @@
       </el-tabs>
       <el-row type="flex" class="row-bg" justify="end">
         <el-col :span="2" style="margin: 20px">
-          <el-button type="primary" size="small">提交评论</el-button>
+          <el-button type="primary" size="small" @click="handleComment"
+            >提交评论</el-button
+          >
         </el-col>
       </el-row>
     </div>
@@ -111,174 +112,7 @@ export default {
       form: {
         value2: "",
       },
-      chartData: {
-        analysisTypeCode: "叶尖速比时序分析",
-        engineCode: "WEM00026",
-        engineTypeName: "",
-        xaixs: "时间",
-        yaixs: "叶尖速比",
-        data: [
-          {
-            engineName: "#01",
-            engineCode: "WOG00935",
-            title: "机组-#01",
-            xData: [
-              "2023-10-01",
-              "2023-10-01",
-              "2023-10-01",
-              "2023-10-02",
-              "2023-10-02",
-              "2023-10-02",
-              "2023-10-02",
-              "2023-10-02",
-              "2023-12-06",
-              "2023-12-06",
-              "2023-12-06",
-              "2023-12-06",
-              "2023-12-06",
-              "2023-12-31",
-              "2023-12-31",
-              "2023-12-31",
-              "2023-12-31",
-              "2023-12-31",
-              "2023-12-31",
-            ],
-            yData: [
-              15.543049499999999, 13.862719824324321, 13.497911407894735,
-              14.247794979227915, 14.967381000000001, 12.827075038461539,
-              13.432265000000001,
-            ],
-            color: "lightgray",
-            width: 2,
-            type: "box_plot",
-            medians: {
-              x: [
-                "2023-10-01",
-                "2023-10-02",
-                "2023-10-03",
-                "2023-10-04",
-                "2023-10-05",
-                "2023-10-06",
-                "2023-10-07",
-                "2023-10-08",
-                "2023-10-09",
-                "2023-10-10",
-                "2023-10-11",
-                "2023-10-12",
-                "2023-10-13",
-                "2023-10-14",
-                "2023-10-15",
-                "2023-10-16",
-                "2023-10-17",
-                "2023-10-18",
-                "2023-10-19",
-                "2023-10-20",
-                "2023-10-21",
-                "2023-10-22",
-                "2023-10-23",
-                "2023-10-24",
-                "2023-10-25",
-                "2023-10-26",
-                "2023-10-27",
-                "2023-10-28",
-                "2023-10-29",
-                "2023-10-30",
-                "2023-10-31",
-                "2023-11-01",
-                "2023-11-02",
-                "2023-11-03",
-                "2023-11-04",
-                "2023-11-05",
-                "2023-11-06",
-                "2023-11-07",
-                "2023-11-08",
-                "2023-11-09",
-                "2023-11-10",
-                "2023-11-11",
-                "2023-11-12",
-                "2023-11-13",
-                "2023-11-14",
-                "2023-11-15",
-                "2023-11-16",
-                "2023-11-17",
-                "2023-11-18",
-                "2023-11-19",
-                "2023-11-20",
-                "2023-11-21",
-                "2023-11-22",
-                "2023-11-23",
-                "2023-11-24",
-                "2023-11-25",
-                "2023-11-26",
-                "2023-11-27",
-                "2023-11-28",
-                "2023-11-29",
-                "2023-11-30",
-                "2023-12-01",
-                "2023-12-02",
-                "2023-12-03",
-                "2023-12-04",
-                "2023-12-05",
-                "2023-12-06",
-                "2023-12-07",
-                "2023-12-08",
-                "2023-12-09",
-                "2023-12-10",
-                "2023-12-11",
-                "2023-12-12",
-                "2023-12-13",
-                "2023-12-14",
-                "2023-12-15",
-                "2023-12-16",
-                "2023-12-18",
-                "2023-12-19",
-                "2023-12-24",
-                "2023-12-25",
-                "2023-12-26",
-                "2023-12-27",
-                "2023-12-28",
-                "2023-12-29",
-                "2023-12-30",
-                "2023-12-31",
-              ],
-              y: [
-                12.061625714285714, 12.395244357750359, 11.442673266175094,
-                10.36922885625, 11.26786431617647, 12.788870794117651,
-                11.760086202205983, 12.355811707317073, 11.887048926997425,
-                11.56872207295834, 12.827075038461539, 12.827075038461539,
-                11.671397888696765, 11.369452874999999, 11.667242439889808,
-                12.20136406097561, 11.633858755813954, 12.664707, 12.5063981625,
-                9.904450346153844, 11.961112166666664, 14.713409602941177,
-                13.520430445945946, 13.520430445945946, 13.164629644736843,
-                11.945121375, 13.164629644736843, 13.164629644736843,
-                12.536452761102844, 13.314179153846153, 12.827075038461539,
-                11.369452874999999, 13.164629644736843, 14.293026471428572,
-                13.520430445945946, 11.420851848214285, 10.97608045539225,
-                11.746974608695654, 12.08018303574669, 12.20136406097561,
-                13.520430445945946, 11.910854542081818, 11.209977141891892,
-                11.772826225352112, 12.26579435260202, 11.850547264285714,
-                8.194810411764706, 9.570488812499999, 11.45028304109589,
-                13.520430445945946, 13.324327156249998, 11.683638147887326,
-                11.547232852941178, 11.690498094778956, 11.8731628125,
-                11.50377658039225, 12.559168830392247, 11.814091821757081,
-                11.182666105361738, 12.199092772058824, 10.883732578125,
-                11.209977141891892, 13.691575135135134, 13.895997572333401,
-                13.164629644736843, 13.520430445945946, 11.418212162100799,
-                10.782115418918918, 10.472739292609424, 10.116320835365855,
-                10.659461724999998, 10.421998468750001, 9.713248529513232,
-                10.232523066441793, 8.379173986952123, 8.798638547368421,
-                6.52254407794278, 10.26608825, 10.1317656, 9.950841214285715,
-                10.403152178571428, 10.310370442307692, 12.5063981625,
-                12.5063981625, 11.116798366666666, 11.167968899999998,
-                10.4579787094475,
-              ],
-              mode: "markers",
-              color: "orange",
-              size: 3,
-            },
-          },
-        ],
-      },
+
       windEngineGroupList: [], //批次风机列表
       fieldEngineCodes: [], //选中风机
       comment: "",

+ 27 - 2
src/views/overview/components/wind_direction_frequency/index.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2025-01-10 09:11:12
- * @LastEditTime: 2025-01-16 16:13:19
+ * @LastEditTime: 2025-01-17 09:25:34
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/overview/components/wind_direction_frequency/index.vue
@@ -56,7 +56,9 @@
       </el-tabs>
       <el-row type="flex" class="row-bg" justify="end">
         <el-col :span="2" style="margin: 20px">
-          <el-button type="primary" size="small">提交评论</el-button>
+          <el-button type="primary" size="small" @click="handleComment"
+            >提交评论</el-button
+          >
         </el-col>
       </el-row>
     </div>
@@ -133,6 +135,29 @@ export default {
     }
   },
   methods: {
+    async handleComment() {
+      try {
+        await analysisCommentEdit({
+          batchCode: this.initBatchCode,
+          analysisTypeCode: this.analysisTypeCode,
+          commentList: this.editableTabs.map((item) => {
+            return {
+              commentTypeCode: item.commentTypeCode,
+              comment: item.commentTypeName === "分析评论" ? this.comment : "",
+            };
+          }),
+        });
+        this.$message({
+          type: "success",
+          message: "保存成功",
+        });
+        this.comment = "";
+        this.getAnalysisDetail();
+      } catch (e) {
+        console.error(e);
+        this.loading = false;
+      }
+    },
     onSubmit() {
       console.log("submit!");
     },

+ 27 - 2
src/views/overview/components/wind_speed_frequency/index.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2025-01-10 09:11:34
- * @LastEditTime: 2025-01-14 17:23:27
+ * @LastEditTime: 2025-01-17 09:26:04
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/overview/components/wind_speed_frequency/index.vue
@@ -30,7 +30,9 @@
       </el-tabs>
       <el-row type="flex" class="row-bg" justify="end">
         <el-col :span="2" style="margin: 20px">
-          <el-button type="primary" size="small">提交评论</el-button>
+          <el-button type="primary" size="small" @click="handleComment"
+            >提交评论</el-button
+          >
         </el-col>
       </el-row>
     </div>
@@ -99,6 +101,29 @@ export default {
     }
   },
   methods: {
+    async handleComment() {
+      try {
+        await analysisCommentEdit({
+          batchCode: this.initBatchCode,
+          analysisTypeCode: this.analysisTypeCode,
+          commentList: this.editableTabs.map((item) => {
+            return {
+              commentTypeCode: item.commentTypeCode,
+              comment: item.commentTypeName === "分析评论" ? this.comment : "",
+            };
+          }),
+        });
+        this.$message({
+          type: "success",
+          message: "保存成功",
+        });
+        this.comment = "";
+        this.getAnalysisDetail();
+      } catch (e) {
+        console.error(e);
+        this.loading = false;
+      }
+    },
     onSubmit() {
       console.log("submit!");
     },

+ 4 - 2
src/views/overview/components/yaw_error/index.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2025-01-10 09:24:14
- * @LastEditTime: 2025-01-16 17:20:20
+ * @LastEditTime: 2025-01-17 10:02:10
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/overview/components/yaw_error/index.vue
@@ -88,7 +88,9 @@
       </el-tabs>
       <el-row type="flex" class="row-bg" justify="end">
         <el-col :span="2" style="margin: 20px">
-          <el-button type="primary" size="small">提交评论</el-button>
+          <el-button type="primary" size="small" @click="handleComment"
+            >提交评论</el-button
+          >
         </el-col>
       </el-row>
     </div>

+ 33 - 35
src/views/overview/components/yaw_error_density/index.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2025-01-10 09:26:12
- * @LastEditTime: 2025-01-16 15:01:54
+ * @LastEditTime: 2025-01-17 09:26:44
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/overview/components/yaw_error_density/index.vue
@@ -27,22 +27,24 @@
           </div>
         </template>
         <div style="font-size: 12px; margin-top: 10px">
-          动态偏航误差分析是对机组偏航对风角度的分布情况进行统计及可视化展示,对风角度分布对称性较差的机组需要关注其偏航系统对风异常原因
+          风能利用系数可以表示为变桨角度和叶尖速比的函数。每一个确定的桨距角,都存在一个最大风力利用系数,随着桨距角的变大,最大风力利用系数降低,其对应的叶尖速比也降低。此分析可以看出机组的发电情况表现
         </div>
       </el-alert>
       <div class="charts" v-if="diagramRelationsDatas">
-        <template v-for="(itemChart, indChart) in diagramRelationsDatas">
+        <RecycleScroller
+          class="scroller"
+          :items="diagramRelationsDatas"
+          :item-size="452"
+          key-field="fieldEngineCode"
+          v-slot="{ item: itemChart }"
+        >
           <TwoDMarkersChart
             :key="itemChart.fieldEngineCode"
-            @getResult="getResult"
-            @changeRequestNum="changeRequestNum"
-            :result="requestResult"
-            :index="indChart"
             :ref="itemChart.fieldEngineCode"
             :fileAddr="itemChart.fileAddr"
           >
           </TwoDMarkersChart>
-        </template>
+        </RecycleScroller>
       </div>
       <el-empty description="暂无分析记录" v-else></el-empty>
       <el-tabs value="first">
@@ -58,7 +60,9 @@
       </el-tabs>
       <el-row type="flex" class="row-bg" justify="end">
         <el-col :span="2" style="margin: 20px">
-          <el-button type="primary" size="small">提交评论</el-button>
+          <el-button type="primary" size="small" @click="handleComment"
+            >提交评论</el-button
+          >
         </el-col>
       </el-row>
     </div>
@@ -159,30 +163,6 @@ export default {
         this.loading = false;
       }
     },
-    getResult({ index, result }) {
-      console.log(index, result);
-      this.$set(this.requestResult, index, result);
-      // this.requestResult[index] = result
-      this.requestRecord[index] = result;
-    },
-    changeRequestNum(index) {
-      if (index <= 1) {
-        this.$set(this.requestRecord, index, "start");
-        return;
-      }
-      if (index > 1) {
-        if (
-          this.requestRecord.every((item) =>
-            ["success", "error"].includes(item)
-          )
-        ) {
-          this.$set(this.requestRecord, index, "start");
-          this.$set(this.requestResult, index, "start");
-        } else {
-          this.$set(this.requestRecord, index, "start");
-        }
-      }
-    },
     onSubmit() {
       console.log("submit!");
     },
@@ -212,7 +192,7 @@ export default {
           fieldEngineCodes:
             this.fieldEngineCodes.length === 0
               ? undefined
-              : this.fieldEngineCodes.join(","),
+              : this.fieldEngineCodes,
         });
         if (
           result.data &&
@@ -254,7 +234,7 @@ export default {
     //获取选中风机list
     getEnfineList(data) {
       this.fieldEngineCodes = data;
-      this.getAnalysisDetail();
+      console.log(this.fieldEngineCodes, "this.fieldEngineCodes");
     },
     //下一条
     handleNext() {
@@ -301,5 +281,23 @@ export default {
     height: 100%;
     overflow: hidden;
   }
+
+  .charts {
+    height: calc(100% - 150px);
+  }
+
+  .scroller {
+    height: 100%;
+
+    /* 隐藏垂直滚动条 */
+    &::-webkit-scrollbar {
+      width: 0;
+    }
+
+    /* 隐藏水平滚动条 */
+    &::-webkit-scrollbar {
+      height: 0;
+    }
+  }
 }
 </style>

+ 177 - 47
src/views/performance/assetssMag.vue

@@ -433,8 +433,6 @@ export default {
         pageNum: 1,
         pageSize: 10,
         totalSize: 0,
-        analysisState: "",
-        errState: "",
       },
       tableData: [],
       rowInfo: {},
@@ -442,46 +440,86 @@ export default {
       viewerInstance: null, // PDF 文件 URL
       dialogReportVisible: false,
       pdfUrl: "",
+      isPolling: false, // 轮询状态标识
+      firstLoad: true, // 是否是第一次加载
     };
   },
   created() {
+    window.addEventListener("message", this.handleMessage); //江
     this.getTableList();
-    window.addEventListener("message", this.handleMessage);//江
   },
   beforeDestroy() {
+    this.stopPolling();
     // 销毁消息监听器
-    window.removeEventListener("message", this.handleMessage);//江
+    window.removeEventListener("message", this.handleMessage); //江
   },
   methods: {
-
     //江
-    handleMessage(event) {
-      // 确保消息来自当前域
-      if (event.origin !== window.location.origin) {
-        return;
-      }
+    // handleMessage(event) {
+    //   // 确保消息来自当前域
+    //   if (event.origin !== window.location.origin) {
+    //     return;
+    //   }
+    //   // 获取传递的参数
+    //   const { fieldName, analysisState, errState } = event.data;
 
-      // 获取传递的参数
-      const { fieldName, analysisState, errState } = event.data;
+    //   // 更新表单字段并调用查询
+    //   if (fieldName !== undefined) {
+    //     this.formInline.fieldName = fieldName;
+    //     console.log(fieldName, "0");
+    //   }
+    //   if (analysisState !== undefined) {
+    //     this.formInline.analysisState = analysisState;
+    //     console.log(analysisState, "2");
+    //   }
+    //   if (errState !== undefined) {
+    //     this.formInline.errState = errState;
+    //     console.log(errState, "1");
+    //   }
 
-      // 更新表单字段并调用查询
-      if (fieldName !== undefined) {
-        this.formInline.fieldName = fieldName;
-        console.log(fieldName, "0");
-      }
-      if (analysisState !== undefined) {
-        this.formInline.analysisState = analysisState;
-        console.log(analysisState, "2");
-      }
-      if (errState !== undefined) {
-        this.formInline.errState = errState;
-        console.log(errState, "1");
-      }
-
-      // 调用查询方法
-      this.getTableList();
+    //   // 调用查询方法
+    //   this.getTableList();
+    // },
+    // 创建分析时请求
+    async addRuleFormSubmit() {
+      this.$refs.addRuleForm.validate(async (valid) => {
+        if (valid) {
+          try {
+            const res = await addAnalysisResult(this.addRuleForm);
+            if (res.code === 200) {
+              this.$message({
+                type: "success",
+                message: "创建成功",
+              });
+              this.addDialogVisible = false;
+              this.getTableList();
+            }
+          } catch (err) {
+            console.error(err);
+          }
+        }
+      });
     },
 
+    AddHandleCloses(done) {
+      this.$confirm("确认关闭?")
+        .then((_) => {
+          done();
+        })
+        .catch((_) => {});
+    },
+    //获取风场列表
+    async getQueryCodeNumList() {
+      this.loading = true;
+      try {
+        const result = await queryCodeNum();
+        this.fieldCodeList = result.data.fieldCodeList;
+        this.loading = false;
+      } catch (error) {
+        console.error(error);
+        this.loading = false;
+      }
+    },
     handleCloses(done) {
       this.$confirm("确认关闭?")
         .then((_) => {
@@ -571,40 +609,95 @@ export default {
     handleConfirm() {
       this.dialogVisible = false;
     },
-    //分页数据切换
+    // 页码变化时才触发查询
     handleCurrentChange(val) {
       this.formInline.pageNum = val;
       this.getTableList();
     },
 
-    // 江修改部分
+    // 修改 getTableList 方法,避免重复请求
     async getTableList() {
+      // 如果正在请求中,跳过此次调用
+      if (this.loading || this.isPolling) return;
+
+      this.loading = true;
       try {
-        this.loading = true;
         const params = { ...this.formInline, totalSize: undefined };
 
-        // 如果 analysisState 存在,传递 analysisState 参数
+        // 传递条件参数
         if (this.formInline.analysisState !== undefined) {
           params.analysisState = this.formInline.analysisState;
         }
-
-        // 如果 errState 存在,传递 errState 参数
         if (this.formInline.errState !== undefined) {
           params.errState = this.formInline.errState;
         }
 
-        // 发起请求
-        const result = await getAnalysisResultList(params);
+        const result = await analysisResultList(params);
         this.tableData = result.data.list;
         this.formInline.totalSize = result.data.totalSize;
-        this.loading = false;
       } catch (error) {
         this.$message({
           type: "error",
           message: "请检查是否连接网络",
         });
+      } finally {
+        this.loading = false;
+      }
+    },
+
+    // 改进 handleMessage,避免频繁请求
+    handleMessage(event) {
+      // 确保消息来自当前域
+      if (event.origin !== window.location.origin) {
+        return;
+      }
+
+      const { fieldName, analysisState, errState } = event.data;
+
+      // 更新表单字段
+      if (fieldName !== undefined) {
+        this.formInline.fieldName = fieldName;
+        console.log(fieldName, "0");
+      }
+      if (analysisState !== undefined) {
+        this.formInline.analysisState = analysisState;
+        console.log(analysisState, "2");
+      }
+      if (errState !== undefined) {
+        this.formInline.errState = errState;
+        console.log(errState, "1");
+      }
+
+      // 如果当前没有请求中,才调用 getTableList
+      if (!this.loading) {
+        this.getTableList();
       }
     },
+    // async getTableList() {
+    //   try {
+    //     this.loading = true;
+    //     const params = { ...this.formInline, totalSize: undefined };
+
+    //     // 如果 analysisState 存在,传递 analysisState 参数
+    //     if (this.formInline.analysisState !== undefined) {
+    //       params.analysisState = this.formInline.analysisState;
+    //     }
+
+    //     // 如果 errState 存在,传递 errState 参数
+    //     if (this.formInline.errState !== undefined) {
+    //       params.errState = this.formInline.errState;
+    //     }
+    //     const result = await analysisResultList(params);
+    //     this.tableData = result.data.list;
+    //     this.formInline.totalSize = result.data.totalSize;
+    //     this.loading = false;
+    //   } catch (error) {
+    //     this.$message({
+    //       type: "error",
+    //       message: "请检查是否连接网络",
+    //     });
+    //   }
+    // },
     rowStyle() {
       return "text-align:center";
     },
@@ -615,11 +708,9 @@ export default {
     // 重置
     reset(formName) {
       this.$refs[formName].resetFields();
-      this.formInline.fieldName=""
-      this.formInline.analysisState=""
-      this.formInline.errState=""
       this.getTableList();
     },
+    // fetchData 方法在轮询中调用
     async fetchData() {
       try {
         const result = await analysisResultList({
@@ -635,39 +726,78 @@ export default {
         });
       }
     },
+    // async fetchData() {
+    //   try {
+    //     const result = await analysisResultList({
+    //       ...this.formInline,
+    //       totalSize: undefined,
+    //     });
+    //     this.tableData = result.data.list;
+    //     this.formInline.totalSize = result.data.totalSize;
+    //   } catch (error) {
+    //     this.$message({
+    //       type: "error",
+    //       message: "请检查是否连接网络",
+    //     });
+    //   }
+    // },
+    // stopPolling() {
+    //   if (this.intervalId) {
+    //     clearInterval(this.intervalId);
+    //     this.intervalId = null;
+    //   }
+    // },
     stopPolling() {
       if (this.intervalId) {
         clearInterval(this.intervalId);
         this.intervalId = null;
       }
+      this.isPolling = false;
     },
+
+    // 启动轮询时,避免重复请求
     startPolling() {
       this.startTime = new Date().getTime();
+      this.isPolling = true;
+
       this.intervalId = setInterval(() => {
         const currentTime = new Date().getTime();
         if (currentTime - this.startTime >= this.maxPollingTime) {
           this.stopPolling();
         } else {
-          // 轮询
-          // this.fetchData();
+          // 轮询期间不重复请求,检查是否可以调用 fetchData
+          if (!this.loading) {
+            this.fetchData();
+          }
         }
-      }, 10000); // 每10秒调用一次
+      }, 10000); // 每10秒检查一次
     },
+    // startPolling() {
+    //   this.startTime = new Date().getTime();
+    //   this.intervalId = setInterval(() => {
+    //     const currentTime = new Date().getTime();
+    //     if (currentTime - this.startTime >= this.maxPollingTime) {
+    //       this.stopPolling();
+    //     } else {
+    //       // 轮询
+    //       // this.fetchData();
+    //     }
+    //   }, 10000); // 每10秒调用一次
+    // },
     //创建分析
     Newanalyse() {
       this.addDialogVisible = true;
       this.getQueryCodeNumList();
     },
     examine() {
-      window.open(this.$router.resolve({ path: "/transition" }).href, "_blank");
+      this.$router.push({
+        path: "/home/transition/index",
+      });
     },
   },
   mounted() {
     this.startPolling();
   },
-  beforeDestroy() {
-    this.stopPolling();
-  },
 };
 </script>
 

+ 113 - 54
src/views/performance/components/chartsCom/BoxLineCharts.vue

@@ -1,40 +1,42 @@
 <!--
  * @Author: your name
  * @Date: 2024-09-11 14:32:51
- * @LastEditTime: 2025-01-16 11:07:58
+ * @LastEditTime: 2025-01-16 18:29:08
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/chartsCom/BoxLineCharts.vue
 -->
-<template>
-  <div>
-    <!-- boxLineCharts -->
-    <!-- <h1>额定功率和风速分析</h1> -->
-    <div
+<!-- <template>
+  <div> -->
+<!-- boxLineCharts -->
+<!-- <h1>额定功率和风速分析</h1> -->
+<!-- <div
       :id="`plotDivAbove25-${inds}`"
       style="width: 100%; height: 550px"
-    ></div>
-    <div
-      :id="`plotDivBelow25-${inds}`"
+    ></div> -->
+<!-- <div
+      :id="`plotDivBelow25-${index}`"
       style="width: 100%; height: 550px"
-    ></div>
-    <!-- <div :id="`chart-${inds}`" style="width: 100%; height: 550px"></div> -->
-  </div>
-</template>
-<script>
+    ></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: {
-    inds: {
+    fileAddr: {
+      default: "",
+      type: String,
+    },
+    index: {
       type: Number,
-      default() {
-        return 0;
-      },
     },
   },
   data() {
     return {
+      chartData: {},
       turbinesData: [
         { turbine: "Turbine1", envTemp: 26, windSpeed: 12, activePower: 1200 },
         { turbine: "Turbine1", envTemp: 26, windSpeed: 12, activePower: 1800 },
@@ -87,8 +89,8 @@ export default {
       const below25 = this.turbinesData.filter((d) => d.envTemp < 25);
 
       // 中位数计算
-      const medians = this.calculateMedians();
-
+      // const medians = this.calculateMedians();
+      const medians = [];
       const turbineNames = Object.keys(medians);
       const medianValues = Object.values(medians);
       const traceAbove25 = {
@@ -120,24 +122,6 @@ export default {
         ...lineDatas.lableConfig,
         title: "额定全风速10min配电 (环境温度 < 25°C)",
         autosize: true, // 开启自适应
-        // 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(
@@ -149,25 +133,100 @@ export default {
         }
       );
     },
-    //中位值的计算
-    calculateMedians() {
-      const medians = this.turbinesData.reduce((acc, d) => {
-        if (!acc[d.turbine]) acc[d.turbine] = [];
-        acc[d.turbine].push(d.activePower);
-        return acc;
-      }, {});
+    // //中位值的计算
+    // 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];
+    //   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;
+    // },
+  },
+};
+</script>
+<style scoped></style> -->
+<template>
+  <div>
+    <!-- boxLineCharts -->
+    <div :id="`plotDivBox-${index}`" style="width: 100%; height: 550px"></div>
+  </div>
+</template>
+
+<script>
+import Plotly from "plotly.js-dist";
+import axios from "axios";
+export default {
+  props: {
+    fileAddr: {
+      default: "",
+      type: String,
+    },
+    index: {
+      type: Number,
+    },
+  },
+  data() {
+    return {
+      chartData: {},
+    };
+  },
+  mounted() {
+    this.getData();
+  },
+  methods: {
+    async getData() {
+      if (this.fileAddr !== "") {
+        try {
+          const resultChartsData = await axios.get(this.fileAddr);
+          this.chartData = resultChartsData.data;
+          this.drawBoxPlot();
+        } catch (error) {}
       }
-      return medians;
+    },
+    drawBoxPlot() {
+      const chartData = this.chartData.data[0];
+
+      // 构建箱线图
+      const trace = {
+        x: chartData.xData,
+        y: chartData.yData,
+        type: "box",
+        // boxpoints: "all", // 显示所有数据点
+        // jitter: 0.3, // 调整点的散布
+        // pointpos: 0, // 点位置
+        marker: {
+          color: "#00000000",
+          size: 0,
+        },
+
+        line: {
+          color: "#64ADC2", // 设置箱线图边框颜色
+        },
+        boxpoints: "none", // 不显示散点
+        fillcolor: "#64adc28a", // 设置箱线图填充颜色,带透明度
+        name: chartData.title, // 设置图例名称
+      };
+
+      // 布局设置
+      const layout = {
+        title: this.chartData.data[0].title,
+        xaxis: { title: this.chartData.xaixs },
+        yaxis: { title: this.chartData.yaixs },
+        showlegend: false,
+      };
+
+      Plotly.newPlot(`plotDivBox-${this.index}`, [trace], layout);
     },
   },
 };
 </script>
-<style scoped></style>

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

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2024-09-11 14:36:31
- * @LastEditTime: 2025-01-16 17:25:59
+ * @LastEditTime: 2025-01-16 17:55:25
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/chartsCom/BoxMarkersCharts.vue
@@ -23,7 +23,7 @@
 
 <script>
 import Plotly from "plotly.js-dist-min";
-
+import axios from "axios";
 export default {
   name: "BoxPlotWithMedians",
   props: {
@@ -50,10 +50,7 @@ export default {
           const resultChartsData = await axios.get(this.fileAddr);
           this.chartData = resultChartsData.data;
           this.drawBoxPlot();
-          this.$emit("getResult", { index: this.index, result: "success" });
-        } catch (error) {
-          this.$emit("getResult", { index: this.index, result: "error" });
-        }
+        } catch (error) {}
       }
     },
     drawBoxPlot() {

+ 33 - 55
src/views/performance/components/chartsCom/TwoDMarkersChart.vue

@@ -1,9 +1,8 @@
 <template>
-  <div style="min-height: 300px">
-    <div v-inview="handleDomInView"></div>
+  <div style="height: 452px">
     <!-- 2D散点图 -->
-    <template v-if="isShow === true">
-      <div style="display: flex; align-items: center; margin-top: 20px">
+    <template>
+      <div style="display: flex; align-items: center; padding-top: 20px">
         <div style="margin-right: 20px; display: flex; align-items: center">
           <el-color-picker
             size="small"
@@ -21,18 +20,16 @@
           <el-button size="small" @click="setChartType('line')"
             >折线图</el-button
           >
-          <!-- <el-button size="small" @click="setChartType('bar')"
+          <el-button size="small" @click="setChartType('bar')"
             >柱状图</el-button
-          > -->
+          >
         </div>
       </div>
-      <div v-loading="$parent.requestRecord[index] === 'start'">
-        <el-empty
-          v-if="result[index] === 'error'"
-          description="请求失败"
-        ></el-empty>
-        <div v-else ref="plotlyChart" style="height: 400px"></div>
+      <!-- <div v-loading="$parent.requestRecord[index] === 'start'"> -->
+      <div v-loading="loading" ref="plotlyChart" style="height: 400px">
+        <el-empty v-if="isError" description="请求失败"></el-empty>
       </div>
+      <!-- </div> -->
     </template>
   </div>
 </template>
@@ -46,13 +43,6 @@ export default {
       default: "",
       type: String,
     },
-    index: {
-      type: Number,
-    },
-    result: {
-      type: Array,
-      default: [],
-    },
   },
   data() {
     return {
@@ -84,56 +74,44 @@ export default {
       selectedPoints: [],
       originalColors: [],
       originalSizes: [],
-      isShow: undefined,
+      loading: false,
+      isError: false,
+      cancelToken: null,
     };
   },
-  watch: {
-    result: {
-      deep: true,
-      handler(v) {
-        console.log("-----------------------", v);
-        // const resultArr = ['success', 'fail']
-        // if(!this.result.every(item => resultArr.includes(item))) {
-        //   if(this.index<this.result.length) {
-        //     this.getData()
-        //   }
-        // }
-        const startIndex = this.$parent.requestRecord.findIndex(
-          (item) => item === "start"
-        );
-        if (startIndex > -1) {
-          if (startIndex === this.index) {
-            this.getData();
-          }
-        }
-      },
-    },
-  },
   async mounted() {
-    if (this.index === 0) {
-      this.getData();
-    }
+    this.getData();
+  },
+  beforeDestroy() {
+    this.cancelRequest();
   },
   methods: {
-    handleDomInView(isInView) {
-      if (isInView && this.isShow === undefined) {
-        this.isShow = isInView;
-        this.$emit("changeRequestNum", this.index);
-      }
-      console.log(this.isShow);
-    },
     async getData() {
       if (this.fileAddr !== "") {
         try {
-          const resultChartsData = await axios.get(this.fileAddr);
+          this.loading = true;
+          this.cancelToken = axios.CancelToken.source();
+          console.log(this.cancelToken);
+          const resultChartsData = await axios.get(this.fileAddr, {
+            cancelToken: this.cancelToken.token,
+          });
+          console.log(resultChartsData);
           this.chartData = resultChartsData.data;
           this.drawChart();
-          this.$emit("getResult", { index: this.index, result: "success" });
+          this.isError = false;
+          this.loading = false;
         } catch (error) {
-          this.$emit("getResult", { index: this.index, result: "error" });
+          // this.$emit("getResult", { index: this.index, result: "error" });
+          this.isError = true;
+          this.loading = false;
         }
       }
     },
+    cancelRequest() {
+      if (this.cancelToken) {
+        this.cancelToken.cancel("Request was cancelled");
+      }
+    },
     drawChart() {
       const data = this.chartData.data && this.chartData.data[0];
       let trace = {};

+ 3 - 3
vue.config.js

@@ -64,9 +64,9 @@ module.exports = {
     proxy: {
       "/api": {
         // target: "http://192.168.5.4:16200", // 石月
-        // target: "http://192.168.50.235:16200", // 内网
+        target: "http://192.168.50.235:16200", // 内网
         // target: "http://192.168.5.15:16200",
-        target: "http://106.120.102.238:16700", // 外网16700  生产16600 
+        // target: "http://106.120.102.238:16700", // 外网16700  生产16600
         // target: "http://10.96.137.5",
         changeOrigin: true,
         pathRewrite: {
@@ -85,7 +85,7 @@ module.exports = {
       "/ETLapi": {
         // target: "http://192.168.50.241:9001", // WZLapi 目标地址
         // target: "http://192.168.5.11:8001", // WZLapi 目标地址
-        // target: "http://106.120.102.238:18080/ImportDataDev", //导数工具 
+        // target: "http://106.120.102.238:18080/ImportDataDev", //导数工具
         target: "http://106.120.102.238:18080/WindTransDev", //WTL外网目标地址
         changeOrigin: true,
         pathRewrite: {