Преглед на файлове

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

王通 преди 1 година
родител
ревизия
63e7a6a709
променени са 5 файла, в които са добавени 355 реда и са изтрити 456 реда
  1. 8 21
      src/api/datacenter.js
  2. 5 6
      src/api/forest.js
  3. 172 313
      src/views/datacenter.vue
  4. 53 37
      src/views/eventdetailsdialog.vue
  5. 117 79
      src/views/firespread.vue

+ 8 - 21
src/api/datacenter.js

@@ -1,29 +1,16 @@
 import request from '@/utils/request'
 
-// 获取左侧菜单列表
-export function getResource() {
+// 获取左侧菜单列表-NEW
+export function fireControlViewList(type) {
   return request({
-    url: '/center-environment/VisuForestDataCenterController/getResource',
-    method: 'post',
+    url: '/sooka-middleware/visual/getResourceList?type='+type,
+    method: 'get',
   })
 }
-
-//点击左侧菜单列表查询落点
-export function getResourcePoint(resourceTable, name) {
-  return request({
-    url: '/center-environment/VisuForestDataCenterController/getResourcePoint',
-    method: 'post',
-    data:{
-      "name": name,
-      "resourceTable":resourceTable
-    }
-  })
-}
-//点击右侧菜单列表查询落点
-export function getResourcePointByDeptId(resourceTable,deptId) {
+//点击左侧菜单列表查询落点+按部门分组 NEW
+export function fireControlViewPoint(type, name,deptId) {
   return request({
-    url: '/center-environment/VisuForestDataCenterController/getResourcePoint',
-    method: 'post',
-    data:{"resourceTable":resourceTable,"deptId":deptId}
+    url: '/sooka-middleware/visual/getResourcePoint?type='+type+'&name='+name+'&deptId='+deptId,
+    method: 'get'
   })
 }

+ 5 - 6
src/api/forest.js

@@ -1,18 +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) {
   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'
 
   })
 }

+ 172 - 313
src/views/datacenter.vue

@@ -9,22 +9,22 @@
       <div class="leftbar w-10" ref="left" style="width:12rem !important;height: 80vh;overflow-y: hidden;">
         <div class="forthis">
           <dv-border-box-13
-            backgroundColor="#09140e"
+            backgroundColor="rgba(12, 19, 38, .90)"
             style="padding-bottom: 1rem;height: 80vh;"
           >
             <img
               src="../assets/images/integrated/light.png"
               style="width: 100%; margin-top: 0.4rem"
             />
-            <div class="sj-search"  v-show="showSearch">
-                  <el-input
-                    v-model="searchName"
-                    placeholder="请输入名称"
-                    @keyup.enter.native="searchByName()"
-                    clearable
-                    size="small"
-                    prefix-icon="el-icon-search"
-                  />
+            <div class="sj-search">
+              <el-input
+                v-model="searchName"
+                placeholder="请输入名称"
+                @keyup.enter.native="searchByName()"
+                clearable
+                size="small"
+                prefix-icon="el-icon-search"
+              />
             </div>
             <div class="i-list-con" style="height: 71vh;">
               <div class="d-l-con-icon">
@@ -32,10 +32,8 @@
                   class="icon-con"
                   :class="{ on: iconCurrentIndex == item.resourceTable }"
                   v-for="(item, index) in resourcesList"
-                  v-on:click="indentleftSetMarkers(item.type, searchName)"
+                  v-on:click="fireControlViewPoint(item.type, searchName)"
                 >
-                  <!--v-on:click="indentleftSetMarkers(item.resourceTable)">-->
-
                   <div
                     class="iconfont icon icon-normal"
                     :class="item.icon"
@@ -43,9 +41,7 @@
                   ></div>
                   <div class="icon-text">
                     <h6>{{ item.num }}</h6>
-                    <!--<h6>{{ item.count }}</h6>-->
                     <h5>{{ item.name }}</h5>
