Prechádzať zdrojové kódy

消防数据中心、事件详情页面资源落点接口及方式更换

王通 2 rokov pred
rodič
commit
1de2eaef96

+ 3 - 3
src/api/components/supermap.js

@@ -73,9 +73,9 @@ export const iconList = {
   'sj-icon-map-centerdata-slmonitor-traffic': require('@/assets/icons/sj-icon-map/centerdata/sj-icon-map-centerdata-slmonitor-traffic.png'),//交通精细化摄像头
   'sj-icon-map-centerdata-slmonitor': require('@/assets/icons/sj-icon-map/centerdata/sj-icon-map-centerdata-slmonitor.png'),//水利摄像头
   //交通资源图标
-  'traffic-resources-warning_sign': require('@/assets/icons/sj-icon-map/traffic-resources-warning_sign.png'),//警示牌
-  'traffic-resources-bridge': require('@/assets/icons/sj-icon-map/traffic-resources-bridge.png'),//桥梁
-  'traffic-resources-culvert': require('@/assets/icons/sj-icon-map/traffic-resources-culvert.png'),//涵洞
+  'sj-icon-map-centerdata-t-traffic-warning-sign': require('@/assets/icons/sj-icon-map/traffic-resources-warning_sign.png'),//警示牌
+  'sj-icon-map-centerdata-t-traffic-bridge': require('@/assets/icons/sj-icon-map/traffic-resources-bridge.png'),//桥梁
+  'sj-icon-map-centerdata-t-traffic-culvert': require('@/assets/icons/sj-icon-map/traffic-resources-culvert.png'),//涵洞
 
   //云图图标
   'sj-icon-map-centerdata-t-forest-waterintake': require('@/assets/icons/sj-icon-map/centerdata/sj-icon-map-centerdata-t-forest-waterintake.png'),//取水口

+ 7 - 43
src/api/datacenter.js

@@ -1,52 +1,16 @@
 import request from '@/utils/request'
 
-// 获取左侧菜单列表
-export function getResource() {
+// 获取左侧菜单列表-NEW
+export function fireControlViewList(type) {
   return request({
-    // url: '/center-agriculture/VisuForestDataCenterController/getResource',
-    url: '/center-agriculture/data/SumLandInfo',
+    url: '/sooka-middleware/visual/getResourceList?type='+type,
     method: 'get',
   })
 }
-
-//点击左侧菜单列表查询落点
-export function getResourcePoint(resourceTable) {
-  return request({
-    url: '/center-agriculture/VisuForestDataCenterController/getResourcePoint',
-    method: 'post',
-    data:{"resourceTable":resourceTable}
-  })
-}
-//点击右侧菜单列表查询落点
-export function getResourcePointByDeptId(resourceTable,deptId) {
-  return request({
-    url: '/center-agriculture/VisuForestDataCenterController/getResourcePoint',
-    method: 'post',
-    data:{"resourceTable":resourceTable,"deptId":deptId}
-  })
-}
-
-
-//点击左侧获取获取右侧部门列表(新)
-export function getFindAllType(type) {
-  return request({
-    url: '/center-agriculture/data/FindAllType?type='+type,
-    method: 'get',
-  })
-}
-
-//点击左侧获取获取右侧部门列表(新)
-export function getFindAllZhanList(type,deptId) {
-  return request({
-    url: '/center-agriculture/data/FindAllZhanList?type='+type+'&deptId='+deptId,
-    method: 'get',
-  })
-}
-
-//点击地图点位详情信息数据
-export function getPointDetails(id,type) {
+//点击左侧菜单列表查询落点+按部门分组 NEW
+export function fireControlViewPoint(type, name,deptId) {
   return request({
-    url: '/center-agriculture/data/getPointDetails?id='+id+'&type='+type,
-    method: 'get',
+    url: '/sooka-middleware/visual/getResourcePoint?type='+type+'&name='+name+'&deptId='+deptId,
+    method: 'get'
   })
 }

+ 6 - 8
src/api/forest.js

@@ -1,19 +1,17 @@
 import request from '@/utils/request'
 
 // 获取消防左侧菜单列表
-export function fireControlViewList() {
+export function fireControlViewList(type) {
   return request({
-    url: '/center-firecontrol/VisuForestDataCenterController/fireControlViewList',
-    method: 'post',
+    url: '/sooka-middleware/visual/getResourceList?type='+type,
+    method: 'get',
   })
 }
 // 点击左侧菜单列表查询落点
-export function fireControlViewPoint(type, name) {
+export function fireControlViewPoint(param) {
   return request({
-    url: '/center-firecontrol/VisuForestDataCenterController/fireControlViewPoint',
-    method: 'post',
-    data: type
-
+    url: '/sooka-middleware/visual/getResourcePoint?type='+param.type+'&longitude='+param.longitude+'&latitude='+param.latitude+'&radius='+param.radius,
+    method: 'get'
   })
 }
 // 事件审核

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 2691 - 1408
src/views/eventdetailsdialog.vue


+ 94 - 56
src/views/firespread.vue

@@ -164,7 +164,7 @@
                             </div>
                             <div class="z-info-btm-input">
                               <el-input type="textarea" v-model="eventLog" :autosize="{ minRows: 7, maxRows: 7}"
-                                        :maxlength="500" placeholder="请输入反馈信息">
+                                        placeholder="请输入反馈信息">
                               </el-input>
                               <div class="z-info-btm-input-btn" v-if="eventStatusValue=='forest_event_status_1'">
                                 <div style="text-align:left">
@@ -1942,6 +1942,7 @@ export default {
       isExamine: "0", //事件审核 1通过  0不通过
       eventId: null, //事件ID
       eventType: null, //事件类型-大类
+      eventTypeXl: null, //事件类型-小类
       dataStatus: null, //事件流程按钮
       deptId: null, //事件流程部门
       eventCode: null,
@@ -2059,36 +2060,35 @@ export default {
     fireControlViewList() {
       this.resourcesList1 = [];
       let _this = this;
-      // {
-      //   resourceName: '取水口',
-      //     type: 'qsk',
-      //   count: '1',
-      //   icon: 'sj-icon-waterintake'
-      // },
-      fireControlViewList().then(function(res) {
+      fireControlViewList("xiaofang").then(function (res) {
         // _this.resourcesList = res.data
         //截取data.resourceTable字段中“_”分隔符最后一个作为关键字,重新拼接成前端需要的图标:class,格式sj-icon-xxxx,将其set回原数组
-        res.data.forEach(function(data, index) {
+        res.data.forEach(function (data, index) {
           let obj = {};
-          let icon = 'sj' + '-' + 'icon' + '-' + data.type.replaceAll("_", "-").replaceAll("@", "-");
-          obj.resourceName = data.name.replaceAll("(个)", "");
+          let icon =
+            "sj" +
+            "-" +
+            "icon" +
+            "-" +
+            data.type.replaceAll("_", "-").replaceAll("@", "-");
+          let resourceName = data.name.replaceAll("(个)", "");
+          obj.resourceName = resourceName;
           obj.type = data.type;
           obj.count = data.num;
           obj.icon = icon;
-          _this.resourcesList1.push(obj);
+          _this.resourcesList.push(obj);
           console.log("icon_" + (index + 1) + "=", icon);
           //每个图标对应固定颜色
-          _this.$set(_this.resourcesList1[index], "bg", getIconBg(icon));
-
-        })
-        _this.resourcesList1.push({
-          resourceName: '摄像头',
-          type: 'sxt',
-          count: '1',
-          icon: 'sj-icon-jkzx',
-          bg: '#f5ad1b'
-        })
-      })
+          _this.$set(_this.resourcesList[index], "bg", getIconBg(icon));
+        });
+        _this.resourcesList.push({
+          resourceName: "摄像头",
+          type: "sxt",
+          count: "1",
+          icon: "sj-icon-jkzx",
+          bg: "#f5ad1b",
+        });
+      });
     },
     fireControlViewPoint(type) {
       // alert(type)
@@ -2114,48 +2114,85 @@ export default {
                 let markersMap = {
                   lng: 124.59,
                   lat: 43.02,
-                  icon: 'marker',
-                  bindPopupHtml: '',
-                  click: '',
-                  parameter: '',
+                  icon: "marker",
+                  bindPopupHtml: "",
+                  click: "",
+                  parameter: "",
                   keepBindPopup: false,
-                  isAggregation: true
-                }
-                markersMap.icon = 'sj-icon-map-' + type.replaceAll("_", "-");
+                  isAggregation: true,
+                };
+                markersMap.icon = "sj-icon-map-" + type.replaceAll("_", "-");
                 markersMap.lng = res.data.pointList[i].longitude;
                 markersMap.lat = res.data.pointList[i].latitude;
-                markersMap.bindPopupHtml = '<div class="map-tip">' +
-                  '<span>' +
+                markersMap.bindPopupHtml =
+                  '<div class="map-tip">' +
+                  "<span>" +
                   '                  <div class="d-l-con">' +
                   '                  <div class="d-l-l-text">' +
-                  '                  <h4>资源名称:' + res.data.pointList[i].name + '</h4>' +
-                  '                </div>' +
-                  '                </div>' +
-                  '                </span>' +
-                  '<span>' +
+                  "                  <h4>资源名称:" +
+                  res.data.pointList[i].name +
+                  "</h4>" +
+                  "                </div>" +
+                  "                </div>" +
+                  "                </span>" +
+                  "<span>" +
                   '                  <div class="d-l-con">' +
                   '                  <div class="d-l-l-text">' +
-                  '                  <h4>经纬度:' + res.data.pointList[i].longitude + ',' + res.data.pointList[i]
-                    .latitude + '</h4>' +
-                  '                </div>' +
-                  '                </div>' +
-                  '                </span>' +
-                  '<span>' +
+                  "                  <h4>经纬度:" +
+                  res.data.pointList[i].longitude +
+                  "," +
+                  res.data.pointList[i].latitude +
+                  "</h4>" +
+                  "                </div>" +
+                  "                </div>" +
+                  "                </span>" +
+                  "<span>" +
                   '                  <div class="d-l-con">' +
                   '                  <div class="d-l-l-text">' +
-                  '                  <h4>联系人:' + res.data.pointList[i].contacts + '</h4>' +
-                  '                </div>' +
-                  '                </div>' +
-                  '                </span>' +
-                  '<span>' +
+                  "                  <h4>名称:" +
+                  (res.data.pointList[i].name?res.data.pointList[i].name:'无') +
+                  "</h4>" +
+                  "                </div>" +
+                  "                </div>" +
+                  "                </span>" +
+                  "<span>" +
                   '                  <div class="d-l-con">' +
                   '                  <div class="d-l-l-text">' +
-                  '                  <h4>电话:' + res.data.pointList[i].phone + '</h4>' +
-                  '                </div>' +
-                  '                </div>' +
-                  '                </span>' +
-                  '</div>'
-                markersList.push(markersMap)
+                  "                  <h4>地址:" +
+                  (res.data.pointList[i].address?res.data.pointList[i].address:'无') +
+                  "</h4>" +
+                  "                </div>" +
+                  "                </div>" +
+                  "                </span>" +
+                  "<span>" +
+                  '                  <div class="d-l-con">' +
+                  '                  <div class="d-l-l-text">' +
+                  "                  <h4>联系人:" +
+                  (res.data.pointList[i].contacts?res.data.pointList[i].contacts:'无') +
+                  "</h4>" +
+                  "                </div>" +
+                  "                </div>" +
+                  "                </span>" +
+                  "<span>" +
+                  '                  <div class="d-l-con">' +
+                  '                  <div class="d-l-l-text">' +
+                  "                  <h4>电话:" +
+                  (res.data.pointList[i].phone?res.data.pointList[i].phone:'无') +
+                  "</h4>" +
+                  "                </div>" +
+                  "                </div>" +
+                  "                </span>" +
+                  "<span>" +
+                  '                  <div class="d-l-con">' +
+                  '                  <div class="d-l-l-text">' +
+                  "                  <h4>距离事件距离:" +
+                  (res.data.pointList[i].distance?res.data.pointList[i].distance+'米':'无') +
+                  "</h4>" +
+                  "                </div>" +
+                  "                </div>" +
+                  "                </span>" +
+                  "</div>";
+                markersList.push(markersMap);
               }
               setTimeout(() => {
                 this.$refs.supermapDialog1.setMarkersByType(markersList, type)
@@ -2957,6 +2994,7 @@ export default {
 
     sendEventLog() {
       if (this.eventLog == '' || this.eventLog == null) {
+
         return;
       }
       //日志发送
@@ -3006,8 +3044,8 @@ export default {
         that.latitude = res.data.catalogue.latitude
         that.eventName = res.data.catalogue.eventName
         that.eventTypeXl = res.data.catalogue.eventTypeXl
-        that.isExamine = res.data.catalogue.isExamine
         that.version = res.data.catalogue.version
+        that.isExamine = res.data.catalogue.isExamine
         let markersMap = {
           lng: 124.59,
           lat: 43.02,
@@ -3107,10 +3145,10 @@ export default {
         that.eventId = res.data.catalogue.id
         that.latitude = res.data.catalogue.latitude
         that.longitude = res.data.catalogue.longitude
-        that.isExamine = res.data.catalogue.isExamine
         that.eventName = res.data.catalogue.eventName
         that.eventTypeXl = res.data.catalogue.eventTypeXl
         that.version = res.data.catalogue.version
+        that.isExamine = res.data.catalogue.isExamine
         let markersMap = {
           lng: 124.59,
           lat: 43.02,

+ 146 - 33
src/views/forest.vue

@@ -86,7 +86,7 @@
 
               <div class="d-l-con-icon">
                 <div class="icon-con" :class="{on:iconCurrentIndex==item.resourceTable}"
-                  v-for="(item,index) in resourcesCountList" v-on:click="selectResourcesByLabel(item.type, searchName)">
+                  v-for="(item,index) in resourcesList" v-on:click="fireControlViewPoint(item.type, '')">
                   <!--v-on:click="selectResourcesByLabel(item.label)">-->
                   <!--v-on:click="indentleftSetMarkers(item.resourceTable)">-->
                   <div class="iconfont icon icon-normal" :class="item.icon" :style="'background:' + item.bg"></div>
@@ -478,6 +478,7 @@
   import {
     selectConfigKey
   } from "@/api/system/config";
+  import { fireControlViewList, fireControlViewPoint } from '@/api/datacenter'
 
   let echarts = require('echarts')
   export default {
@@ -517,7 +518,6 @@
       }
     },
     mounted() {
-
       // 初始化地图数据
       this.getSuperMapUrl();
       this.getLatestNotice()
@@ -566,7 +566,7 @@
         otherTotal: '',
         readyFinish: '',
         readySure: '',
-        resourcesCountList: [],
+        resourcesList: [],
         total: '',
         aiTotal_pre: '',
         newReport_pre: '',
@@ -665,35 +665,147 @@
       },
       //查询各类资源的数量
       getResourcesCount() {
-        let that = this
-        getResourcesCount().then(res => {
-          this.resourcesCountList = res.data;
-          this.resourcesCountList.forEach(function(data, index) {
-            let icon = 'sj' + '-' + 'icon' + '-' + data.type.replaceAll("_", "-").replaceAll("@", "-");
-            that.$set(that.resourcesCountList[index], 'icon', icon);
-            that.$set(that.resourcesCountList[index], 'bg', getIconBg(icon));
-          })
-          //数据自动落点开始
-          let maxCount = 100; //落点数超过这个数的资源不落点
-          let list = res.data;
-          let counts = [];
-          let points = [];
-          let types = [];
-          for (let i = 0; i < list.length; i++) { //获取符合要求的类型及数量
-            if (list[i].num <= maxCount) {
-              counts.push(list[i].num);
-              points.push({
-                "type": list[i].type,
-                "count": list[i].num
-              });
-              types.push(list[i].type);
+        let that = this;
+        fireControlViewList("jiaotong").then(function (res) {
+          for (let i = 0; i < res.data.length; i++) {
+            if(res.data[i].type !='centerdata_t_forest_fireteam'){
+              that.resourcesList.push(res.data[i]);
             }
           }
-          for (let i = 0; i < types.length; i++) {
-            that.selectResourcesByLabel(types[i], '所有');
+          //截取data.resourceTable字段中“_”分隔符最后一个作为关键字,重新拼接成前端需要的图标:class,格式sj-icon-xxxx,将其set回原数组
+          that.resourcesList.forEach(function (data, index) {
+            let icon =
+              "sj" +
+              "-" +
+              "icon" +
+              "-" +
+              data.type.replaceAll("_", "-").replaceAll("@", "-");
+            console.log("icon_" + (index + 1) + "=", icon);
+            that.$set(that.resourcesList[index], "icon", icon);
+            //每个图标对应固定颜色
+            that.$set(that.resourcesList[index], "bg", getIconBg(icon));
+          });
+          console.log(that.resourcesList)
+          that.fireControlViewPoint("jiaotong", "");
+        });
+      },
+      fireControlViewPoint(resourceTable, name) {
+        // 搜索框
+        if (name == "" || name == null || name == undefined) {
+          name = "";
+        } else {
+          this.showSearch = true;
+        }
+        console.log("name=", name);
+        console.log("this.showSearch=", this.showSearch);
+        if(resourceTable == this.resourceTable){
+          resourceTable = "jiaotong"
+        }
+        let that = this;
+        that.resourceTable = resourceTable;
+        that.markersList = [];
+        that.source = [];
+        fireControlViewPoint(resourceTable, name,"").then((res) => {
+          let pointList = res.data.pointList;
+          that.deptGroupList = res.data.deptList;
+          if (res.data.deptList != null && res.data.deptList.length > 0) {
+            for (let i = 0; i < res.data.deptList.length; i++) {
+              let aa = [
+                res.data.deptList[i].deptName,
+                res.data.deptList[i].count,
+              ];
+              that.source.push(aa);
+            }
           }
-          //数据自动落点结束
-        })
+
+          if (res.data.pointList != null && res.data.pointList.length > 0) {
+            for (let i = 0; i < res.data.pointList.length; i++) {
+              if(res.data.pointList[i].indexName != 'centerdata_t_forest_fireteam'){
+                let markersMap = {
+                  lng: res.data.pointList[i].longitude,
+                  lat: res.data.pointList[i].latitude,
+                  icon: "marker",
+                  bindPopupHtml: "",
+                  click: "",
+                  name: i,
+                  keepBindPopup: false,
+                  isAggregation: false,
+                };
+                that.markersList.push(
+                  this.getMarkersMap(
+                    resourceTable == "jiaotong" ? res.data.pointList[i].indexName:resourceTable,
+                    markersMap,
+                    res.data.pointList[i]
+                  )
+                );
+              }
+            }
+          }
+          // if (this.showSearch == true) {
+          //   this.dataChat();
+          // }
+          that.$refs.supermap.clearM(false);
+          that.$refs.supermap.setMarkers(that.markersList);
+        });
+      },
+      getMarkersMap(resourceTable, markersMap, item) {
+        let icon = "sj-icon-map-"+resourceTable.replaceAll("_", "-");
+        console.log(icon)
+        markersMap.lng = item.longitude;
+        markersMap.lat = item.latitude;
+        markersMap.click = "sewageOutletClick";
+        markersMap.parameter = item;
+        markersMap.icon = icon;
+        markersMap.bindPopupHtml =
+          '<div class="map-tip">' +
+          "<span>" +
+          '                  <div class="d-l-con">' +
+          '                  <div class="d-l-l-text">' +
+          "                  <h4>经纬度:" +
+          (item.longitude ? item.longitude : "") +
+          "," +
+          (item.latitude ? item.latitude : "") +
+          "</h4>" +
+          "                </div>" +
+          "                </div>" +
+          "                </span>" +
+          "<span>" +
+          '                  <div class="d-l-con">' +
+          '                  <div class="d-l-l-text">' +
+          "                  <h4>名称:" +
+          (item.name ? item.name : "") +
+          "</h4>" +
+          "                </div>" +
+          "                </div>" +
+          "                </span>" +
+          "<span>" +
+          '                  <div class="d-l-con">' +
+          '                  <div class="d-l-l-text">' +
+          "                  <h4>地址:" +
+          (item.address ? item.address : "") +
+          "</h4>" +
+          "                </div>" +
+          "                </div>" +
+          "                </span>" +
+          "<span>" +
+          '                  <div class="d-l-con">' +
+          '                  <div class="d-l-l-text">' +
+          "                  <h4>联系人:" +
+          (item.contacts ? item.contacts : "") +
+          "</h4>" +
+          "                </div>" +
+          "                </div>" +
+          "                </span>" +
+          "<span>" +
+          '                  <div class="d-l-con">' +
+          '                  <div class="d-l-l-text">' +
+          "                  <h4>联系电话:" +
+          (item.phone ? item.phone : "") +
+          "</h4>" +
+          "                </div>" +
+          "                </div>" +
+          "                </span></div>";
+        return markersMap;
       },
       //点击左侧某资源,将该资源进行落点
       selectResourcesByLabel(label, name) {
@@ -714,7 +826,7 @@
           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, label.replaceAll("_", "-"));
           // this.initMarkers(this.resourcesList);
         })
       },
@@ -739,9 +851,9 @@
             // 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-' + (type ? type == "sign" ? "warning_sign" : type : this
-              .resourcesList[i].label);
+            markersMap.icon = 'sj-icon-map-' + type;
+            console.log(markersMap.icon)
+            //markersMap.icon = 'sj-icon-map-centerdata-t-' +
             markersMap.parameter = this.resourcesList[i].id + "," + this.resourcesList[i].label;
             markersMap.parameter = this.resourcesList[i].id + "," + (type ? type : this.resourcesList[i].label);
             markersMap.click = '';
@@ -839,6 +951,7 @@
           }, 2000)
         }
       },
+
       getMenuEventType() {
         let that = this
         getMenuEventType().then(res => {

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 387 - 588
src/views/resources.vue