瀏覽代碼

Merge branch 'master' of http://192.168.50.233:3000/rui.jiang/performance-test

liujiejie 3 月之前
父節點
當前提交
37d667056c

+ 11 - 0
src/api/ledger.js

@@ -573,3 +573,14 @@ export function analysisResultList(data) {
 
 
 
+// 陈风场
+
+export function queryFloatingWindowInfo(data) {
+  return request({
+    url: "/energy-manage-service/homePage/queryFloatingWindowInfo",
+    method: "get",
+    data,
+  });
+}
+
+

二進制
src/assets/img/iconFC.png


二進制
src/assets/img/iconFJ.png


+ 104 - 59
src/components/map/index.vue

@@ -8,31 +8,49 @@
           <span>风场编号</span><span>{{ hoverInfo.codeNumber }}</span>
         </p>
         <p>
-          <span>空气密度</span><span>{{ hoverInfo.density }} kg/m3</span>
+          <span>风机数量</span><span>{{ newWind.engineTotalCount }} 台</span>
         </p>
         <p>
-          <span>总额定容量</span
-          ><span
-            >{{
-              hoverInfo?.ratedCapacityNumber
-                ? hoverInfo.ratedCapacityNumber
-                : 0
-            }}/KW</span
-          >
+          <span>总容量</span><span>{{
+            newWind?.ratedCapacityNumber ? newWind.ratedCapacityNumber : 0
+          }}/KW</span>
         </p>
         <p>
-          <span>经度</span><span>{{ hoverInfo.longitude }}</span>
+          <span>经度</span><span>{{ hoverInfo.longitude }}°</span>
         </p>
         <p>
-          <span>纬度</span><span>{{ hoverInfo.latitude }}</span>
+          <span>纬度</span><span>{{ hoverInfo.latitude }}°</span>
         </p>
         <p>
-          <span>海拔高度</span><span>{{ hoverInfo.elevationHeight }} /米</span>
+          <span>分析类型数</span><span>{{
+            hoverInfo.analysisTypeCount ? hoverInfo.analysisTypeCount : 0
+          }}
+            个</span>
         </p>
         <p>
-          <span>最新分析时间</span
-          ><span> {{ $formatDateTWO(hoverInfo.wfbrCreateTime) }}</span>
+          <span>分析开始时间</span>
+          <span>{{
+            newWind.analysisStartTime
+              ? $formatDateTWO(newWind.analysisStartTime)
+              : "暂无数据"
+          }}</span>
         </p>
+        <p>
+  <span>分析结束时间</span>
+  <span>{{ newWind.analysisEndTime ? $formatDateTWO(newWind.analysisEndTime) : '暂无数据' }}</span>
+</p>
+<p>
+  <span>数据开始时间</span>
+  <span>{{ newWind.dataStartTime ? $formatDateTWO(newWind.dataStartTime) : '暂无数据' }}</span>
+</p>
+<p>
+  <span>数据结束时间</span>
+  <span>{{ newWind.dataEndTime ? $formatDateTWO(newWind.dataEndTime) : '暂无数据' }}</span>
+</p>
+
+        <!-- <p>
+          <span>最新分析时间</span><span> {{ $formatDateTWO(hoverInfo.wfbrCreateTime) }}</span>
+        </p> -->
       </div>
     </div>
 
@@ -43,17 +61,13 @@
           <span>风机编号</span><span>{{ hoverfengji.engineCode }}</span>
         </p>
         <p>
-          <span>额定容量</span
-          ><span
-            >{{
-              hoverfengji?.ratedCapacity ? hoverfengji?.ratedCapacity : 0
-            }}
-            /KW</span
-          >
+          <span>额定容量</span><span>{{
+            hoverfengji?.ratedCapacity ? hoverfengji?.ratedCapacity : 0
+          }}
+            /KW</span>
         </p>
         <p>
-          <span>海拔高度</span
-          ><span>{{ hoverfengji.elevationHeight }} /米</span>
+          <span>海拔高度</span><span>{{ hoverfengji.elevationHeight }} /米</span>
         </p>
         <p>
           <span>轮毂高度</span><span>{{ hoverfengji.hubHeight }} /米</span>
@@ -72,12 +86,10 @@
           <span>额定风速</span><span>{{ hoverfengji.ratedWindSpeed }} m/s</span>
         </p>
         <p>
-          <span>切入风速</span
-          ><span>{{ hoverfengji.ratedCutInWindspeed }} m/s</span>
+          <span>切入风速</span><span>{{ hoverfengji.ratedCutInWindspeed }} m/s</span>
         </p>
         <p>
-          <span>切出风速</span
-          ><span>{{ hoverfengji.ratedCutOutWindspeed }} m/s</span>
+          <span>切出风速</span><span>{{ hoverfengji.ratedCutOutWindspeed }} m/s</span>
         </p>
       </div>
     </div>
@@ -98,8 +110,7 @@
           <span>状态</span><span>{{  }}</span>
         </p> -->
         <p>
-          <span>测风塔高度</span
-          ><span>{{ hoverta.anemometerHeightStrings }}/米</span>
+          <span>测风塔高度</span><span>{{ hoverta.anemometerHeightStrings }}/米</span>
         </p>
       </div>
     </div>
@@ -127,14 +138,15 @@ import { Icon, Style } from "ol/style";
 import ZoomSlider from "ol/control/ZoomSlider.js";
 import { defaults as defaultControls } from "ol/control.js";
 
-import icon01 from "../../assets/img/icon01.png";
-import icon02 from "../../assets/img/icon02.png";
-import icon03 from "../../assets/img/icon03.png";
-import icon04 from "../../assets/img/icon04.png";
+import icon01 from "../../assets/img/iconFC.png";
+import icon02 from "../../assets/img/iconFC.png";
+import icon03 from "../../assets/img/iconFC.png";
+import icon04 from "../../assets/img/iconFJ.png";
 import icon05 from "../../assets/img/icon05.png";
-import icon06 from "../../assets/img/icon06.png";
-import defaultIcon from "../../assets/img/icon01.png";
-import { queryErrDescByEngine } from "@/api/ledger.js";
+import icon06 from "../../assets/img/iconFJ.png";
+import defaultIcon from "../../assets/img/iconFJ.png";
+import { queryErrDescByEngine, queryFloatingWindowInfo } from "@/api/ledger.js";
+import { login } from "@/api/login";
 
 export default {
   props: {
@@ -168,6 +180,7 @@ export default {
         left: "0px",
         top: "0px",
       },
+      newWind: {},
     };
   },
   watch: {
@@ -196,8 +209,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", //大~#@唐
           }),
         }),