-                    <!--<h5>{{ item.resourceName }}</h5>-->
                   </div>
                 </div>
               </div>
@@ -54,10 +50,9 @@
         </div>
       </div>
       <!-- 地图 -->
-      <!--<supermap ref="supermap" style="width: 100%;height: 100vh;" :mapDiv="'forestMap'" class="indexSupermapClass"-->
-      <!--:mapSite="{doubleClickZoom:false}" :codes="['9fa5']" :isSideBySide="false"></supermap>-->
       <supermap
         ref="supermap"
+        style="width: 100%; height: 100vh"
         @sewageOutletClick="sewageOutletClick"
       ></supermap>
       <!--      <button @click="showEventInfo1" style="position: absolute; right: 50%;top: 45%;z-index: 1000;">弹层事件演示用按钮-->
@@ -66,7 +61,7 @@
       <div class="rightbar" ref="right" v-if="showSearch == true">
         <div class="forthis">
           <dv-border-box-13
-            backgroundColor="#09140e"
+            backgroundColor="rgba(12, 19, 38, .90)"
             style="padding-bottom: 1rem"
           >
             <img
@@ -110,24 +105,24 @@
 
 <script>
 import {
-  getResource,
-  getResourcePoint,
-  getResourcePointByDeptId,
+  fireControlViewList,
+  fireControlViewPoint,
 } from "@/api/datacenter";
 
 import supermap from "@/components/supermap-2.5d"; //超图
 import vheader from "@/components/v-header.vue"; //一体化共用头部
 import vBottomMenu from "@/components/vBottomMenu.vue"; //一体化公共底部菜单
 import eventLocation from "@/components/eventLocation.vue"; //事件定位弹窗
-import TVWall from "@/components/TVWall.vue";
-import { initByCameras } from "@/api/forest"; //电视墙弹窗
-import {getIconBg} from '@/api/components/sookaMapIcon';
+import TVWall from "@/components/TVWall.vue"; //电视墙弹窗
+import { getIconBg } from "@/api/components/sookaMapIcon";
 import {getUserProfile} from "@/api/system/user";
