wangzhe %!s(int64=2) %!d(string=hai) anos
pai
achega
414a538225
Modificáronse 3 ficheiros con 35 adicións e 15 borrados
  1. 0 1
      src/api/resources.js
  2. 8 0
      src/components/vBottomMenu.vue
  3. 27 14
      src/views/resources.vue

+ 0 - 1
src/api/resources.js

@@ -22,7 +22,6 @@ export function selectResourcesByLabel(label) {
   return request({
   return request({
     url: '/center-traffic/traffic/selectResourcesByLabel',
     url: '/center-traffic/traffic/selectResourcesByLabel',
     method: 'post',
     method: 'post',
-    // data:{"label":label}
     data:{"label":label}
     data:{"label":label}
   })
   })
 }
 }

+ 8 - 0
src/components/vBottomMenu.vue

@@ -763,6 +763,14 @@
           this.messageCount = response.data
           this.messageCount = response.data
         });
         });
       },
       },
+      // selectTaskList: async function() {
+      //   //获取任务列表
+      //   selectTaskBO().then(res => {
+      //     this.taskList = res.data
+      //     this.taskCount = res.data.length
+      //   })
+      //   this.initWebSocket(this.wsuri2,this.websockSid.userId)
+      // },
       /** 获取消息列表 */
       /** 获取消息列表 */
       selectMessageList(){
       selectMessageList(){
         selectMessageList(Cookies.get("userId")).then(response => {
         selectMessageList(Cookies.get("userId")).then(response => {

+ 27 - 14
src/views/resources.vue

@@ -15,6 +15,7 @@
                 <div class="icon-con" :class="{on:iconCurrentIndex==item.resourceTable}"
                 <div class="icon-con" :class="{on:iconCurrentIndex==item.resourceTable}"
                      v-for="(item,index) in resourcesCountList"
                      v-for="(item,index) in resourcesCountList"
                      v-on:click="selectResourcesByLabel(item.type)">
                      v-on:click="selectResourcesByLabel(item.type)">
+                     <!--v-on:click="selectResourcesByLabel(item.label)">-->
                   <!--v-on:click="indentleftSetMarkers(item.resourceTable)">-->
                   <!--v-on:click="indentleftSetMarkers(item.resourceTable)">-->
                   <div class="iconfont icon icon-normal" :class="item.icon"></div>
                   <div class="iconfont icon icon-normal" :class="item.icon"></div>
                   <div class="icon-text">
                   <div class="icon-text">
@@ -133,8 +134,10 @@
       getResourcesCount(){
       getResourcesCount(){
         let that = this
         let that = this
         getResourcesCount().then(res => {
         getResourcesCount().then(res => {
+          console.log("res=", res)
+          console.log("res.data=", res.data)
           this.resourcesCountList = res.data;
           this.resourcesCountList = res.data;
-          res.data.forEach(function(data, index) {
+          this.resourcesCountList.forEach(function(data, index) {
             // that.$set(that.resourcesList[index], 'icon', 'sj' + '-' + 'icon' + '-' + data.resourceTable.split('_').slice(-1))
             // that.$set(that.resourcesList[index], 'icon', 'sj' + '-' + 'icon' + '-' + data.resourceTable.split('_').slice(-1))
             console.log("data.type.split('_').slice(-1)", data.type.split('_').slice(-1));
             console.log("data.type.split('_').slice(-1)", data.type.split('_').slice(-1));
             that.$set(that.resourcesList[index], 'icon', 'sj' + '-' + 'icon' + '-' + data.type.replaceAll("_", "-"));
             that.$set(that.resourcesList[index], 'icon', 'sj' + '-' + 'icon' + '-' + data.type.replaceAll("_", "-"));
@@ -158,15 +161,19 @@
         that.$refs.supermap.clearM(false);
         that.$refs.supermap.clearM(false);
         that.$refs.supermap.clearM(true);
         that.$refs.supermap.clearM(true);
         selectResourcesByLabel(label).then(res => {
         selectResourcesByLabel(label).then(res => {
-          this.resourcesList = res.data;
-          this.initMarkers(this.resourcesList);
+          console.log("res.data=", res.data)
+          // this.resourcesList = res.data;
+          this.resourcesList = res.data.resourceList;
+          this.initMarkers(this.resourcesList, label.split('_').slice(-1));
+          // this.initMarkers(this.resourcesList);
         })
         })
       },
       },
       showResourcesDialog(param) {
       showResourcesDialog(param) {
         //资源信息弹出
         //资源信息弹出
         this.$refs.resourcesdialog.showResourcesDialog(param);
         this.$refs.resourcesdialog.showResourcesDialog(param);
       },
       },
-      initMarkers(list){
+      initMarkers(list, type){
+        console.log("list=", list)
         if (list != null && list.length > 0) {
         if (list != null && list.length > 0) {
           for (let i = 0; i < list.length; i++) {
           for (let i = 0; i < list.length; i++) {
             let markersMap = {
             let markersMap = {
@@ -183,8 +190,13 @@
               markersMap.isAggregation = true;
               markersMap.isAggregation = true;
             }
             }
             //根据标签确定资源的图标
             //根据标签确定资源的图标
+            // markersMap.icon = 'traffic-resources-' + type;
+            // alert(type+"=type")
+            // alert(this.resourcesList[i].label+"=this.resourcesList[i].label")
             markersMap.icon = 'traffic-resources-' + this.resourcesList[i].label;
             markersMap.icon = 'traffic-resources-' + this.resourcesList[i].label;
+            markersMap.icon = 'traffic-resources-' + (type?type=="sign"?"warning_sign":type:this.resourcesList[i].label);
             markersMap.parameter = this.resourcesList[i].id + "," + this.resourcesList[i].label;
             markersMap.parameter = this.resourcesList[i].id + "," + this.resourcesList[i].label;
+            markersMap.parameter = this.resourcesList[i].id + "," + (type?type:this.resourcesList[i].label);
             markersMap.click = 'showResourcesDialog';
             markersMap.click = 'showResourcesDialog';
             markersMap.lng = list[i].longitude;
             markersMap.lng = list[i].longitude;
             markersMap.lat = list[i].latitude;
             markersMap.lat = list[i].latitude;
@@ -197,12 +209,12 @@
               '   </div>' +
               '   </div>' +
               ' </div>' +
               ' </div>' +
               '</span>';
               '</span>';
-            if(list[i].label == this.labelList[0]){//警示牌的POP
+            if(list[i].label == this.labelList[0] || this.labelList[0].indexOf(type) != -1){//警示牌的POP
               markersMap.bindPopupHtml += ''+
               markersMap.bindPopupHtml += ''+
                 '<span>' +
                 '<span>' +
                 ' <div class="d-l-con">' +
                 ' <div class="d-l-con">' +
                 '   <div class="d-l-l-text">' +
                 '   <div class="d-l-l-text">' +
-                '     <h4>设置日期:' + list[i].setTime + '</h4>' +
+                '     <h4>设置日期:' + (list[i].setTime?list[i].setTime:list[i].set_time) + '</h4>' +
                 '   </div>' +
                 '   </div>' +
                 ' </div>' +
                 ' </div>' +
                 '</span>' +
                 '</span>' +
@@ -214,12 +226,12 @@
                 ' </div>' +
                 ' </div>' +
                 '</span>';
                 '</span>';
             }
             }
-            if(list[i].label == this.labelList[1] || list[i].label == this.labelList[2]){//桥梁涵洞的POP
-              markersMap.bindPopupHtml += ''+
+            if(list[i].label == this.labelList[1] || list[i].label == this.labelList[2] || this.labelList[1].indexOf(type) != -1 || this.labelList[2].indexOf(type) != -1){//桥梁涵洞的POP
+              markersMap.bindPopupHtml += '' +
                 '<span>' +
                 '<span>' +
                 ' <div class="d-l-con">' +
                 ' <div class="d-l-con">' +
                 '   <div class="d-l-l-text">' +
                 '   <div class="d-l-l-text">' +
-                '     <h4>竣工日期:' + list[i].completionDate + '</h4>' +
+                '     <h4>竣工日期:' + (list[i].completionDate?list[i].completionDate:list[i].completion_date) + '</h4>' +
                 '   </div>' +
                 '   </div>' +
                 ' </div>' +
                 ' </div>' +
                 '</span>' +
                 '</span>' +
@@ -227,28 +239,28 @@
                 '<span>' +
                 '<span>' +
                 ' <div class="d-l-con">' +
                 ' <div class="d-l-con">' +
                 '   <div class="d-l-l-text">' +
                 '   <div class="d-l-l-text">' +
-                '     <h4>管理单位:' + list[i].managementUnit + '</h4>' +
+                '     <h4>管理单位:' + (list[i].managementUnit?list[i].managementUnit:list[i].management_unit) + '</h4>' +
                 '   </div>' +
                 '   </div>' +
                 ' </div>' +
                 ' </div>' +
                 '</span>' +
                 '</span>' +
                 '<span>' +
                 '<span>' +
                 ' <div class="d-l-con">' +
                 ' <div class="d-l-con">' +
                 '   <div class="d-l-l-text">' +
                 '   <div class="d-l-l-text">' +
-                '     <h4>联系电话:' + list[i].manaTel + '</h4>' +
+                '     <h4>联系电话:' + (list[i].manaTel?list[i].manaTel:list[i].phone) + '</h4>' +
                 '   </div>' +
                 '   </div>' +
                 ' </div>' +
                 ' </div>' +
                 '</span>' +
                 '</span>' +
                 '<span>' +
                 '<span>' +
                 ' <div class="d-l-con">' +
                 ' <div class="d-l-con">' +
                 '   <div class="d-l-l-text">' +
                 '   <div class="d-l-l-text">' +
-                '     <h4>养护单位:' + list[i].maintenanceUnit + '</h4>' +
+                '     <h4>养护单位:' + (list[i].maintenanceUnit?list[i].maintenanceUnit:list[i].maintenance_unit) + '</h4>' +
                 '   </div>' +
                 '   </div>' +
                 ' </div>' +
                 ' </div>' +
                 '</span>' +
                 '</span>' +
                 '<span>' +
                 '<span>' +
                 ' <div class="d-l-con">' +
                 ' <div class="d-l-con">' +
                 '   <div class="d-l-l-text">' +
                 '   <div class="d-l-l-text">' +
-                '     <h4>联系电话:' + list[i].mainTel + '</h4>' +
+                '     <h4>联系电话:' + (list[i].mainTel?list[i].mainTel:list[i].phone) + '</h4>' +
                 '   </div>' +
                 '   </div>' +
                 ' </div>' +
                 ' </div>' +
                 '</span>';
                 '</span>';
@@ -267,13 +279,14 @@
             this.markersList.push(markersMap)
             this.markersList.push(markersMap)
           }
           }
           setTimeout(() => {
           setTimeout(() => {
+            // return
             this.$refs.supermap.setMarkers(this.markersList)
             this.$refs.supermap.setMarkers(this.markersList)
           }, 2000)
           }, 2000)
         }
         }
       },
       },
       /** ----------------------------------底部按钮公用组件开始------------------------------------- */
       /** ----------------------------------底部按钮公用组件开始------------------------------------- */
       bottomMenuList() {
       bottomMenuList() {
-        this.$refs.bottomMenu.selectTaskList()//获取任务列表
+        // this.$refs.bottomMenu.selectTaskList()//获取任务列表
         this.$refs.bottomMenu.selectMessageList()//获取消息列表
         this.$refs.bottomMenu.selectMessageList()//获取消息列表
       },
       },
       showDialog(click) {
       showDialog(click) {