@@ -295,40 +308,52 @@ export default {
      * 初始化地图事件
      */
     initEvent() {
+      let lastHoveredFeature = null; // 用来记录上一次悬停的 feature
+
       this.map.on("pointermove", (evt) => {
         const features = this.map.getFeaturesAtPixel(evt.pixel, {
           hitTolerance: 1,
         });
+
         if (features && features.length > 0) {
           const feature = features.at(0);
           const val = feature.get("data").val;
-          if (val == "1" || val == "30") {
-            this.hoverInfo = feature.get("data");
-            this.hoverStyle.left = `${evt.pixel[0] + 10}px`;
-            this.hoverStyle.top = `${evt.pixel[1] - 150}px`;
-          } else if (val == "4") {
-            this.hoverfengji = feature.get("data");
-            this.hoverfengjiStyle.left = `${evt.pixel[0] + 10}px`;
-            this.hoverfengjiStyle.top = `${evt.pixel[1] - 150}px`;
-            this.currentFeatureData = feature.get("data");
-          } else if (val == "5") {
-            this.hoverta = feature.get("data");
-            this.hovertaStyle.left = `${evt.pixel[0] + 10}px`;
-            this.hovertaStyle.top = `${evt.pixel[1] - 150}px`;
-            this.currentFeatureData = feature.get("data");
-          } else if (val == "6") {
-            this.currentFeatureData = feature.get("data");
-          } else {
-            this.hoverInfo = null;
-            this.hoverfengji = false;
-            this.hoverta = false;
-            this.currentFeatureData = null;
+
+          // 只有当当前悬停的 feature 和上次的不同,才触发操作
+          if (lastHoveredFeature !== feature) {
+            if (val == "1" || val == "30"||val == "-1") {
+              this.hoverInfo = feature.get("data");
+              this.hoverStyle.left = `${evt.pixel[0] + 10}px`;
+              this.hoverStyle.top = `${evt.pixel[1] - 150}px`;
+              this.getwind();
+            } else if (val == "4") {
+              this.hoverfengji = feature.get("data");
+              this.hoverfengjiStyle.left = `${evt.pixel[0] + 10}px`;
+              this.hoverfengjiStyle.top = `${evt.pixel[1] - 150}px`;
+              this.currentFeatureData = feature.get("data");
+            } else if (val == "5") {
+              this.hoverta = feature.get("data");
+              this.hovertaStyle.left = `${evt.pixel[0] + 10}px`;
+              this.hovertaStyle.top = `${evt.pixel[1] - 150}px`;
+              this.currentFeatureData = feature.get("data");
+            } else if (val == "6") {
+              this.currentFeatureData = feature.get("data");
+            } else {
+              this.hoverInfo = null;
+              this.hoverfengji = false;
+              this.hoverta = false;
+              this.currentFeatureData = null;
+            }
+
+            // 更新 lastHoveredFeature
+            lastHoveredFeature = feature;
           }
         } else {
           this.hoverInfo = null;
           this.hoverfengji = false;
           this.hoverta = false;
           this.currentFeatureData = null;
+          lastHoveredFeature = null; // 没有特征时清空记录
         }
       });
 
@@ -352,6 +377,7 @@ export default {
         }
       });
     },