-//资源底色控制文件
+import { Button } from '@/dahua/TVWalllib/iview' //资源底色控制文件
+
 // import echarts from 'echarts'
 let echarts = require("echarts");
 export default {
   components: {
+    Button,
     supermap,
     vheader,
     vBottomMenu,
@@ -144,20 +139,19 @@ export default {
   mounted() {
     // 初始化地图数据
     this.getSuperMapUrl();
+
     setTimeout(() => {
-      this.getResource();
+      this.fireControlViewList();
     }, 2000)
-
     this.bottomMenuList(); //获取底部公共组件消息和任务
   },
   data() {
     return {
       // 搜索框
-      showSearch: false,
+      showSearch: true,
       // 搜索名称
-      searchName: undefined,
+      searchName: "",
       // 搜索类型
-      searchType: undefined,
       iconCurrentIndex: "",
       listCurrentIndex: "",
       markersList: [],
@@ -175,7 +169,8 @@ export default {
       source: [],
     };
   },
-
+  watch: {
+  },
   methods: {
     //初始化地图数据
     getSuperMapUrl(){
@@ -201,7 +196,7 @@ export default {
     // 根据名称筛选资源点位
     searchByName() {
       this.$modal.msgSuccess("正在查询,请稍后...");
-      this.indentleftSetMarkers(this.searchType, this.searchName);
+      this.fireControlViewPoint(this.resourceTable, this.searchName);
     },
     /** ----------------------------------底部按钮公用组件开始------------------------------------- */
     bottomMenuList() {
@@ -258,6 +253,7 @@ export default {
         dataZoom: [
           {
             show: this.source.length > 8 ? true : false,
+            // show: true,
             type: "slider",
             yAxisIndex: 0,
             left: 0,
@@ -351,317 +347,149 @@ export default {
         ],
       });
     },
-
-    // 弹层方法
-    showEventInfo1() {
-      this.eventInfoVisible1 = true;
-    },
-    showEventInfo2() {
-      this.eventInfoVisible2 = true;
-    },
-    getResource() {
+    fireControlViewList() {
       let that = this;
-      //获取左侧菜单列表
-      getResource().then((res) => {
-        that.resourcesList = res.data;
-        console.log("that.resourcesList=", that.resourcesList);
+      fireControlViewList("huanbao").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]);
+          }
+        }
         //截取data.resourceTable字段中“_”分隔符最后一个作为关键字,重新拼接成前端需要的图标:class,格式sj-icon-xxxx,将其set回原数组
-        res.data.forEach(function (data, index) {
-          let icon ='sj' + '-' + 'icon' + '-' + data.type.replaceAll("_", "-").replaceAll("@", "-");
-          that.$set(
-            that.resourcesList[index],
-            "icon",
-            icon
-          );
-
+        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));
-
-          // if(index < 5){
-          //   // that.fireControlViewPoint(data.type, 'undefined');
-          //   that.indentleftSetMarkers(data.type, '所有');
-          // }
         });
-        //数据自动落点开始
-        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,
-            });
-          }
-        }
-        for (let i = 0; i < points.length; i++) {
-          if (points[i].count == Math.max(...counts)) {
-            types.push(points[i].type);
-            let countsTemp = [];
-            for (let j = 0; j < counts.length; j++) {
-              if (counts[j] != Math.max(...counts)) {
-                countsTemp.push(counts[j]);
-              }
-            }
-            counts = countsTemp;
-            break;
-          }
-        }
-        for (let i = 0; i < points.length; i++) {
-          if (points[i].count == Math.max(...counts)) {
-            types.push(points[i].type);
-            break;
-          }
-        }
-        for (let i = 0; i < types.length; i++) {
-          that.indentleftSetMarkers(types[i], "所有");
-        }
-        //数据自动落点结束
+        that.fireControlViewPoint("huanbao", "");
       });
     },
