Browse Source

里程高程图数据加载;激光云台监测数据与页面bug调整;门禁弹窗数据调整;人员入场弹窗提示

fan 1 month ago
parent
commit
f354bbdb58

+ 1 - 1
public/js/config.js

@@ -598,7 +598,7 @@ const LAYER_CONFIG = {
 const GY_STATIONS = [
   {
     id: '784104499768729600',
-    name: '托克托',
+    name: '托克托作业区',
     code: 'TKT',
     buildId: '784102618438836224',
     positioningBuildId: '100001',

+ 27 - 4
src/views/Home.vue

@@ -281,10 +281,17 @@ export default {
             }
           } else if (topic.startsWith("AccessControl/Log")) {
             const data = JSON.parse(content);
-            console.log("门禁事件数据", data);
-            if (this.$refs.routerView.$options.name === "basePage") {
-              this.$refs.routerView.pushZnmjStatus(data);
-            }
+            // console.log("门禁事件数据", data);
+            this.$notify({
+              dangerouslyUseHTMLString: true,
+              customClass: "notify-info",
+              title: "智能门禁",
+              message: data.Content,
+              duration: 1500,//自动关闭时间1.5s
+            });
+            // if (this.$refs.routerView.$options.name === "basePage") {
+            //   this.$refs.routerView.pushZnmjStatus(data);
+            // }
           } else if (topic.startsWith("Perimeter/")) {
             const data = JSON.parse(content);
             // console.log("周界报警数据", data);
@@ -316,6 +323,22 @@ export default {
   },
 };
 </script>
+<style>
+.notify-info {
+  top: 0.4rem !important;
+  right: 0.1rem !important;
+  width: 2rem !important;
+  background: rgba(24, 45, 77, 0.8) !important;
+  border-radius: 0.04rem 0px 0px 0.04rem !important;
+  border-color: #64bbff !important;
+}
+.el-notification__title {
+  color: white !important;
+}
+.el-notification__content {
+  color: white !important;
+}
+</style>
 <style lang="less" scoped>
 .home-container {
   pointer-events: none;

+ 2 - 1
src/views/alarm/alarmList/components/ConfirmMultiDialog.vue

@@ -18,6 +18,7 @@
           >
             <el-form-item label="确认信息:" prop="confirmContent">
               <el-input
+                ref="dealContent"
                 v-model="form.confirmContent"
                 type="textarea"
                 rows="5"
@@ -130,7 +131,7 @@ export default {
     onActivated() {
       console.log("aaa");
       this.$nextTick(() => {
-        // this.$refs.dealContent.focus()
+        this.$refs.dealContent.focus();
       });
     },
   },

+ 2 - 1
src/views/alarm/alarmList/components/DealMultiDialog.vue

@@ -31,6 +31,7 @@
             </el-form-item>
             <el-form-item label="处理信息:" prop="dealContent">
               <el-input
+                ref="dealContent"
                 v-model="form.dealContent"
                 type="textarea"
                 rows="5"
@@ -144,7 +145,7 @@ export default {
     onActivated() {
       console.log("aaa");
       this.$nextTick(() => {
-        // this.$refs.dealContent.focus()
+        this.$refs.dealContent.focus()
       });
     },
   },

+ 13 - 8
src/views/basePage/components/dialog/AlarmMapDialog.vue

@@ -162,7 +162,7 @@
         <el-button class="handle-btn" @click="handleAlarm">立即处理</el-button>
       </div>
     </div>
-    <audio id="mapAlarmAudio" src="/audio/onekeyalarm.mp3" loop></audio>
+    <!-- <audio id="mapAlarmAudio" src="/audio/onekeyalarm.mp3" loop></audio> -->
   </div>
 </template>
 
@@ -261,14 +261,14 @@ export default {
     },
     handleAlarm() {
       this.handleClose();
-      const id = this.dialogConfig.dialogMsg.data.alarmID;
+      const id = this.dialogConfig.dialogMsg.data.alarmId;
       console.log("立即处理事件信息", this.dialogConfig.dialogMsg);
-      // dealAlarm({ id }).then(res => {
-      //   // 关闭摄像头弹窗,后续再优化
-      //   if (!!this.dialogConfig.dialogMsg.data.cameraId) {
-      //     this.$store.dispatch('dialog/closeVideoDialog', this.dialogConfig.dialogMsg.data.cameraId)
-      //   }
-      // })
+      dealAlarm({ id }).then(res => {
+        // 关闭摄像头弹窗,后续再优化
+        if (!!this.dialogConfig.dialogMsg.data.cameraId) {
+          this.$store.dispatch('dialog/closeVideoDialog', this.dialogConfig.dialogMsg.data.cameraId)
+        }
+      })
       if (!!this.dialogConfig.dialogMsg.data.cameraId) {
         this.$store.dispatch(
           "dialog/closeVideoDialog",
@@ -320,8 +320,13 @@ export default {
       });
     },
     handleCancelJGYTAlarm() {
+      console.log(this.dialogConfig.dialogMsg.data);
+      console.log(this.$parent.jgytTagsData);
       this.$parent.pushJGYTStatus({
+        alarmPoint: null,
         alarmType: -1,
+        camera: null,
+        floorNo: 2,
         buildId: this.buildInfo.positioningBuildId,
         id: this.dialogConfig.dialogMsg.data.id,
       });

+ 1 - 1
src/views/basePage/components/dialog/StationAlarmDialog.vue

@@ -194,7 +194,7 @@ export default {
       this.$emit("handleClose");
     },
     handleAlarm() {
-      const id = this.dialogConfig.dialogMsg.data.alarmID;
+      const id = this.dialogConfig.dialogMsg.data.alarmId;
       dealAlarm({ id }).then((res) => {
         // 关闭摄像头弹窗,后续再优化
         if (!!this.dialogConfig.dialogMsg.data.cameraId) {

+ 2 - 1
src/views/basePage/index.vue

@@ -13,7 +13,8 @@
       @showPersonLayer="showPersonLayer"
       @openBuilding="openBuilding"
     />
-    <footer-navigation v-show="mapMode.value === 'home'" />
+    <footer-navigation/>
+    <!-- <footer-navigation v-show="mapMode.value === 'home'" /> -->
 
     <!-- 楼层控制 -->
     <floor-control

+ 2 - 1
src/views/basePage/mixins/LoadLayer/fire.js

@@ -140,7 +140,7 @@ export default {
       const dataSource = viewer.dataSources.getByName('layer_fire')
       if (dataSource.length > 0) {
         let item = dataSource[0].entities.getById(data.id)
-        console.log(item, "地图实体数据", item.properties.details._value, '接收参数', data);
+        // console.log(item, "地图实体数据", item.properties.details._value, '接收参数', data);
         if (!!item) {
           const { longitude, latitude } = this.buildInfo.gpsCoordinate0
           const gpsAlarmPoint = _locate(item.properties.details._value.location.x, item.properties.details._value.location.y, { x: longitude, y: latitude })
@@ -148,6 +148,7 @@ export default {
             this.$store.dispatch("globalConfig/setAlarmAudio", {
               show: true,
               alarmType: data.alarmType,
+              data: data
             });
             //报警点标记
             if (data.alarmPoint) {

+ 29 - 19
src/views/basePage/mixins/MapEvent.js

@@ -356,24 +356,34 @@ export default {
               position: [longitude, latitude, height],
             }
             //模型点击隐藏
-            // if (featureName.startsWith("综合楼")) {
-            //   setModelShow(//tkt
-            //     {
-            //       model: "tkt_yu0j1s",
-            //       part: [
-            //         "综合楼"
-            //       ],
-            //     },
-            //     false
-            //   );
-            // } else {
-            //   this.showModelToolTip(
-            //     feature.tileset.code,
-            //     feature.getProperty("id"),
-            //     pickObj,
-            //     obj
-            //   );
-            // }
+            if (featureName.startsWith("综合楼")) {
+              setModelShow(//tkt
+                {
+                  model: "tkt_yu0j1s",
+                  part: [
+                    "综合楼"
+                  ],
+                },
+                false
+              );
+            } else if (featureName.startsWith("110KV变电所")) {
+              setModelShow(//tkt
+                {
+                  model: "tkt_yu0j1s",
+                  part: [
+                    "110KV变电所"
+                  ],
+                },
+                false
+              );
+            } else {
+              this.showModelToolTip(
+                feature.tileset.code,
+                feature.getProperty("id"),
+                pickObj,
+                obj
+              );
+            }
             // console.log('地下模式', this.underGround)
             // if (!this.underGround) {
             //   const modelRootClickRet = this.setModelRoofVisible(feature.getProperty('name'))
@@ -460,7 +470,7 @@ export default {
       //鼠标右键点击人员,列出重叠人员,只有一个时不列出
       
       handler.setInputAction(movement => {
-        // setModelShow({ model: "tkt_yu0j1s" }, true);
+        setModelShow({ model: "tkt_yu0j1s" }, true);
         //输入一些位置信息,调试用
         // 从笛卡尔坐标获取经纬度
         let position = viewer.scene.pickPosition(movement.position)

+ 4 - 4
src/views/basePage/panels/RiskHint.vue

@@ -68,9 +68,9 @@ export default {
         ["306002"]: { name: "较大级别", color: "#FF9F00" },
         ["306003"]: { name: "一般级别", color: "#F8E71C" },
         ["306004"]: { name: "低级别", color: "#53A3FF" },
-        ["024001"]: { name: "较大级别", color: "#FF9F00" },
-        ["024002"]: { name: "一般级别", color: "#F8E71C" },
-        ["024003"]: { name: "低级别", color: "#53A3FF" },
+        ["024001"]: { name: "一级", color: "#FF9F00" },
+        ["024002"]: { name: "二级", color: "#F8E71C" },
+        ["024003"]: { name: "三级", color: "#53A3FF" },
       },
       hintData1: [
         {
@@ -105,7 +105,7 @@ export default {
   },
   mounted() {
     this.getAlarmDataList();
-    this.startMqtt();
+    // this.startMqtt();
   },
   watch: {
     departmentId(newVal) {

+ 34 - 4
src/views/components/baseHeader/left.vue

@@ -71,13 +71,16 @@
             <el-dropdown-item disabled>
               <!-- <div>{{ username }}</div> -->
             </el-dropdown-item>
-            <!-- <el-dropdown-item @click.native="test2">
+            <el-dropdown-item @click.native="test2">
               <span style="display: block">110一键报警</span>
             </el-dropdown-item>
-            <el-dropdown-item @click.native="test">
+            <!-- <el-dropdown-item @click.native="messageInfo">
+              <span style="display: block">弹窗</span>
+            </el-dropdown-item> -->
+            <!-- <el-dropdown-item @click.native="test">
               <span style="display: block">报警声音弹窗</span>
-            </el-dropdown-item>
-            <el-dropdown-item @click.native="test1">
+            </el-dropdown-item> -->
+            <!-- <el-dropdown-item @click.native="test1">
               <span style="display: block">入场动画开关</span>
             </el-dropdown-item> -->
             <!-- <el-dropdown-item @click.native="test3">
@@ -341,6 +344,17 @@ export default {
       //   this.$store.dispatch("globalConfig/setAlarmAudio", { show: true,alarmType: "024003" });
       // }, 40000);
     },
+    messageInfo() {
+      this.$notify({
+        //样式style块
+        dangerouslyUseHTMLString: true,
+        customClass: "notify-info",
+        title: "智能门禁",
+        message:
+          "【郝波】在门禁【托克托出站门禁】人脸认证通过,离开【托克托压气站】",
+        // duration: 0,
+      });
+    },
     init() {
       this.setBuildId("");
       // this.jumpRoute("/basePage", { buildId: "654044537953460225" });
@@ -646,6 +660,22 @@ export default {
   },
 };
 </script>
+<style>
+.notify-info {
+  top: 0.4rem !important;
+  right: 0.1rem !important;
+  width: 2rem !important;
+  background: rgba(24, 45, 77, 0.8) !important;
+  border-radius: 0.04rem 0px 0px 0.04rem !important;
+  border-color: #64bbff !important;
+}
+.el-notification__title {
+  color: white !important;
+}
+.el-notification__content {
+  color: white !important;
+}
+</style>
 <style lang="less" scoped>
 .base-header-container {
   // width: 1920px;

+ 1 - 1
src/views/components/chart/DateTimeBar.vue

@@ -80,7 +80,7 @@ export default {
         "#EC576A",
       ],
       dataZoomMix: 0,
-      chartType: "bar",
+      chartType: "line",
     };
   },
   mounted() {

+ 47 - 11
src/views/components/dialog/AccessControlDialog.vue

@@ -8,7 +8,7 @@
       <!-- 内容 -->
       <div>
         <el-row class="access_video" :key="refreshKey">
-          <el-col :span="8">
+          <!-- <el-col :span="8">
             <div class="select">
               <div class="select_title">
                 车辆识别1
@@ -69,14 +69,14 @@
                 />
               </div>
             </div>
-          </el-col>
-          <el-col :span="8">
+          </el-col> -->
+          <el-col :span="12">
             <div class="select">
               <div class="select_title">
                 人脸识别
                 <el-select
                   value-key="id"
-                  v-model="cameraFaceInfo"
+                  v-model="cameraFaceInfo1"
                   style="width: 160px"
                   size="mini"
                   clearable
@@ -95,8 +95,39 @@
             <div class="select_video">
               <div class="select_video_main">
                 <video-image-window
-                  :cameraData="cameraFaceInfo.camera"
-                  :cameraId="cameraFaceInfo.camera.id"
+                  :cameraData="cameraFaceInfo1.camera"
+                  :cameraId="cameraFaceInfo1.camera.id"
+                />
+              </div>
+            </div>
+          </el-col>
+          <el-col :span="12">
+            <div class="select">
+              <div class="select_title">
+                人脸识别
+                <el-select
+                  value-key="id"
+                  v-model="cameraFaceInfo2"
+                  style="width: 160px"
+                  size="mini"
+                  clearable
+                  placeholder="请选择摄像头"
+                  @change="exchangeVideo(4, $event)"
+                >
+                  <el-option
+                    v-for="item in cameraFaceList"
+                    :key="item.id"
+                    :value="item"
+                    :label="item.name"
+                  ></el-option>
+                </el-select>
+              </div>
+            </div>
+            <div class="select_video">
+              <div class="select_video_main">
+                <video-image-window
+                  :cameraData="cameraFaceInfo2.camera"
+                  :cameraId="cameraFaceInfo2.camera.id"
                 />
               </div>
             </div>
@@ -240,8 +271,8 @@ export default {
       baseDialogConfig: {
         dialogId: "accessControlDialog",
         show: false,
-        title: "出入门控制",
-        width: 1440,
+        title: "智能门禁",
+        width: 1240,
         height: 680,
         center: true,
         zIndex: 10,
@@ -272,7 +303,8 @@ export default {
         { id: "2", name: "摄像头2" },
         { id: "3", name: "摄像头3" },
       ],
-      cameraFaceInfo: { id: "1", name: "摄像头1", camera: { id: "1" } },
+      cameraFaceInfo1: { id: "1", name: "摄像头1", camera: { id: "1" } },
+      cameraFaceInfo2: { id: "1", name: "摄像头1", camera: { id: "1" } },
       cameraCarInfo1: { id: "2", name: "摄像头2", camera: { id: "1" } },
       cameraCarInfo2: { id: "3", name: "摄像头3", camera: { id: "1" } },
       departmentOptions: [],
@@ -452,9 +484,10 @@ export default {
       // console.log("分类门禁列表", this.cameraFaceList, this.cameraCarList);
       setTimeout(() => {
         if (this.cameraFaceList && this.cameraFaceList.length > 0) {
-          this.cameraFaceInfo = this.filterCamera(
+          this.cameraFaceInfo1 = this.filterCamera(
             this.cameraFaceList[this.cameraFaceList.length - 1]
           );
+          this.cameraFaceInfo2 = this.filterCamera(this.cameraFaceList[0]);
         }
         if (this.cameraCarList && this.cameraCarList.length > 1) {
           this.cameraCarInfo1 = this.filterCamera(this.cameraCarList[0]);
@@ -480,7 +513,10 @@ export default {
           this.cameraCarInfo2 = this.filterCamera(e);
           break;
         case 3:
-          this.cameraFaceInfo = this.filterCamera(e);
+          this.cameraFaceInfo1 = this.filterCamera(e);
+          break;
+        case 4:
+          this.cameraFaceInfo2 = this.filterCamera(e);
           break;
 
         default:

+ 10 - 10
src/views/components/dialog/AlarmAudioDialog.vue

@@ -50,34 +50,34 @@ export default {
             //报警类型匹配报警声音
             switch (val.alarmType) {
               case "all":
-                this.alarmURL = "/audio/inoutalarm.mp3";
+                this.alarmURL = "/audio/onekeyalarm.mp3";
                 break;
               case "024001":
-                this.alarmURL = "/audio/onekeyalarm.mp3";
+                this.alarmURL = "/audio/longalarm.mp3";
                 break;
               case "024002":
-                this.alarmURL = "/audio/inoutalarm.mp3";
+                this.alarmURL = "/audio/onekeyalarm.mp3";
                 break;
               case "024003":
-                this.alarmURL = "/audio/longalarm.mp3";
+                this.alarmURL = "/audio/inoutalarm.mp3";
                 break;
               case "1":
-                this.alarmURL = "/audio/onekeyalarm.mp3";
+                this.alarmURL = "/audio/longalarm.mp3";
                 break;
               case "2":
-                this.alarmURL = "/audio/inoutalarm.mp3";
+                this.alarmURL = "/audio/onekeyalarm.mp3";
                 break;
               case "3":
-                this.alarmURL = "/audio/longalarm.mp3";
+                this.alarmURL = "/audio/inoutalarm.mp3";
                 break;
               case "306001":
-                this.alarmURL = "/audio/inoutalarm.mp3";
+                this.alarmURL = "/audio/longalarm.mp3";
                 break;
               case "306002":
-                this.alarmURL = "/audio/otheralarm.mp3";
+                this.alarmURL = "/audio/onekeyalarm.mp3";
                 break;
               case "306003":
-                this.alarmURL = "/audio/longalarm.mp3";
+                this.alarmURL = "/audio/inoutalarm.mp3";
                 break;
               default:
                 break;

+ 172 - 28
src/views/components/dialog/JGYTControlDialog/index.vue

@@ -8,7 +8,7 @@
       <!-- 内容 -->
       <div class="detail-table-box">
         <el-row>
-          <el-col :span="8">
+          <!-- <el-col :span="8">
             <div class="search-box">
               <div class="search-item">
                 <span class="search-label">场站:</span>
@@ -29,22 +29,57 @@
                   ></el-option>
                 </el-select>
               </div>
-              <!-- <div class="search-btn2" @click="openAll">
-                <el-button size="mini" type="success">人员授权</el-button>
-              </div>
-              <div class="search-btn2" @click="closeAll">
-                <el-button size="mini" type="warning">车辆授权</el-button>
-              </div> -->
-              <!-- <div class="search-btn2" @click="openBroadcast">
-                  <el-button size="mini" type="success">开门</el-button>
-                </div>
-                <div class="search-btn2" @click="closeBroadcast">
-                  <el-button size="mini" type="danger">关门</el-button>
-                </div> -->
             </div>
             <div class="info_list">
               <base-table-list :tableConfig="tableConfig" />
             </div>
+          </el-col> -->
+          <el-col class="jgyt_video" :span="12">
+            <div class="select">
+              <div class="select_title">
+                泄漏检测
+                <el-select
+                  value-key="id"
+                  v-model="cameraInfo1"
+                  style="width: 220px"
+                  size="mini"
+                  clearable
+                  placeholder="请选择摄像头"
+                  @change="exchangeVideo()"
+                >
+                  <el-option
+                    v-for="item in cameraList"
+                    :key="item.id"
+                    :value="item"
+                    :label="item.name"
+                  ></el-option>
+                </el-select>
+              </div>
+            </div>
+            <div class="select_video">
+              <div class="select_video_main">
+                <video-image-window
+                  :cameraData="cameraInfo1"
+                  :cameraId="cameraInfo1.id"
+                />
+              </div>
+            </div>
+            <div class="select_tag_content">
+              <div class="tag_data">
+                浓度:{{ this.getTagsValue(this.jgyt1.concentrationTag) }}
+              </div>
+              <div class="tag_data">
+                光强:{{ this.getTagsValue(this.jgyt1.lightIntensityTag) }}
+              </div>
+            </div>
+            <div class="select_tag_content">
+              <div class="tag_data">
+                垂直角度:{{ this.getTagsValue(this.jgyt1.panTag) }}
+              </div>
+              <div class="tag_data">
+                水平角度:{{ this.getTagsValue(this.jgyt1.tileTag) }}
+              </div>
+            </div>
           </el-col>
           <el-col class="jgyt_video" :span="12">
             <div class="select">
@@ -52,7 +87,7 @@
                 泄漏检测
                 <el-select
                   value-key="id"
-                  v-model="cameraInfo"
+                  v-model="cameraInfo2"
                   style="width: 220px"
                   size="mini"
                   clearable
@@ -71,15 +106,31 @@
             <div class="select_video">
               <div class="select_video_main">
                 <video-image-window
-                  :cameraData="cameraInfo"
-                  :cameraId="cameraInfo.id"
+                  :cameraData="cameraInfo2"
+                  :cameraId="cameraInfo2.id"
                 />
               </div>
             </div>
+            <div class="select_tag_content">
+              <div class="tag_data">
+                浓度:{{ this.getTagsValue(this.jgyt2.concentrationTag) }}
+              </div>
+              <div class="tag_data">
+                光强:{{ this.getTagsValue(this.jgyt2.lightIntensityTag) }}
+              </div>
+            </div>
+            <div class="select_tag_content">
+              <div class="tag_data">
+                垂直角度:{{ this.getTagsValue(this.jgyt2.panTag) }}
+              </div>
+              <div class="tag_data">
+                水平角度:{{ this.getTagsValue(this.jgyt2.tileTag) }}
+              </div>
+            </div>
           </el-col>
-          <el-col :span="4">
+          <!-- <el-col :span="4">
             <video-control :curVideoData="cameraInfo" />
-          </el-col>
+          </el-col> -->
         </el-row>
         <el-row :key="refreshKey">
           <el-col :span="24">
@@ -99,6 +150,7 @@
   </base-drag-bg-dialog>
 </template>
   <script>
+import Vue from "vue";
 import BaseTableList from "@/views/components/base/BaseTableList";
 import BaseDragBgDialog from "@/views/components/base/BaseDragBgDialog.vue";
 import VideoImageWindow from "@/views/components/dialog/VideoImageWindow.vue";
@@ -141,7 +193,7 @@ export default {
       handler(newValue) {
         // this.filterKey = "";
         if (newValue && newValue.length > 0) {
-          this.recrodTableConfig.tableData = newValue;
+          this.recordTableConfig.tableData = newValue;
         }
         this.refresh();
       },
@@ -173,7 +225,7 @@ export default {
         show: false,
         title: "泄漏检测",
         width: 1250,
-        height: 680,
+        height: 724,
         center: true,
         zIndex: 10,
       },
@@ -212,7 +264,12 @@ export default {
         ],
       },
       cameraList: [{ id: "1", name: "摄像头1" }],
-      cameraInfo: {
+      jgyt1: {},
+      jgyt2: {},
+      cameraInfo1: {
+        id: "1",
+      },
+      cameraInfo2: {
         id: "1",
       },
       departmentOptions: [],
@@ -220,6 +277,8 @@ export default {
         id: "",
         positioningBuildId: "",
       },
+      tagList: [],
+      tagDataList: [],
     };
   },
   created() {
@@ -248,11 +307,17 @@ export default {
         const res = await getJGYTList(params);
         this.dataList = res.data.content;
         // console.log("激光云台列表", this.dataList);
+        this.startMqtt();
+        if (this.dataList && this.dataList.length > 0) {
+          this.jgyt1 = this.dataList[0];
+          this.jgyt2 = this.dataList[this.dataList.length - 1];
+        }
         this.cameraList = this.dataList.map((e) => e.camera);
         if (this.cameraList && this.cameraList.length > 0) {
-          this.cameraInfo = this.cameraList[0];
+          this.cameraInfo1 = this.cameraList[0];
+          this.cameraInfo2 = this.cameraList[this.cameraList.length - 1];
         }
-        // console.log("激光云台摄像头列表", this.cameraList, this.cameraInfo);
+        // console.log("激光云台摄像头列表",this.cameraList,this.cameraInfo1,this.cameraInfo2);
       } catch (err) {
         console.log(err);
       }
@@ -342,11 +407,6 @@ export default {
       });
       this.closeDialog();
     },
-    exchangeVideo() {},
-    openAll() {},
-    closeAll() {},
-    openBroadcast() {},
-    closeBroadcast() {},
     handleClose(item) {
       let index = -1;
       for (let i = 0; i < this.openningList.length; i++) {
@@ -357,6 +417,78 @@ export default {
         }
       }
     },
+    startMqtt() {
+      const topics = this.tagList;
+      const _this = this;
+      this.$store.dispatch("mqtt/subscribe", {
+        topic: ["DataCommunication/TagData/#"],
+        onMessage: (topic, message, packet) => {
+          const content = message.toString();
+          if (topic.startsWith("DataCommunication/TagData/")) {
+            let data = JSON.parse(content);
+            Vue.set(this.tagDataList, data.Tag, data);
+          }
+        },
+      });
+      setTimeout(() => {
+        this.refreshSubscribe();
+        // console.log("激光云台弹窗实时数据:", this.tagDataList);
+      }, 1000);
+      this.$once("hook:beforeDestroy", () => {
+        this.$store.dispatch("mqtt/unsubscribe", topics);
+      });
+    },
+    refreshSubscribe() {
+      // this.tagDataList = {};
+      // console.log(this.mqttClient.connected);
+      if (this.mqttClient && this.mqttClient.connected) {
+        let tags = [];
+        if (this.dataList) {
+          //激光云台设备列表
+          if (this.tagList.length == 0) {
+            this.dataList.forEach((e) => {
+              if (e.type === 1) {
+                tags.push(`DataCommunication/TagData/` + e.concentrationTag);
+                tags.push(`DataCommunication/TagData/` + e.lightIntensityTag);
+                tags.push(`DataCommunication/TagData/` + e.panTag);
+                tags.push(`DataCommunication/TagData/` + e.tileTag);
+              } else {
+                tags.push(
+                  `DataCommunication/TagData/` + e.dahua_ConcentrationLelTag
+                );
+                tags.push(
+                  `DataCommunication/TagData/` + e.dahua_ConcentrationTag
+                );
+                tags.push(
+                  `DataCommunication/TagData/` + e.dahua_PresetIndexTag
+                );
+                tags.push(`DataCommunication/TagData/` + e.dahua_PresetNameTag);
+              }
+            });
+            this.tagList = tags;
+          }
+        }
+        // console.log("newTopic", tags);
+        let unsubscribeTopicArray = lodash.difference(this.tagList, tags);
+        if (unsubscribeTopicArray.length > 0) {
+          //console.log('解除订阅', unsubscribeTopicArray)
+          this.mqttClient.unsubscribe(unsubscribeTopicArray);
+        }
+        let subscribeTopicArray = lodash.difference(tags, this.tagList);
+        if (subscribeTopicArray.length > 0) {
+          //console.log('订阅', subscribeTopicArray)
+          this.mqttClient.subscribe(subscribeTopicArray);
+        }
+        this.tagList = tags;
+      } else {
+        setTimeout(() => {
+          this.refreshSubscribe();
+        }, 1000);
+      }
+    },
+    getTagsValue(tag) {
+      return this.tagDataList[tag]&&this.tagDataList[tag].Value?this.tagDataList[tag].Value:"";
+    },
   },
 };
 </script>
@@ -462,6 +594,18 @@ export default {
         height: 100%;
       }
     }
+    .select_tag_content {
+      text-align: left;
+      font-size: 0.083333rem /* 16/192 */;
+      line-height: 22px /* 50/192 */;
+      color: #fff;
+      display: flex;
+      justify-content: space-around;
+      .tag_data {
+        padding-left: 10px;
+        width: 30%;
+      }
+    }
     .tag_info {
       text-align: left;
       font-size: 0.083333rem /* 16/192 */;

+ 22 - 16
src/views/components/dialog/PipeMileageDialog.vue

@@ -41,6 +41,12 @@ export default {
     "pipeMileageDialog.show": {
       handler(newVal) {
         this.baseDialogConfig.show = newVal;
+        if (this.statisticData.date.length == 0) {
+          this.getMileageList();
+        }
+        // if (newVal) {
+        //   this.openFullScreen()
+        // }
       },
       // deep: true,
       immediate: true,
@@ -52,28 +58,17 @@ export default {
       baseDialogConfig: {
         dialogId: "pipeMileage",
         show: false,
-        title: "陕京四线高程图",
+        title: "陕京四线里程高程图",
         width: 1560,
         height: 460,
         center: true,
         zIndex: 10,
       },
       statisticData: {
-        date: [
-          319820.7, 319941.7, 320040.1, 320149.9, 320248.8, 320334.5, 320435.5,
-          320538.9, 320648.7, 320770.1, 320890.2, 321009.4, 321127.3, 321222.8,
-          321307.6, 321412.7, 321533.1, 321640.9, 321761.1, 321869.4, 321945.6,
-          321997.2, 322082.9, 322202.9, 322321.8, 322442.9, 322535.9, 322651.4,
-          322770.6, 322875.1, 322985.9,
-        ],
+        date: [],
         seriesData: [
           {
-            data: [
-              1446.7, 1428.5, 1428.7, 1442.3, 1427.5, 1429.3, 1420.8, 1432.8,
-              1442.6, 1446.8, 1447.9, 1447.8, 1439.9, 1441.1, 1443.7, 1444.8,
-              1443.8, 1440.8, 1437.3, 1437.8, 1437.8, 1434.5, 1433.3, 1424.8,
-              1420, 1418.6, 1410.6, 1396.5, 1394.8, 1399.5, 1396.8,
-            ],
+            data: [],
             name: "高程",
             code: "100006",
             markPointData: [],
@@ -87,10 +82,10 @@ export default {
   computed: {
     ...mapGetters(["pipeMileageDialog"]),
   },
-  created() {
+  created() {},
+  mounted() {
     this.getMileageList();
   },
-  mounted() {},
   methods: {
     closeDialog() {
       this.$store.dispatch("dialog/setPipeMileageDialog", {
@@ -150,6 +145,17 @@ export default {
         this.getCacheData();
       }
     },
+    openFullScreen() {
+      const loading = this.$loading({
+        lock: true,
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+      setTimeout(() => {
+        loading.close();
+      }, 800);
+    },
   },
 };
 </script>