+
     handleFeatureClick(featureData) {
       let dateArr = {
         batchCode: this.$route.query.batchCode,
@@ -363,6 +389,25 @@ export default {
       });
     },
 
+    getwind() {
+      if (this.hoverInfo && this.hoverInfo.batchCode) {
+        const param = {
+          batchcode: this.hoverInfo.batchCode,
+          fieldCode: this.hoverInfo.codeNumber,
+        }; // 确保传递一个对象
+        queryFloatingWindowInfo(param)
+          .then((res) => {
+            // 处理响应数据
+            this.newWind = res.data;
+          })
+          .catch((err) => {
+            console.error("获取风信息失败", err);
+          });
+      } else {
+        console.warn("hoverInfo 或 batchCode 未定义");
+      }
+    },
+
     /**
      * 平移缩放
      * @param data

+ 51 - 8
src/views/admin/cockpitManage/component/leftdata.vue

@@ -7,20 +7,20 @@
           <strong class="texyellow">
             {{ onrelevance ? onrelevance : 0 }}</strong
           >
-          <span>分析异常数</span>
+          <span>未分析任务</span>
         </div>
         <div class="YC02" @click="getwfx">
           <strong class="textred"> {{ abnormal ? abnormal : 0 }}</strong>
-          <span>失败分析数</span>
+          <span>失败任务</span>
         </div>
 
-        <div class="YC03">
-          <strong class="textred"> {{ abnormal ? abnormal : 0 }}</strong>
+        <div class="YC03" @click="getpd">
+          <strong class="textred"> {{ queueNumber ? queueNumber : 0 }}</strong>
           <span>排队任务数</span>
         </div>
       </div>
 
-      <el-dialog title="未关联任务统计表" :visible.sync="glShow" width="40%">
+      <el-dialog title="未关联任务统计表" :visible.sync="glShow" width="45%">
         <!-- 外部容器设置最大高度和滚动条 -->
         <div style="max-height: 400px; overflow-y: auto">
           <el-table :data="glData" style="width: 100%">
@@ -53,7 +53,7 @@
         </div>
       </el-dialog>
 
-      <el-dialog title="分析异常统计表" :visible.sync="YCShow" width="40%">
+      <el-dialog title="分析异常统计表" :visible.sync="YCShow" width="45%">
         <div style="max-height: 400px; overflow-y: auto">
           <el-table :data="FXData" style="width: 100%">
             <el-table-column prop="fieldName" label="风场名称" width="180">
@@ -75,6 +75,26 @@
           </el-table>
         </div>
       </el-dialog>
+
+      <el-dialog title="排队任务统计表" :visible.sync="PdShow" width="45%">
+        <div style="max-height: 400px; overflow-y: auto">
+          <el-table :data="PdData" style="width: 100%">
+            <el-table-column prop="fieldName" label="风场名称" width="180">
+            </el-table-column>
+            <el-table-column prop="analysisName" label="分析名称" width="180">
+            </el-table-column>
+            <el-table-column prop="createTime" label="创建时间">
+            </el-table-column>
+            <el-table-column fixed="right" label="操作" width="100">
+              <template slot-scope="scope">
+                <el-button @click="PDClick(scope.row)" type="text" size="small"
+                  >编辑</el-button
+                >
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </el-dialog>
     </div>
 
     <!-- 入库信息 -->
@@ -90,7 +110,7 @@
       <div>
         <p class="titleYC"><span>风场名称</span><span>入库时间</span></p>
         <tabroll
-              :table-data="tableData"
+          :table-data="tableData"
           :shujuloading="shujuloading"
           :columns="YCtableColumns"
           :column-widths="YCcolumnWidths"
@@ -190,11 +210,14 @@ export default {
     return {
       onrelevance: "",
       abnormal: "",
+      queueNumber: "",
       glShow: false,
       YCShow: false,
+      PdShow: false,
       dialogTableVisible: false,
       glData: [],
       FXData: [],
+      PdData: [],
       tableData: [],
       maxHeight: "200",
       gridData: [],
@@ -216,6 +239,7 @@ export default {
       queryWaitTask().then((res) => {
         this.abnormal = res.data.errCount;
         this.onrelevance = res.data.uncorrelatedCount;
+        this.queueNumber = res.data.queueNumber;
       });
     },
     getwgl() {
@@ -234,11 +258,30 @@ export default {
         this.YCShow = true;
       });
     },
+    getpd() {
+      analysisResultList({ analysisState: 10 }).then((res) => {
+        this.PdData = res.data.list;
+        this.PdShow = true;
+      });
+    },
+
+    PDClick(row) {
+      const fieldName = row.fieldName; // 获取当前行的 fieldName 数据
+      const analysisState = 10;
+      // 打开新窗口
+      const newWindow = window.open(
+        "/home/performance/assetssMag?id=195",
+        "_blank"
+      );
+      // 等待窗口加载完成后发送消息
+      newWindow.onload = () => {
+        newWindow.postMessage({ fieldName, analysisState }, "*");
+      };
+    },
 
     handleClick(row) {
       const fieldName = row.fieldName; // 获取当前行的 fieldName 数据
       const analysisState = -1;
-
       // 打开新窗口
       const newWindow = window.open(
         "/home/performance/assetssMag?id=195",

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

@@ -815,7 +815,7 @@ export default {
             this.fetchData();
           }
         }
-      }, 10000); // 每10秒检查一次
+      }, 1000); // 每10秒检查一次
     },
 
     //创建分析

+ 2 - 2
vue.config.js

@@ -66,8 +66,8 @@ module.exports = {
         // target: "http://192.168.5.4:16200", // 石月
         // target: "http://192.168.50.235:16200", // 内网
         // target: "http://192.168.5.15:16200",
-        target: "http://192.168.50.235:16500", //演示环境
-        // target: "http://106.120.102.238:26500", //外网演示环境
+        // target: "http://192.168.50.235:16500", //演示环境
+        target: "http://106.120.102.238:26500", //外网演示环境
         // target: "http://106.120.102.238:16700", // 外网16700  生产16600
         // target: "http://10.96.137.5",
         changeOrigin: true,