JX.LI 2 年之前
父节点
当前提交
5bc1041ef1
共有 1 个文件被更改,包括 44 次插入29 次删除
  1. 44 29
      src/views/forest.vue

+ 44 - 29
src/views/forest.vue

@@ -117,7 +117,8 @@
         </div>
       </div>
       <!-- 地图 -->
-      <supermap ref="supermap" style="width: 100%;height: 100vh;" @showEventDialog="showEventDialog" :showLayer="true" @fatherMethod="fatherMethod"></supermap>
+      <supermap ref="supermap" style="width: 100%;height: 100vh;" @showEventDialog="showEventDialog" :showLayer="true"
+        @fatherMethod="fatherMethod"></supermap>
       <!-- 右侧 -->
       <div class="rightbar rightbar-index" ref="right">
         <div class="right-item1">
@@ -289,12 +290,12 @@
                 <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;" />
               </div>
               <div class="sj-search">
-                  <el-input placeholder="请输入内容" prefix-icon="el-icon-search" v-model="eventSearch"
-                    @change="getEventList(calendarDay, 10, 1, eventSearch)">
-                  </el-input>
-                </div>
+                <el-input placeholder="请输入内容" prefix-icon="el-icon-search" v-model="eventSearch"
+                  @change="getEventList(calendarDay, 10, 1, eventSearch)">
+                </el-input>
+              </div>
               <div class="i-list-con small-bottom-margin" style="height: 24vh;">
-                
+
                 <div class="d-l-con padding-box nowrap" v-for="(item, index) in eventList"
                   @click="dropLocation(item.latitude, item.longitude,item.eventCode)" data-html2canvas-ignore>
                   <div class="bgt-img">
@@ -461,7 +462,9 @@
   import TVWalls from '@/components/TVWalls.vue' //电视墙弹窗
   import eventdetailsdialog from '@/views/eventdetailsdialog.vue' //事件详情弹窗
   import firespread from '@/views/firespread.vue' //事件详情弹窗