-    indentleftSetMarkers(resourceTable, name) {
+    fireControlViewPoint(resourceTable, name) {
       // 搜索框
-      // if(name == 'undefined' && this.showSearch == false){
-      // if(name == '所有' && this.showSearch == false){
-      if (name == "所有") {
-        name = undefined;
+      if (name == "" || name == null || name == undefined) {
+        name = "";
       } else {
         this.showSearch = true;
       }
-      // 搜索类型
-      this.searchType = resourceTable;
-      this.iconCurrentIndex = resourceTable;
+      console.log("name=", name);
+      console.log("this.showSearch=", this.showSearch);
+      if(resourceTable == this.resourceTable){
+        resourceTable = "huanbao"
+      }
       let that = this;
       that.resourceTable = resourceTable;
       that.markersList = [];
       that.source = [];
-      //点击左侧地图落点
-      getResourcePoint(resourceTable, name).then((res) => {
-        that.deptGroupList = res.data.deptGroupList;
-        if (
-          res.data.deptGroupList != null &&
-          res.data.deptGroupList.length > 0
-        ) {
-          for (let i = 0; i < res.data.deptGroupList.length; i++) {
+      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.deptGroupList[i].deptName,
-              res.data.deptGroupList[i].count,
+              res.data.deptList[i].deptName,
+              res.data.deptList[i].count,
             ];
             that.source.push(aa);
           }
         }
-        if (res.data.resourceList != null && res.data.resourceList.length > 0) {
-          for (let i = 0; i < res.data.resourceList.length; i++) {
-            let markersMap = {
-              lng: 124.59,
-              lat: 43.02,
-              icon: "marker",
-              bindPopupHtml: "",
-              parameter: "",
-              click: "",
-              keepBindPopup: false,
-              isAggregation: false,
-            };
-            that.markersList.push(
-              this.getMarkersMap(
-                resourceTable,
-                markersMap,
-                res.data.resourceList[i]
-              )
-            );
+
+        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 == "huanbao" ? res.data.pointList[i].indexName:resourceTable,
+                  markersMap,
+                  res.data.pointList[i]
+                )
+              );
+            }
           }
         }
         if (this.showSearch == true) {
           this.dataChat();
         }
-        setTimeout(() => {
-          that.$refs.supermap.clearM();
-          that.$refs.supermap.setMarkers(that.markersList);
-        }, 3000);
-      });
-    },
-    indentleftByDeptIdSetMarkers(deptId) {
-      this.listCurrentIndex = deptId;
-      let that = this;
-      //点击左侧地图落点
-      getResourcePointByDeptId(that.resourceTable, deptId).then((res) => {
-        console.log(
-          "1===============dituluodian===============",
-          res.data.resourceList
-        );
-        that.markersList = [];
-        if (res.data.resourceList != null && res.data.resourceList.length > 0) {
-          for (let i = 0; i < res.data.resourceList.length; i++) {
-            let markersMap = {
-              lng: 124.59,
-              lat: 43.02,
-              icon: "marker",
-              bindPopupHtml: "",
-              parameter: "",
-              click: "",
-              keepBindPopup: false,
-              isAggregation: false,
-            };
-            that.markersList.push(
-              this.getMarkersMap(
-                that.resourceTable,
-                markersMap,
-                res.data.resourceList[i]
-              )
-            );
-          }
-        }
-        setTimeout(() => {
-          that.$refs.supermap.clearM();
-          that.$refs.supermap.setMarkers(that.markersList);
-        }, 3000);
+        that.$refs.supermap.clearM(false);
+        that.$refs.supermap.setMarkers(that.markersList);
       });
     },
     getMarkersMap(resourceTable, markersMap, item) {
-      if (resourceTable == "centerdata_t_environment_key_enterprise") {
-        //重点企业
-        markersMap.icon = "sj-icon-map-centerdata-t-environment-key-enterprise";
-        markersMap.lng = item.longitude ? item.longitude : "";
-        markersMap.lat = item.latitude ? item.latitude : "";
-        markersMap.click = "sewageOutletClick";
-        markersMap.parameter = item;
-        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.contacts_phone ? item.contacts_phone : "") +
-          "</h4>" +
-          "                </div>" +
-          "                </div>" +
-          "                </span></div>";
-      } else if (resourceTable == "centerdata_t_environment_source_pollution") {
-        //污染源
-        markersMap.icon =
-          "sj-icon-map-centerdata-t-environment-source-pollution";
-        markersMap.lng = item.longitude ? item.longitude : "";
-        markersMap.lat = item.latitude ? item.latitude : "";
-        markersMap.click = "sewageOutletClick";
-        markersMap.parameter = item;
-        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>";
-      } else if (resourceTable == "centerdata_t_environment_sewage_outlet") {
-        //排污口
-        markersMap.icon = "sj-icon-map-centerdata_t_environment_sewage_outlet";
-        markersMap.lng = item.longitude ? item.longitude : "";
-        markersMap.lat = item.latitude ? item.latitude : "";
-        markersMap.click = "sewageOutletClick";
-        markersMap.parameter = item;
-        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>";
-      }
+      let icon = "sj-icon-map-"+resourceTable.replaceAll("_", "-");
+      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;
     },
     sewageOutletClick(data) {
+      console.log(data);
       const params = Object.assign({});
       params.longitude = data.longitude;
       params.latitude = data.latitude;
@@ -713,6 +541,37 @@ export default {
         );
       }
     },
