rui.jiang 1 yıl önce
ebeveyn
işleme
5ab1ebb562

+ 8 - 0
src/api/ledger.js

@@ -449,4 +449,12 @@ export function queryOptionRecords(data) {
     method: 'get',
     data
   })
+}
+// 风机异常信息
+export function queryErrDescByEngine(data) {
+  return request({
+    url: '/energy-manage-service/analysisErr/queryErrDescByEngine',
+    method: 'get',
+    data
+  })
 }

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

@@ -104,6 +104,26 @@
         </p>
       </div>
     </div>
+
+    <el-dialog title="异常描述"  :visible.sync="dialogVisible" width="50%">
+
+      <el-table
+      :data="tableData"
+       max-height="500"
+      style="width: 100%">
+      <el-table-column
+        prop="analysisTypeName"
+        label="类型"
+        width="300">
+      </el-table-column>
+      <el-table-column
+        prop="errDesc"
+        label="描述"
+        >
+      </el-table-column>
+ 
+    </el-table>
+    </el-dialog>
   </div>
 </template>
 
@@ -127,6 +147,8 @@ import icon04 from "../../assets/img/icon04.png";
 import icon05 from "../../assets/img/icon05.png";
 import icon06 from "../../assets/img/icon06.png";
 import defaultIcon from "../../assets/img/icon05.png";
+import { queryErrDescByEngine } from "@/api/ledger.js";
+
 export default {
   props: {
     windEngineGroupByFieldCodeDetail: {
@@ -139,6 +161,8 @@ export default {
   name: "T-map",
   data() {
     return {
+      dialogVisible: false,
+      tableData:[],
       hoverInfo: null,
       hoverStyle: {
         position: "absolute",
@@ -184,9 +208,9 @@ export default {
       layers: [
         new TileLayer({
           source: new XYZ({
-            url: "http://127.0.0.1:8010/tiles/{z}/{x}/{y}.png", //本地
+            // 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://106.120.102.238:18000/tiles/{z}/{x}/{y}.png", //外网
           }),
         }),
         new VectorLayer({
@@ -274,65 +298,75 @@ export default {
     /**
      * 初始化地图事件
      */
-     initEvent() {
-  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") {
-        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;
-      }
-    } else {
-      this.hoverInfo = null;
-      this.hoverfengji = false;
-      this.hoverta = false;
-      this.currentFeatureData = null;
-    }
-  });
+    initEvent() {
+      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") {
+            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;
+          }
+        } else {
+          this.hoverInfo = null;
+          this.hoverfengji = false;
+          this.hoverta = false;
+          this.currentFeatureData = null;
+        }
+      });
 
-  this.map.on("click", (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 === "6") {
-        this.handleFeatureClick(feature.get("data"));
-      } else {
-        this.$emit("feature-click", feature.get("data"));
-      }
-    } else if (this.currentFeatureData && this.currentFeatureData.val === "6") {
-      this.handleFeatureClick(this.currentFeatureData);
-    }
-  });
-},
-handleFeatureClick(featureData) {
-alert('555555')
-},
+      this.map.on("click", (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 === "6") {
+            this.handleFeatureClick(feature.get("data"));
+          } else {
+            this.$emit("feature-click", feature.get("data"));
+          }
+        } else if (
+          this.currentFeatureData &&
+          this.currentFeatureData.val === "6"
+        ) {
+          this.handleFeatureClick(this.currentFeatureData);
+        }
+      });
+    },
+    handleFeatureClick(featureData) {
 
+      let dateArr = {
+        batchCode: this.$route.query.batchCode,
+        engineCode: featureData.engineCode,
+      };
+      queryErrDescByEngine(dateArr).then((res) => {
+        this.dialogVisible = true;
+      this.tableData=res.data
+      });
+    },
 
     /**
      * 平移缩放

+ 2 - 2
src/views/admin/cockpitManage/Index.vue

@@ -244,8 +244,8 @@ export default {
 .map-ditu {
   // min-width: 86.9vw;
   // max-width: 94.9vw;
-  // height: 93vh;
-  height: 100vh;
+  height: 93.3vh;
+  // height: 100vh;
   position: relative;
 }