-  import {getIconBg} from '@/api/components/sookaMapIcon';//资源底色控制文件
+  import {
+    getIconBg
+  } from '@/api/components/sookaMapIcon'; //资源底色控制文件
   import Firespread from "./firespread";
   import chart from "./from/dvCapsuleChart.vue";
   import {
@@ -729,7 +732,8 @@
                 '<span>' +
                 ' <div class="d-l-con">' +
                 '   <div class="d-l-l-text">' +
-                '     <h4>竣工日期:' + ((list[i].completionDate?list[i].completionDate:list[i].completion_date)?(list[i].completionDate?list[i].completionDate:list[i].completion_date):"") + '</h4>' +
+                '     <h4>竣工日期:' + ((list[i].completionDate ? list[i].completionDate : list[i].completion_date) ? (list[
+                  i].completionDate ? list[i].completionDate : list[i].completion_date) : "") + '</h4>' +
                 '   </div>' +
                 ' </div>' +
                 '</span>' +
@@ -737,28 +741,32 @@
                 '<span>' +
                 ' <div class="d-l-con">' +
                 '   <div class="d-l-l-text">' +
-                '     <h4>管理单位:' + ((list[i].managementUnit?list[i].managementUnit:list[i].management_unit)?(list[i].managementUnit?list[i].managementUnit:list[i].management_unit):"") + '</h4>' +
+                '     <h4>管理单位:' + ((list[i].managementUnit ? list[i].managementUnit : list[i].management_unit) ? (list[
+                  i].managementUnit ? list[i].managementUnit : list[i].management_unit) : "") + '</h4>' +
                 '   </div>' +
                 ' </div>' +
                 '</span>' +
                 '<span>' +
                 ' <div class="d-l-con">' +
                 '   <div class="d-l-l-text">' +
-                '     <h4>联系电话:' + ((list[i].manaTel?list[i].manaTel:list[i].mana_tel)?(list[i].manaTel?list[i].manaTel:list[i].mana_tel):"") + '</h4>' +
+                '     <h4>联系电话:' + ((list[i].manaTel ? list[i].manaTel : list[i].mana_tel) ? (list[i].manaTel ? list[i]
+                  .manaTel : list[i].mana_tel) : "") + '</h4>' +
                 '   </div>' +
                 ' </div>' +
                 '</span>' +
                 '<span>' +
                 ' <div class="d-l-con">' +
                 '   <div class="d-l-l-text">' +
-                '     <h4>养护单位:' + ((list[i].maintenanceUnit?list[i].maintenanceUnit:list[i].maintenance_unit)?(list[i].maintenanceUnit?list[i].maintenanceUnit:list[i].maintenance_unit):"") + '</h4>' +
+                '     <h4>养护单位:' + ((list[i].maintenanceUnit ? list[i].maintenanceUnit : list[i].maintenance_unit) ? (
+                  list[i].maintenanceUnit ? list[i].maintenanceUnit : list[i].maintenance_unit) : "") + '</h4>' +
                 '   </div>' +
                 ' </div>' +
                 '</span>' +
                 '<span>' +
                 ' <div class="d-l-con">' +
                 '   <div class="d-l-l-text">' +
-                '     <h4>联系电话:' + ((list[i].mainTel?list[i].mainTel:list[i].main_tel)?(list[i].mainTel?list[i].mainTel:list[i].main_tel):"") + '</h4>' +
+                '     <h4>联系电话:' + ((list[i].mainTel ? list[i].mainTel : list[i].main_tel) ? (list[i].mainTel ? list[i]
+                  .mainTel : list[i].main_tel) : "") + '</h4>' +
                 '   </div>' +
                 ' </div>' +
                 '</span>';
@@ -1205,12 +1213,11 @@
         that.getEventList(that.calendarDay, that.pageSize, that.pageNum, '', false)
       },
       getEventList(day, pageSize, pageNum, eventSearch, loading) {
-        let num=this.eventList.length/pageSize+1
+        let num = this.eventList.length / pageSize + 1
         if (pageNum < 1) {
           this.$modal.msg('当前已是第一页')
           return
-        } else if(pageNum>this.totalAllEvent/10+1)
-        {
+        } else if (pageNum > this.totalAllEvent / 10 + 1) {
           this.$modal.msg('当前已是最后一页')
           return;
         }
@@ -1298,6 +1305,9 @@
       getWebSocketEvent(data) {
         let that = this
         const event = data
+        if (typeof data != 'object') {
+          event = JSON.parse(data);
+        }
         //右侧获取事件列表
         that.markersList = []
         let markersMap = {
@@ -1408,8 +1418,7 @@
         // let data = "{\"fromId\":\"forest\",\"fromUserId\":\""+Cookies.get('username')+"\",\"toUserId\":\""+Cookies.get('username')+"\"}";
         let data = "{\"fromId\":\"traffic\"}";
         if (this.calendarDay == this.getCurrentDataStr() && data != e.data) {
-          // 处理收到的消息
-          this.handleWebSoceketEvent(e.data)
+
 
 
           this.getTodayEvents(this.getCurrentDataStr(), false);
@@ -1417,7 +1426,8 @@
           this.getEventByEventType(this.getCurrentDataStr(), false);
           this.getEventByReportorOrder(this.getCurrentDataStr(), false);
           this.getExposureStage(this.getCurrentDataStr(), false);
-
+          // 处理收到的消息
+          this.handleWebSoceketEvent(e.data)
           this.$refs.bottomMenu.updateAlert();
           this.$refs.up.play();
           // thes.$refs.up.pause();//停止播放音乐
@@ -1480,7 +1490,7 @@
 
       /** ----------------------------------底部按钮公用组件开始------------------------------------- */
       bottomMenuList() {
-        this.$refs.bottomMenu.selectTaskList()//获取任务列表
+        this.$refs.bottomMenu.selectTaskList() //获取任务列表
         this.$refs.bottomMenu.selectMessageList() //获取消息列表
       },
       showDialog(click) {
@@ -1585,15 +1595,21 @@
 <style lang="scss">
   @import '@/assets/styles/base.scss';
 
-  .bottomRight{
-    .el-table .el-table__header-wrapper th, .el-table .el-table__fixed-header-wrapper th {
+  .bottomRight {
+
+    .el-table .el-table__header-wrapper th,
+    .el-table .el-table__fixed-header-wrapper th {
       background-color: $searchBG;
 
     }
-    .el-table td.el-table__cell, .el-table th.el-table__cell.is-leaf {
+
+    .el-table td.el-table__cell,
+    .el-table th.el-table__cell.is-leaf {
       border-bottom: 1px $tableBorder;
     }
-    .el-table--border, .el-table--border::after {
+
+    .el-table--border,
+    .el-table--border::after {
       border: 1px $tableBorder;
       background-color: $searchBG
     }
@@ -1604,7 +1620,8 @@
       }
 
       .el-table__cell {
-        border-right: 1px $tableBorder;;
+        border-right: 1px $tableBorder;
+        ;
       }
 
     }
@@ -1617,8 +1634,7 @@
       background: $searchBG;
       color: $inBlue;
 
-      thead {
-      }
+      thead {}
 
       tr {
         background: $searchBG;
@@ -1669,9 +1685,8 @@
       }
     }
 
-    .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
+    .el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell {
       background-color: #0f3655;
     }
   }
-
-</style>
+</style>