+    indentleftByDeptIdSetMarkers(deptId) {
+      this.listCurrentIndex = deptId;
+      let that = this;
+      //点击左侧地图落点
+      fireControlViewPoint(that.resourceTable,that.searchName, deptId).then((res) => {
+        that.markersList = [];
+        if (res.data != null && res.data.pointList.length>0) {
+          for (let i = 0; i < res.data.pointList.length; i++) {
+            let markersMap = {
+              lng: res.data.pointList[i].longitude,
+              lat: res.data.pointList[i].latitude,
+              icon: "marker",
+              bindPopupHtml: "",
+              click: "",
+              name: i,
+              keepBindPopup: false,
+              isAggregation: false,
+            };
+            console.log("resourceTable=", that.resourceTable);
+            console.log("res.data[i]=", res.data.pointList[i]);
+            that.markersList.push(
+              that.getMarkersMap(
+                that.resourceTable == "huanbao" ? res.data.pointList[i].indexName:that.resourceTable,
+                markersMap, res.data.pointList[i])
+            );
+          }
+        }
+        that.$refs.supermap.clearM();
+        that.$refs.supermap.setMarkers(that.markersList);
+      });
+    },
   },
 };
 </script>

+ 53 - 37
src/views/eventdetailsdialog.vue

@@ -2388,13 +2388,7 @@ export default {
     fireControlViewList() {
       this.resourcesList = [];
       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) {
@@ -2410,11 +2404,6 @@ export default {
           obj.type = data.type;
           obj.count = data.num;
           obj.icon = icon;
-          // if(resourceName != "重点场所"
-          //   && resourceName != "基本联动力量"
-          //   && resourceName != "其他联动力量"){
-          //   _this.resourcesList.push(obj);
-          // }
           _this.resourcesList.push(obj);
           console.log("icon_" + (index + 1) + "=", icon);
           //每个图标对应固定颜色
@@ -2546,11 +2535,11 @@ export default {
         /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/; //11位手机号码正则
       for (let i in this.dutysystemTableData) {
         if (!reg_user.test(this.dutysystemTableData[i].name)) {
-          this.$message.warning(`请输入正确姓名!`);
+          this.$message.error(`请输入正确姓名!`);
           return;
         }
         if (!reg_tel.test(this.dutysystemTableData[i].telphone)) {
-          this.$message.warning(`请输入正确手机号码!`);
+          this.$message.error(`请输入正确手机号码!`);
           return;
         }
 
@@ -2667,10 +2656,10 @@ export default {
         this.eventStatusValue == "forest_event_status_1" ||
         this.eventStatusValue == "forest_event_status_7"
       ) {
-        this.$message.warning(`修改预案信息在签收后方可修改!`);
+        this.$message.error(`修改预案信息在签收后方可修改!`);
         return;
       } else if (this.eventStatusValue == "forest_event_status_3") {
-        this.$message.warning(`误报事件无法修改预案信息!`);
+        this.$message.error(`误报事件无法修改预案信息!`);
         return;
       } else {
         let param = {
@@ -2678,7 +2667,7 @@ export default {
           reserve: this.sendGuanLianYuAn,
         };
         if (this.sendGuanLianYuAn == "" || this.sendGuanLianYuAn == null) {
-          this.$message.warning(`请选择预案信息!`);
+          this.$message.error(`请选择预案信息!`);
           return;
         }
         updateYjYuAn(param).then((res) => {
@@ -2754,8 +2743,26 @@ export default {
                   "<span>" +
                   '                  <div class="d-l-con">' +
                   '                  <div class="d-l-l-text">' +
+                  "                  <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].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?res.data.pointList[i].contacts:'无') +
                   "</h4>" +
                   "                </div>" +
                   "                </div>" +
@@ -2764,7 +2771,16 @@ export default {
                   '                  <div class="d-l-con">' +
                   '                  <div class="d-l-l-text">' +
                   "                  <h4>电话:" +
-                  res.data.pointList[i].phone +
+                  (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>" +
@@ -3159,19 +3175,19 @@ export default {
             }
           }
           if (that.sendTaskSource == "" || that.sendTaskSource == null) {
-            that.$message.warning(`请选择任务来源!`);
+            that.$message.error(`请选择任务来源!`);
             return;
           }
           if (that.sendTaskContent == "" || that.sendTaskContent == null) {
-            that.$message.warning(`请输入任务内容!`);
+            that.$message.error(`请输入任务内容!`);
             return;
           }
           if (that.sendTaskTitle == "" || that.sendTaskTitle == null) {
-            that.$message.warning(`请输入任务标题!`);
+            that.$message.error(`请输入任务标题!`);
             return;
           }
           if (that.sendLianDongDept == "" || that.sendLianDongDept == null) {
-            that.$message.warning(`请选择任务联动部门!`);
+            that.$message.error(`请选择任务联动部门!`);
             return;
           }
           if (
@@ -3180,7 +3196,7 @@ export default {
             that.sendDeptName == "" ||
             that.sendDeptName == null
           ) {
-            that.$message.warning(`请选择任务发起部门!`);
+            that.$message.error(`请选择任务发起部门!`);
             return;
           }
           let eventState = "";
@@ -3224,32 +3240,32 @@ export default {
             let number = /^[+]{0,1}(\d+)$/g; //正整数
 
             if (!double.test(that.table2.areaTotal)) {
-              that.$message.warning(`面积只能填写到小数后两位!`);
+              that.$message.error(`面积只能填写到小数后两位!`);
               return;
             }
             if (!number.test(that.table2.peopleTotal)) {
-              that.$message.warning(`人员请填写正整数!`);
+              that.$message.error(`人员请填写正整数!`);
               return;
             }
             if (
               that.table2.forestComposition == "" ||
               that.table2.forestComposition == null
             ) {
-              that.$message.warning(`林木组成不能为空!`);
+              that.$message.error(`林木组成不能为空!`);
               return;
             }
             if (
               that.table2.forestToken == "" ||
               that.table2.forestToken == null
             ) {
-              that.$message.warning(`林令不能为空!`);
+              that.$message.error(`林令不能为空!`);
               return;
             }
             if (
               that.table2.porosities == "" ||
               that.table2.porosities == null
             ) {
-              that.$message.warning(`疏密度不能为空!`);
+              that.$message.error(`疏密度不能为空!`);
               return;
             }
           }
@@ -3290,11 +3306,11 @@ export default {
         } else if (eventStatus == "shtg") {
           that.eventStatusButton = "sh";
           if (that.eventDescription == "" || that.eventDescription == null) {
-            that.$message.warning(`请填写审核意见!`);
+            that.$message.error(`请填写审核意见!`);
             return;
           }
           if (that.attachExamine.length == 0 || that.attachExamine == null) {
-            that.$message.warning(`请上传审核图片!`);
+            that.$message.error(`请上传审核图片!`);
             return;
           }
           //事件处理流程--审核通过
@@ -3326,11 +3342,11 @@ export default {
         } else if (eventStatus == "shbtg") {
           that.eventStatusButton = "sh";
           if (that.eventDescription == "" || that.eventDescription == null) {
-            that.$message.warning(`请填写审核意见!`);
+            that.$message.error(`请填写审核意见!`);
             return;
           }
           if (that.attachExamine.length == 0 || that.attachExamine == null) {
-            that.$message.warning(`请上传审核图片!`);
+            that.$message.error(`请上传审核图片!`);
             return;
           }
           //事件处理流程--审核不通过
@@ -3376,12 +3392,12 @@ export default {
               that.sendDeptName == "" ||
               that.sendDeptName == null
             ) {
-              that.$message.warning(`请选择部门!`);
+              that.$message.error(`请选择部门!`);
               return;
             }
             if (eventStatus == "qs") {
               if (that.sendEventType == "" || that.sendEventType == null) {
-                that.$message.warning(`请选择事件类型!`);
+                that.$message.error(`请选择事件类型!`);
                 return;
               }
             }
@@ -4020,11 +4036,11 @@ export default {
         /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/; //11位手机号码正则
       for (let i in this.dutysystemTableData) {
         if (!reg_user.test(this.dutysystemTableData[i].name)) {
-          this.$message.warning(`请输入正确姓名!`);
+          this.$message.error(`请输入正确姓名!`);
           return;
         }
         if (!reg_tel.test(this.dutysystemTableData[i].telphone)) {
-          this.$message.warning(`请输入正确手机号码!`);
+          this.$message.error(`请输入正确手机号码!`);
           return;
         }
 

+ 117 - 79
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">
@@ -935,7 +935,7 @@
                class="top-dialog" @close="cancelEventConfirm()">
       <el-form label-width="80px">
         <el-form-item label="火灾半径" v-if="eventStatusButton=='qs'&&eventTypeXl==null">
-          <el-input type="number" v-model="sendHuoZaiBanJing"  :maxlength='50' placeholder="请输入火灾半径" />
+          <el-input type="number" v-model="sendHuoZaiBanJing" placeholder="请输入火灾半径" />
         </el-form-item>
         <el-form-item
           v-if="eventStatusButton=='wb'||eventStatusButton=='qs'||eventStatusButton=='cf'||eventStatusButton=='ld'"
@@ -961,11 +961,11 @@
           </el-select>
         </el-form-item>
         <el-form-item label="联动标题" v-if="eventStatusButton=='ld'">
-          <el-input v-model="sendTaskTitle" :maxlength='50'  placeholder="请输入联动标题" />
+          <el-input v-model="sendTaskTitle" placeholder="请输入联动标题" />
         </el-form-item>
         <el-form-item label="联动内容" v-if="eventStatusButton=='ld'">
           <el-input type="textarea" v-model="sendTaskContent" :autosize="{ minRows: 7, maxRows: 7}"
-                    :maxlength='500'    placeholder="请输入联动内容">
+                    placeholder="请输入联动内容">
           </el-input>
         </el-form-item>
         <el-form-item label="联动部门" v-if="eventStatusButton=='ld'">
@@ -2060,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)
@@ -2115,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 ?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 ?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)
@@ -2280,11 +2316,11 @@ export default {
       let reg_tel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/; //11位手机号码正则
       for (let i in this.dutysystemTableData) {
         if (!reg_user.test(this.dutysystemTableData[i].name)) {
-          this.$message.warning(`请输入正确姓名!`)
+          this.$message.error(`请输入正确姓名!`)
           return;
         }
         if (!reg_tel.test(this.dutysystemTableData[i].telphone)) {
-          this.$message.warning(`请输入正确手机号码!`)
+          this.$message.error(`请输入正确手机号码!`)
           return;
         }
 
@@ -2323,7 +2359,7 @@ export default {
     },
     updateYjYuAn() {
       if (this.eventStatusValue == 'forest_event_status_1') {
-        this.$message.warning(`修改预案信息在签收后方可修改!`)
+        this.$message.error(`修改预案信息在签收后方可修改!`)
         return
       } else {
         let param = {
@@ -2461,6 +2497,8 @@ export default {
       this.sendEventType = null
       this.sendHuoZaiBanJing = 0
       this.sendGuanLianYuAn = null
+      // this.longitude = null
+      // this.latitude = null
       this.sendTaskTitle = null
       this.sendTaskSource = null
       this.sendTaskContent = null
@@ -2692,24 +2730,24 @@ export default {
             }
           }
           if (that.sendTaskSource == '' || that.sendTaskSource == null) {
-            that.$message.warning(`请选择任务来源!`)
+            that.$message.error(`请选择任务来源!`)
             return
           }
           if (that.sendTaskContent == '' || that.sendTaskContent == null) {
-            that.$message.warning(`请输入任务内容!`)
+            that.$message.error(`请输入任务内容!`)
             return
           }
           if (that.sendTaskTitle == '' || that.sendTaskTitle == null) {
-            that.$message.warning(`请输入任务标题!`)
+            that.$message.error(`请输入任务标题!`)
             return
           }
           if (that.sendLianDongDept == '' || that.sendLianDongDept == null) {
-            that.$message.warning(`请选择任务联动部门!`)
+            that.$message.error(`请选择任务联动部门!`)
             return
           }
           if (that.sendDeptId == '' || that.sendDeptId == null || that.sendDeptName == '' || that.sendDeptName ==
             null) {
-            that.$message.warning(`请选择任务发起部门!`)
+            that.$message.error(`请选择任务发起部门!`)
             return
           }
           let eventState = "";
@@ -2753,23 +2791,23 @@ export default {
             let number = /^[+]{0,1}(\d+)$/g; //正整数
 
             if (!double.test(that.table2.areaTotal)) {
-              that.$message.warning(`面积只能填写到小数后两位!`)
+              that.$message.error(`面积只能填写到小数后两位!`)
               return
             }
             if (!number.test(that.table2.peopleTotal)) {
-              that.$message.warning(`人员请填写正整数!`)
+              that.$message.error(`人员请填写正整数!`)
               return
             }
             if (that.table2.forestComposition == '' || that.table2.forestComposition == null) {
-              that.$message.warning(`林木组成不能为空!`)
+              that.$message.error(`林木组成不能为空!`)
               return
             }
             if (that.table2.forestToken == '' || that.table2.forestToken == null) {
-              that.$message.warning(`林令不能为空!`)
+              that.$message.error(`林令不能为空!`)
               return
             }
             if (that.table2.porosities == '' || that.table2.porosities == null) {
-              that.$message.warning(`疏密度不能为空!`)
+              that.$message.error(`疏密度不能为空!`)
               return
             }
           }
@@ -2810,11 +2848,11 @@ export default {
         } else if (eventStatus == 'shtg') {
           that.eventStatusButton = 'sh'
           if (that.eventDescription == '' || that.eventDescription == null) {
-            that.$message.warning(`请填写审核意见!`)
+            that.$message.error(`请填写审核意见!`)
             return
           }
           if (that.attachExamine.length == 0 || that.attachExamine == null) {
-            that.$message.warning(`请上传审核图片!`)
+            that.$message.error(`请上传审核图片!`)
             return
           }
           //事件处理流程--审核通过
@@ -2846,11 +2884,11 @@ export default {
         } else if (eventStatus == 'shbtg') {
           that.eventStatusButton = 'sh'
           if (that.eventDescription == '' || that.eventDescription == null) {
-            that.$message.warning(`请填写审核意见!`)
+            that.$message.error(`请填写审核意见!`)
             return
           }
           if (that.attachExamine.length == 0 || that.attachExamine == null) {
-            that.$message.warning(`请上传审核图片!`)
+            that.$message.error(`请上传审核图片!`)
             return
           }
           //事件处理流程--审核不通过
@@ -2897,12 +2935,12 @@ export default {
           if (eventStatus == 'qs') {
             if (that.sendDeptId == '' || that.sendDeptId == null || that.sendDeptName == '' || that.sendDeptName ==
               null) {
-              that.$message.warning(`请选择部门!`)
+              that.$message.error(`请选择部门!`)
               return
             }
             if (eventStatus == 'qs') {
               if (that.sendEventType == '' || that.sendEventType == null) {
-                that.$message.warning(`请选择事件类型!`)
+                that.$message.error(`请选择事件类型!`)
                 return
               }
             }
@@ -2956,7 +2994,7 @@ export default {
 
     sendEventLog() {
       if (this.eventLog == '' || this.eventLog == null) {
-        this.$message.warning("请录入反馈信息!")
+
         return;
       }
       //日志发送
@@ -3466,11 +3504,11 @@ export default {
       let reg_tel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/; //11位手机号码正则
       for (let i in this.dutysystemTableData) {
         if (!reg_user.test(this.dutysystemTableData[i].name)) {
-          this.$message.warning(`请输入正确姓名!`)
+          this.$message.error(`请输入正确姓名!`)
           return;
         }
         if (!reg_tel.test(this.dutysystemTableData[i].telphone)) {
-          this.$message.warning(`请输入正确手机号码!`)
+          this.$message.error(`请输入正确手机号码!`)
           return;
         }