소스 검색

农业详情修改

wang_xy 2 년 전
부모
커밋
8e439ee36b
8개의 변경된 파일1198개의 추가작업 그리고 823개의 파일을 삭제
  1. 0 1
      src/api/components/supermap.js
  2. 1 1
      src/api/forest.js
  3. 413 37
      src/components/supermap.vue
  4. 5 5
      src/components/vBottomMenu.vue
  5. 2 2
      src/views/datacenter.vue
  6. 182 182
      src/views/eventLogUpload.vue
  7. 588 588
      src/views/eventdetailsdialog.vue
  8. 7 7
      src/views/forest.vue

+ 0 - 1
src/api/components/supermap.js

@@ -50,5 +50,4 @@ export const iconList = {
   'sj-icon-map-guidang': require('@/assets/icons/sj-icon-map/sj-icon-map-guidang.png'),//归档
   'sj-icon-map-banjie': require('@/assets/icons/sj-icon-map/sj-icon-map-banjie.png'),//办结
 
-
 }

+ 1 - 1
src/api/forest.js

@@ -96,7 +96,7 @@ export function getEventByReportorOrder(param) {
 // 日志文件上传
 export function eventLogUpload(param) {
   return request({
-    url: '/center-event/eventcatalogue/upload',
+    url: '/center-event/centereventtfirelog',
     method: 'post',
     data: param
   })

+ 413 - 37
src/components/supermap.vue

@@ -17,6 +17,70 @@
         </div>
       </div>
     </div>
+
+    <div id="toolbar-heat" v-if="isheatPlotting" class="panel panel-primary"
+         style="position:absolute;z-index: 9999; padding: 1rem; bottom:3rem;right: 1rem; border-radius: 4px; width: fit-content;height:fit-content;overflow-y:scroll;background:#040b1f">
+      <div class="panel-body content">
+        <div class="panel">
+          <div class="input-group">
+            <span class="input-group-addon">风向</span>
+            <select class="form-control" style="width:auto" id="heatNums">
+              <option value="1">南风</option>
+              <option value="31">西南风</option>
+              <option value="41">东南风</option>
+              <option value="2">北风</option>
+              <option value="32">西北风</option>
+              <option value="42">东北风</option>
+              <option value="3">西风</option>
+              <option value="4">东风</option>
+            </select>
+          </div>
+        </div>
+        <div class="panel">
+          <div class="input-group">
+            <span class="input-group-addon">风速</span>
+            <input type="text" class="form-control" id="heatNums1" value="6"/>
+          </div>
+        </div>
+        <div class="panel">
+          <div class="input-group">
+            <span class="input-group-addon">温度</span>
+            <input type="text" class="form-control" id="heatNums2" value="10℃"/>
+          </div>
+        </div>
+        <div class="panel">
+          <div class="input-group">
+            <span class="input-group-addon">湿度</span>
+            <input type="text" class="form-control" id="heatNums3" value="6%RH"/>
+          </div>
+        </div>
+        <div class="panel">
+          <div class="input-group">
+            <span class="input-group-addon">持续时间</span>
+            <input type="text" class="form-control" id="heatNums4" value="60分钟"/>
+          </div>
+        </div>
+        <div class="panel">
+          <div class="input-group">
+            <span class="input-group-addon">植被类型</span>
+            <select class="form-control" style="width:auto" id="heatNums5">
+              <option value="1">针叶林</option>
+              <option value="31">落叶林</option>
+            </select>
+          </div>
+        </div>
+        <div class="panel">
+          <div class="input-group">
+            <span class="input-group-addon">大气压</span>
+            <input type="text" class="form-control" id="heatNums6" value="101.325kPa"/>
+          </div>
+        </div>
+        <div class="panel">
+          <el-button type="success" @click="createHeatPoints">分析</el-button>
+          <el-button type="success" @click="clearHeatPoints">重置</el-button>
+        </div>
+      </div>
+    </div>
   </div>
 </template>
 <script>
@@ -61,7 +125,11 @@
         isEditableLayers: false, //绘图控件
         drawControl: null, //绘图控件
         deckglLayer: null, //图层Layer
-        deckglLayerList: [] //图层Layer(数组)
+        deckglLayerList: [], //图层Layer(数组)
+        heatMapLayer: [], //火灾蔓延图层Layer
+        isheatPlotting: false,//火灾蔓延
+        heat_lat: 0, //火灾蔓延经纬度
+        heat_lng: 0 //火灾蔓延经纬度
       }
     },
     watch: {
@@ -247,45 +315,326 @@
       showLineLatLng: null
     },
     methods: {
-      loadHeatMap: async function() {
-        var heatNumbers = 150, heatRadius = 30;
-        var num = parseInt(heatNumbers);
-        num = (num > 0) ? num : 0;
-        var radius = parseInt(heatRadius);
-        radius = (radius > 0) ? radius : 0;
-        var heatPoints = [];
-        for (var i = 0; i < num; i++) {
-          heatPoints[i] = [Math.random() * 0.28 + 42, Math.random() * 0.5 + 125, Math.random() * 80];
+      /** ----------------------------------火势蔓延  开始------------------------------------- */
+      // initEditView: function() {
+      //   var that = this
+      //   var infoView = window.L.control({ position: 'topright' })
+      //   infoView.onAdd = function() {
+      //     that._div = L.DomUtil.create('div', 'editPane')
+      //     that._div.style.width = '236px'
+      //     that._div.innerHTML = '<div id="toolbar" class="panel panel-primary">' +
+      //       '<div class="panel-heading">' +
+      //       '<h5 class="panel-title text-center">' + resources.text_fastHeatMapLayer + '</h5></div>' +
+      //       '<div class="panel-body content">' +
+      //       '<div class="panel">' +
+      //       '<div class="input-group">' +
+      //       '<span class="input-group-addon">风向</span>' +
+      //       '<select class="form-control" style="width:auto" id="heatNums">' +
+      //       '<option value="1" >南风</option>' +
+      //       '<option value="2" >北风</option>' +
+      //       '<option value="3" >西风</option>' +
+      //       '<option value="4" >东风</option>' +
+      //       '</select>' +
+      //       '</div>' +
+      //       '</div>' +
+      //       '<div class="panel">' +
+      //       '<div class="input-group">' +
+      //       '<span class="input-group-addon">风速</span>' +
+      //       '<input type="text" class="form-control" id="heatNums1" value="20"/>' +
+      //       '</div>' +
+      //       '</div>' +
+      //
+      //       '<input type="button" class="btn btn-default" value="' + resources.btn_startDraw + '" onclick ="'+that.createHeatPoints()+'"/>&nbsp; &nbsp;' +
+      //       '<input type="button" class="btn btn-default" value="' + resources.text_input_value_clear + '" onclick ="'+that.clearHeatPoints()+'"/>' +
+      //       '</div>' +
+      //       '</div>'
+      //     that.handleMapEvent(that._div, that.map)
+      //     return that._div
+      //   }
+      //   infoView.addTo(that.map)
+      // },
+      // handleMapEvent: function(div, map) {
+      //   let that = this
+      //   if (!div || !map) {
+      //     return
+      //   }
+      //   div.addEventListener('mouseover', function() {
+      //     that.map.dragging.disable()
+      //     that.map.scrollWheelZoom.disable()
+      //     that.map.doubleClickZoom.disable()
+      //   })
+      //   div.addEventListener('mouseout', function() {
+      //     that.map.dragging.enable()
+      //     that.map.scrollWheelZoom.enable()
+      //     that.map.doubleClickZoom.enable()
+      //   })
+      // },
+      showheatPlotting: function(heat_lat, heat_lng) {
+        this.heat_lat = heat_lat
+        this.heat_lng = heat_lng
+        this.isheatPlotting = true
+      },
+      createHeatPoints: function() {
+        let that = this
+        that.clearHeatPoints()
+        that.heatMapLayer = new window.L.supermap.heatMapLayer(
+          'heatMap',
+          {
+            'map': that.map,
+            'id': 'heatmap',
+            'radius': 10,
+//            设置图层透明度:(参数方式)
+            'opacity': 0.5,
+            //featureWeight指定以哪个属性值为热力权重值创建热力图:
+            'featureWeight': 'value'
+          }
+        )
+        var heatNums = parseInt($('#heatNums').val())
+        //热力半径单位不使用用地理单位
+        that.heatMapLayer.useGeoUnit = true
+        that.heatMapLayer.radius = 0.01
+
+        var features = []
+
+        switch (heatNums) {
+          case 1://南风
+            features = that.getPointArray1()
+            break
+          case 31://西南风
+            features = that.getPointArray3_1()
+            break
+          case 41://东南风
+            features = that.getPointArray4_1()
+            break
+          case 2://北风
+            features = that.getPointArray2()
+            break
+          case 32://西北风
+            features = that.getPointArray3_2()
+            break
+          case 42://东北风
+            features = that.getPointArray4_2()
+            break
+          case 3://西风
+            features = that.getPointArray3()
+            break
+          case 4://东风
+            features = that.getPointArray4()
+            break
+        }
+
+        //加载heatMapFeature格式数据:
+        that.heatMapLayer.addFeatures(features)
+        that.heatMapLayer.addTo(that.map)
+
+      },
+
+      clearHeatPoints: function() {
+        let that = this
+        if (that.heatMapLayer) {
+          that.map.removeLayer(that.heatMapLayer)
+          that.heatMapLayer = null
+        }
+      },
+
+      getPointArray1: function() {
+        var heatNums1 = parseInt($('#heatNums1').val())
+        var mLon = this.heat_lng, mLat = this.heat_lat
+        var points = []
+        for (var i = 0; i < parseInt(heatNums1 / 3); i++) {
+          mLat = this.accAdd(mLat, 0.005)
+          points[i] = new window.L.supermap.heatMapFeature(L.point(mLon, mLat), {
+            'value': 2000 - (i * Math.random())
+          })
+        }
+        return points
+      },
+      getPointArray3_1: function() {
+        var heatNums1 = parseInt($('#heatNums1').val())
+        var mLon = this.heat_lng, mLat = this.heat_lat
+        var points = []
+        for (var i = 0; i < parseInt(heatNums1 / 3); i++) {
+          mLat = this.accAdd(mLat, 0.005)
+          mLon = this.accAdd(mLon, 0.005)
+          points[i] = new window.L.supermap.heatMapFeature(L.point(mLon, mLat), {
+            'value': 2000 - (i * Math.random())
+          })
+        }
+        return points
+      },
+      getPointArray4_1: function() {
+        var heatNums1 = parseInt($('#heatNums1').val())
+        var mLon = this.heat_lng, mLat = this.heat_lat
+        var points = []
+        for (var i = 0; i < parseInt(heatNums1 / 3); i++) {
+          mLat = this.accAdd(mLat, 0.005)
+          mLon = this.accSub(mLon, 0.005)
+          points[i] = new window.L.supermap.heatMapFeature(L.point(mLon, mLat), {
+            'value': 2000 - (i * Math.random())
+          })
+        }
+        return points
+      },
+      getPointArray2: function() {
+        var heatNums1 = parseInt($('#heatNums1').val())
+        var mLon = this.heat_lng, mLat = this.heat_lat
+        var points = []
+        for (var i = 0; i < parseInt(heatNums1 / 3); i++) {
+          mLat = this.accSub(mLat, 0.005)
+          points[i] = new window.L.supermap.heatMapFeature(L.point(mLon, mLat), {
+            'value': 2000 - (i * Math.random())
+          })
+        }
+        return points
+      },
+      getPointArray3_2: function() {
+        var heatNums1 = parseInt($('#heatNums1').val())
+        var mLon = this.heat_lng, mLat = this.heat_lat
+        var points = []
+        for (var i = 0; i < parseInt(heatNums1 / 3); i++) {
+          mLat = this.accSub(mLat, 0.005)
+          mLon = this.accAdd(mLon, 0.005)
+          points[i] = new window.L.supermap.heatMapFeature(L.point(mLon, mLat), {
+            'value': 2000 - (i * Math.random())
+          })
+        }
+        return points
+      },
+      getPointArray4_2: function() {
+        var heatNums1 = parseInt($('#heatNums1').val())
+        var mLon = this.heat_lng, mLat = this.heat_lat
+        var points = []
+        for (var i = 0; i < parseInt(heatNums1 / 3); i++) {
+          mLat = this.accSub(mLat, 0.005)
+          mLon = this.accSub(mLon, 0.005)
+          points[i] = new window.L.supermap.heatMapFeature(L.point(mLon, mLat), {
+            'value': 2000 - (i * Math.random())
+          })
         }
+        return points
+      },
+      getPointArray3: function() {
+        var heatNums1 = parseInt($('#heatNums1').val())
+        var mLon = this.heat_lng, mLat = this.heat_lat
+        var points = []
+        for (var i = 0; i < parseInt(heatNums1 / 3); i++) {
+          mLon = this.accAdd(mLon, 0.005)
+          points[i] = new window.L.supermap.heatMapFeature(L.point(mLon, mLat), {
+            'value': 2000 - (i * Math.random())
+          })
+        }
+        return points
+
+      },
+      getPointArray4: function() {
+        var heatNums1 = parseInt($('#heatNums1').val())
+        var mLon = this.heat_lng, mLat = this.heat_lat
+        var points = []
+        for (var i = 0; i < parseInt(heatNums1 / 3); i++) {
+          mLon = this.accSub(mLon, 0.005)
+          points[i] = new window.L.supermap.heatMapFeature(L.point(mLon, mLat), {
+            'value': 2000 - (i * Math.random())
+          })
+        }
+        return points
+
+      },
+      //加法函数,用来得到精确的加法结果
+//说明:javascript的加法结果会有误差,在两个浮点数相加的时候会比较明显。这个函数返回较为精确的加法结果。
+//调用:accAdd(arg1,arg2)
+//返回值:arg1加上arg2的精确结果
+      accAdd: function(arg1, arg2) {
+        var r1, r2, m, c
+        try {
+          r1 = arg1.toString().split('.')[1].length
+        } catch (e) {
+          r1 = 0
+        }
+        try {
+          r2 = arg2.toString().split('.')[1].length
+        } catch (e) {
+          r2 = 0
+        }
+        c = Math.abs(r1 - r2)
+        m = Math.pow(10, Math.max(r1, r2))
+        if (c > 0) {
+          var cm = Math.pow(10, c)
+          if (r1 > r2) {
+            arg1 = Number(arg1.toString().replace('.', ''))
+            arg2 = Number(arg2.toString().replace('.', '')) * cm
+          } else {
+            arg1 = Number(arg1.toString().replace('.', '')) * cm
+            arg2 = Number(arg2.toString().replace('.', ''))
+          }
+        } else {
+          arg1 = Number(arg1.toString().replace('.', ''))
+          arg2 = Number(arg2.toString().replace('.', ''))
+        }
+        return (arg1 + arg2) / m
+      },
+      /**
+       ** 减法函数,用来得到精确的减法结果
+       ** 说明:javascript的减法结果会有误差,在两个浮点数相减的时候会比较明显。这个函数返回较为精确的减法结果。
+       ** 调用:accSub(arg1,arg2)
+       ** 返回值:arg1加上arg2的精确结果
+       **/
+      accSub: function(arg1, arg2) {
+        var r1, r2, m, n
+        try {
+          r1 = arg1.toString().split('.')[1].length
+        } catch (e) {
+          r1 = 0
+        }
+        try {
+          r2 = arg2.toString().split('.')[1].length
+        } catch (e) {
+          r2 = 0
+        }
+        m = Math.pow(10, Math.max(r1, r2)) //last modify by deeka //动态控制精度长度
+        n = r1 >= r2 ? r1 : r2
+        return ((arg1 * m - arg2 * m) / m).toFixed(n)
+      },
+      /** ----------------------------------火势蔓延  结束------------------------------------- */
+      /** ----------------------------------热力图  结束------------------------------------- */
+      loadHeatMap: async function(points) {
+        var heatNumbers = 150, heatRadius = 30
+        var num = parseInt(heatNumbers)
+        num = (num > 0) ? num : 0
+        var radius = parseInt(heatRadius)
+        radius = (radius > 0) ? radius : 0
+        var heatPoints = points
+        // for (var i = 0; i < num; i++) {
+        //   heatPoints[i] = [Math.random() * 0.28 + 42, Math.random() * 0.5 + 125, Math.random() * 80]
+        // }
         var resultLayer = window.L.heatLayer(heatPoints, {
           radius: radius,
           minOpacity: 0.5
-        }).addTo(this.map);
+        }).addTo(this.map)
       },
+      /** ----------------------------------热力图  开始------------------------------------- */
       clearM: async function(isAggregation) { //清理地图标点
         if (isAggregation) {
           if (this.isAggregationMyGroup != undefined && this.isAggregationMyGroup != false) {
             this.isAggregationMyGroup.clearLayers()
           }
-          if (this.isAggregationLayers != null && this.isAggregationLayers.length > 0) {
-            this.map.removeLayer(this.isAggregationLayers)
-            this.isAggregationLayers = []
-            this.radiusLayers = []
-            this.isAggregationLayers = window.L.markerClusterGroup({
-              //设置为true时显示聚类所占据的范围
-              showCoverageOnHover: true,
-              //设置为true时会向低一级聚类缩放
-              zoomToBoundsOnClick: true,
-              //增加点位时增加聚合动画(否则会出问题)
-              animateAddingMarkers: true,
-              //最大缩放级别点击聚合图标展开图标
-              spiderfyOnMaxZoom: true
-            })
-          }
+          this.map.removeLayer(this.isAggregationLayers)
+          this.isAggregationLayers = []
+          this.radiusLayers = []
+          this.isAggregationLayers = window.L.markerClusterGroup({
+            //设置为true时显示聚类所占据的范围
+            showCoverageOnHover: true,
+            //设置为true时会向低一级聚类缩放
+            zoomToBoundsOnClick: true,
+            //增加点位时增加聚合动画(否则会出问题)
+            animateAddingMarkers: true,
+            //最大缩放级别点击聚合图标展开图标
+            spiderfyOnMaxZoom: true
+          })
         } else {
           if (this.myGroup != undefined && this.myGroup != false) {
             this.myGroup.clearLayers()
           }
+          this.map.removeLayer(this.layers)
           this.layers = []
         }
       },
@@ -657,7 +1006,7 @@
           })
           let markerClick = window.L.marker([markersList[i].lat, markersList[i].lng], {
             icon: icon
-          }).addTo(this.map)
+          })
           if (markersList[i].bindPopupHtml != null && markersList[i].bindPopupHtml !== '') {
             let html = markersList[i].bindPopupHtml
             if (keepBindPopup) {
@@ -691,14 +1040,15 @@
           if (isAggregation) {
             _that.isAggregationLayers.addLayer(markerClick)
             _that.isAggregationMyGroup = window.L.layerGroup(_that.isAggregationLayers)
-            this.map.addLayer(_that.isAggregationLayers)
           } else {
             _that.layers.push(markerClick)
             _that.myGroup = window.L.layerGroup(_that.layers)
-            this.map.addLayer(_that.myGroup)
           }
-
         }
+        if (_that.myGroup != undefined && _that.myGroup != false) {
+          _that.map.addLayer(_that.myGroup)
+        }
+        _that.map.addLayer(_that.isAggregationLayers)
       },
       setMarkersByType: function(markersList, type) { //地图标点(根据类型,可取消落点 clearMByType方法)
         const _that = this
@@ -870,13 +1220,13 @@
         }
       },
       dropLocation: function(lat, lng) { //落点定位
-
-        this.map.flyTo([lat, lng], 14, { duration: 2 })
-
-        // this.controlLevel(12)
-        // setTimeout(() => {
-        //   this.map.panTo([lat, lng])
-        // }, 1000)
+        this.map.flyTo([lat, lng], 13, { duration: 2 })
+      },
+      dropLocation10: function(lat, lng) { //落点定位
+        this.map.flyTo([lat, lng], 10, { duration: 2 })
+      },
+      dropLocation5: function(lat, lng) { //落点定位
+        this.map.flyTo([lat, lng], 5, { duration: 2 })
       },
       controlLevel: function(level) { //控制地图缩放级别
         this.map.setZoom(level)
@@ -938,6 +1288,32 @@
 
 <style lang="scss" scoped>
   @import '@/assets/styles/base.scss';
+  .panel{
+    margin-bottom: .5rem;
+    button{
+      margin-top: .5rem;
+    }
+    .input-group{
+      display: flex;
+      flex-direction: row;
+      align-items: center;
+      .input-group-addon{
+        color: $inBlue;
+        width: 3rem;
+        text-align: right;
+
+      }
+      .form-control{
+        padding: 0 .3rem;
+        margin-left: .5rem;
+        height: 1.5rem;
+        line-height: 1.5rem;
+        background-color: #112543;
+        color: $inBlue;
+        border: 1px $searchBorder;
+      }
+    }
+  }
 
   .button-group {
     button {

+ 5 - 5
src/components/vBottomMenu.vue

@@ -446,11 +446,11 @@ export default {
           icon: 'iconfont sj-icon-sjdw',
           click: 'eventLocation'
         },
-        {
-          name: '图层切换',
-          icon: 'iconfont sj-icon-tcqh',
-          click: 'layerSwitching'
-        },
+        // {
+        //   name: '图层切换',
+        //   icon: 'iconfont sj-icon-tcqh',
+        //   click: 'layerSwitching'
+        // },
         {
           name: '测量工具',
           icon: 'iconfont sj-icon-clgj',

+ 2 - 2
src/views/datacenter.vue

@@ -330,7 +330,7 @@ export default {
 
     showPointDetails(pointParam){
       //事件信息弹出
-      this.$refs.pointDetails.showPointDetails(pointParam);
+      // this.$refs.pointDetails.showPointDetails(pointParam);
     },
 
     getResource() {
@@ -463,7 +463,7 @@ export default {
                   '   </span>' +
                   '</div>',
                 click: 'showPointDetails',
-                parameter: {id:res.data.list[i].id,type:type},
+                parameter: {id:res.data[i].id,type:type},
                 keepBindPopup: false,
                 isAggregation: false
               }

+ 182 - 182
src/views/eventLogUpload.vue

@@ -22,7 +22,7 @@
         <div class="el-upload__tip" slot="tip" v-if="showTip">
           请上传
           <template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b></template>
-<!--          <template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b></template>-->
+          <!--          <template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b></template>-->
           的文件
         </div>
       </el-upload>
@@ -46,206 +46,206 @@
 </template>
 
 <script>
-import { getToken } from '@/utils/auth'
-import {
-  eventLogUpload
-} from '@/api/forest'
+  import { getToken } from '@/utils/auth'
+  import {
+    eventLogUpload
+  } from '@/api/forest'
 
-export default {
-  name: 'FileUpload',
-  props: {
-    // 值
-    value: [String, Object, Array],
-    // 数量限制
-    limit: {
-      type: Number,
-      default: 5
-    },
-    // 大小限制(MB)
-    fileSize: {
-      type: Number,
-      default: 5
-    },
-    // // 文件类型, 例如['png', 'jpg', 'jpeg']
-    // fileType: {
-    //   type: Array,
-    //   default: () => []
-    // },
-    // 是否显示提示
-    isShowTip: {
-      type: Boolean,
-      default: true
-    }
-  },
-  data() {
-    return {
-      eventCode:null,
-      showEventLogUpload: false,
-      number: 0,
-      uploadList: [],
-      uploadFileUrl: process.env.VUE_APP_BASE_API + '/file/upload', // 上传的图片服务器地址
-      headers: {
-        Authorization: 'Bearer ' + getToken()
+  export default {
+    name: 'FileUpload',
+    props: {
+      // 值
+      value: [String, Object, Array],
+      // 数量限制
+      limit: {
+        type: Number,
+        default: 5
       },
-      fileList: []
-    }
-  },
-  watch: {
-    value: {
-      handler(val) {
-        if (val) {
-          let temp = 1
-          // 首先将值转为数组
-          const list = Array.isArray(val) ? val : this.value.split(',')
-          // 然后将数组转为对象数组
-          this.fileList = list.map(item => {
-            if (typeof item === 'string') {
-              item = { name: item, url: item }
-            }
-            item.uid = item.uid || new Date().getTime() + temp++
-            return item
-          })
-        } else {
-          this.fileList = []
-          return []
-        }
+      // 大小限制(MB)
+      fileSize: {
+        type: Number,
+        default: 5
       },
-      deep: true,
-      immediate: true
-    }
-  },
-  computed: {
-    // 是否显示提示
-    showTip() {
-      return this.isShowTip
-    }
-  },
-  methods: {
-    submitUpload() {
-      let fileUrl=[]
-      if(this.fileList!=null&&this.fileList.length>0){
-        for (let i = 0; i < this.fileList.length; i++) {
-          let file={url:this.fileList[i].url,webname:this.fileList[i].webName}
-          fileUrl.push(file)
-        }
+      // // 文件类型, 例如['png', 'jpg', 'jpeg']
+      // fileType: {
+      //   type: Array,
+      //   default: () => []
+      // },
+      // 是否显示提示
+      isShowTip: {
+        type: Boolean,
+        default: true
+      }
+    },
+    data() {
+      return {
+        eventCode:null,
+        showEventLogUpload: false,
+        number: 0,
+        uploadList: [],
+        uploadFileUrl: process.env.VUE_APP_BASE_API + '/file/upload', // 上传的图片服务器地址
+        headers: {
+          Authorization: 'Bearer ' + getToken()
+        },
+        fileList: []
       }
-      let param={ eventCode:this.eventCode,fileUrl: fileUrl }
-      //日志文件上传
-      eventLogUpload(param).then(res => {
-        if(res.code==200){
-          this.$message.success(`上传成功!`);
-          this.showEventLogUpload = false
-          this.cancelEventLogUploadShow();
-          this.$parent.refreshEventDialog(this.eventCode)
-        }
-      })
     },
-    eventLogUpload(eventCode) {
-      this.eventCode=eventCode
-      //上传页面弹出
-      this.showEventLogUpload = true
+    watch: {
+      value: {
+        handler(val) {
+          if (val) {
+            let temp = 1
+            // 首先将值转为数组
+            const list = Array.isArray(val) ? val : this.value.split(',')
+            // 然后将数组转为对象数组
+            this.fileList = list.map(item => {
+              if (typeof item === 'string') {
+                item = { name: item, url: item }
+              }
+              item.uid = item.uid || new Date().getTime() + temp++
+              return item
+            })
+          } else {
+            this.fileList = []
+            return []
+          }
+        },
+        deep: true,
+        immediate: true
+      }
     },
-    cancelEventLogUploadShow() {
-      //关闭页面
-      this.fileList = []
-      this.uploadList = []
+    computed: {
+      // 是否显示提示
+      showTip() {
+        return this.isShowTip
+      }
     },
-    // 上传前校检格式和大小
-    handleBeforeUpload(file) {
-      // 校检文件类型
-      if (false) {
-        let fileExtension = ''
-        if (file.name.lastIndexOf('.') > -1) {
-          fileExtension = file.name.slice(file.name.lastIndexOf('.') + 1)
+    methods: {
+      submitUpload() {
+        let fileUrl=[]
+        if(this.fileList!=null&&this.fileList.length>0){
+          for (let i = 0; i < this.fileList.length; i++) {
+            let file={attachPath:this.fileList[i].url,fileName:this.fileList[i].webName,busIndx: "bus_indx_forest",busSource: "PC"}
+            fileUrl.push(file)
+          }
         }
-        const isTypeOk = this.fileType.some((type) => {
-          if (file.type.indexOf(type) > -1) return true
-          if (fileExtension && fileExtension.indexOf(type) > -1) return true
-          return false
+        let param={ eventCode:this.eventCode,operation:"bus_oper_type_2",operationType:"log_oper_type_1",fileList:fileUrl}
+        //日志文件上传
+        eventLogUpload(param).then(res => {
+          if(res.code==200){
+            this.$message.success(`上传成功!`);
+            this.showEventLogUpload = false
+            this.cancelEventLogUploadShow();
+            this.$parent.refreshEventDialog(this.eventCode)
+          }
         })
-        if (!isTypeOk) {
-          this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join('/')}格式文件!`)
-          return false
+      },
+      eventLogUpload(eventCode) {
+        this.eventCode=eventCode
+        //上传页面弹出
+        this.showEventLogUpload = true
+      },
+      cancelEventLogUploadShow() {
+        //关闭页面
+        this.fileList = []
+        this.uploadList = []
+      },
+      // 上传前校检格式和大小
+      handleBeforeUpload(file) {
+        // 校检文件类型
+        if (false) {
+          let fileExtension = ''
+          if (file.name.lastIndexOf('.') > -1) {
+            fileExtension = file.name.slice(file.name.lastIndexOf('.') + 1)
+          }
+          const isTypeOk = this.fileType.some((type) => {
+            if (file.type.indexOf(type) > -1) return true
+            if (fileExtension && fileExtension.indexOf(type) > -1) return true
+            return false
+          })
+          if (!isTypeOk) {
+            this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join('/')}格式文件!`)
+            return false
+          }
         }
-      }
-      // 校检文件大小
-      if (this.fileSize) {
-        const isLt = file.size / 1024 / 1024 < this.fileSize
-        if (!isLt) {
-          this.$modal.msgError(`上传文件大小不能超过 ${this.fileSize} MB!`)
-          return false
+        // 校检文件大小
+        if (this.fileSize) {
+          const isLt = file.size / 1024 / 1024 < this.fileSize
+          if (!isLt) {
+            this.$modal.msgError(`上传文件大小不能超过 ${this.fileSize} MB!`)
+            return false
+          }
         }
-      }
-      this.$modal.loading('正在上传文件,请稍候...')
-      this.number++
-      return true
-    },
-    // 文件个数超出
-    handleExceed() {
-      this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`)
-    },
-    // 上传失败
-    handleUploadError(err) {
-      this.$modal.msgError('上传图片失败,请重试')
-      this.$modal.closeLoading()
-    },
-    // 上传成功回调
-    handleUploadSuccess(res) {
-      this.uploadList.push({ name: res.data.url, url: res.data.url, webName: res.data.webName })
-      if (this.uploadList.length === this.number) {
-        this.fileList = this.fileList.concat(this.uploadList)
-        this.uploadList = []
-        this.number = 0
-        this.$emit('input', this.listToString(this.fileList))
+        this.$modal.loading('正在上传文件,请稍候...')
+        this.number++
+        return true
+      },
+      // 文件个数超出
+      handleExceed() {
+        this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`)
+      },
+      // 上传失败
+      handleUploadError(err) {
+        this.$modal.msgError('上传图片失败,请重试')
         this.$modal.closeLoading()
+      },
+      // 上传成功回调
+      handleUploadSuccess(res) {
+        this.uploadList.push({ name: res.data.url, url: res.data.url, webName: res.data.webName })
+        if (this.uploadList.length === this.number) {
+          this.fileList = this.fileList.concat(this.uploadList)
+          this.uploadList = []
+          this.number = 0
+          this.$emit('input', this.listToString(this.fileList))
+          this.$modal.closeLoading()
+        }
+      },
+      // 删除文件
+      handleDelete(index) {
+        this.fileList.splice(index, 1)
+        this.$emit('input', this.listToString(this.fileList))
+      },
+      // 获取文件名称
+      getFileName(name) {
+        if (name.lastIndexOf('/') > -1) {
+          return name.slice(name.lastIndexOf('/') + 1)
+        } else {
+          return ''
+        }
+      },
+      // 对象转成指定字符串分隔
+      listToString(list, separator) {
+        let strs = ''
+        separator = separator || ','
+        for (let i in list) {
+          strs += list[i].url + separator
+        }
+        return strs != '' ? strs.substr(0, strs.length - 1) : ''
       }
-    },
-    // 删除文件
-    handleDelete(index) {
-      this.fileList.splice(index, 1)
-      this.$emit('input', this.listToString(this.fileList))
-    },
-    // 获取文件名称
-    getFileName(name) {
-      if (name.lastIndexOf('/') > -1) {
-        return name.slice(name.lastIndexOf('/') + 1)
-      } else {
-        return ''
-      }
-    },
-    // 对象转成指定字符串分隔
-    listToString(list, separator) {
-      let strs = ''
-      separator = separator || ','
-      for (let i in list) {
-        strs += list[i].url + separator
-      }
-      return strs != '' ? strs.substr(0, strs.length - 1) : ''
     }
   }
-}
 </script>
 
 <style scoped lang="scss">
-.upload-file-uploader {
-  margin-bottom: 5px;
-}
+  .upload-file-uploader {
+    margin-bottom: 5px;
+  }
 
-.upload-file-list .el-upload-list__item {
-  border: 1px solid #e4e7ed;
-  line-height: 2;
-  margin-bottom: 10px;
-  position: relative;
-}
+  .upload-file-list .el-upload-list__item {
+    border: 1px solid #e4e7ed;
+    line-height: 2;
+    margin-bottom: 10px;
+    position: relative;
+  }
 
-.upload-file-list .ele-upload-list__item-content {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  color: inherit;
-}
+  .upload-file-list .ele-upload-list__item-content {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    color: inherit;
+  }
 
-.ele-upload-list__item-content-action .el-link {
-  margin-right: 10px;
-}
+  .ele-upload-list__item-content-action .el-link {
+    margin-right: 10px;
+  }
 </style>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 588 - 588
src/views/eventdetailsdialog.vue


+ 7 - 7
src/views/forest.vue

@@ -566,18 +566,18 @@ export default {
           if (this.eventList[i].eventStatusValue == 'forest_event_status_1' && this.eventList[i].urgeCount == 0) {
             markersMap.click = 'showEventDialog'
             markersMap.icon = 'sj-icon-map-xinshangbao'
-            markersMap.isAggregation = false
           }
           if (this.eventList[i].eventStatusValue == 'forest_event_status_1' && this.eventList[i].urgeCount > 0) {
             markersMap.click = 'showEventDialog'
             markersMap.icon = 'sj-icon-map-cuiban'
-            markersMap.isAggregation = false
           } else if (this.eventList[i].eventStatusValue == 'forest_event_status_2') {
             markersMap.click = 'showEventDialog'
             markersMap.icon = 'sj-icon-map-qianshou'
+            markersMap.isAggregation = false
           } else if (this.eventList[i].eventStatusValue == 'forest_event_status_5') {
             markersMap.click = 'showEventDialog'
             markersMap.icon = 'sj-icon-map-banjie'
+            markersMap.isAggregation = false
           } else if (this.eventList[i].eventStatusValue == 'forest_event_status_6') {
             markersMap.click = 'showEventDialog'
             markersMap.icon = 'sj-icon-map-guidnag'
@@ -904,8 +904,8 @@ export default {
       this.eventListAll = []
       //右侧获取事件列表
       getEventList({ day: day }).then(res => {
+        debugger
         this.eventList = res.data;
-
         console.log(res.data);
         this.eventListAll = res.data
         that.markersList = []
@@ -921,27 +921,27 @@ export default {
               keepBindPopup: false,
               isAggregation: false
             }
-            if (this.eventList.length > 50) {
+            if (this.eventList.length > 200) {
               markersMap.isAggregation = true
             }
             if (this.eventList[i].eventStatusValue == 'forest_event_status_1' && this.eventList[i].urgeCount == 0) {
               markersMap.click = 'showEventDialog'
               markersMap.icon = 'sj-icon-map-xinshangbao'
-              markersMap.isAggregation = false
             }
             if (this.eventList[i].eventStatusValue == 'forest_event_status_1' && this.eventList[i].urgeCount > 0) {
               markersMap.click = 'showEventDialog'
               markersMap.icon = 'sj-icon-map-cuiban'
-              markersMap.isAggregation = false
             } else if (this.eventList[i].eventStatusValue == 'forest_event_status_2') {
               markersMap.click = 'showEventDialog'
               markersMap.icon = 'sj-icon-map-qianshou'
+              markersMap.isAggregation = false
             } else if (this.eventList[i].eventStatusValue == 'forest_event_status_5') {
               markersMap.click = 'showEventDialog'
               markersMap.icon = 'sj-icon-map-banjie'
+              markersMap.isAggregation = false
             } else if (this.eventList[i].eventStatusValue == 'forest_event_status_6') {
               markersMap.click = 'showEventDialog'
-              markersMap.icon = 'sj-icon-map-guidnag'
+              markersMap.icon = 'sj-icon-map-guidang'
             }
             markersMap.parameter = this.eventList[i].eventCode
             markersMap.lng = this.eventList[i].longitude