彭宇 2 år sedan
förälder
incheckning
e332324e4f
4 ändrade filer med 25 tillägg och 24 borttagningar
  1. 2 2
      src/api/disaster.js
  2. 2 2
      src/api/event.js
  3. 7 7
      src/components/supermap.vue
  4. 14 13
      src/views/disaster.vue

+ 2 - 2
src/api/disaster.js

@@ -9,10 +9,10 @@ export function getInit(year) {
   })
 }
 // 点击列表获取数据
-export function selectFireLoseByid(id) {
+export function selectFireLoseByid(id,eventId) {
   return request({
     url: '/center-fire/VisuForestFireLossController/selectFireLoseByid',
     method: 'post',
-    data:{"id":id}
+    data:{"id":id,"eventId":eventId}
   })
 }

+ 2 - 2
src/api/event.js

@@ -64,14 +64,14 @@ export function getImgUrl(data) {
 //获取附近事件
 export function getNearEvent(longitude,latitude) {
   return request({
-    url: '/center-fire/VisuForestEventCenterController/getNearEvent?longitude='+latitude+"&latitude="+latitude,
+    url: '/center-fire/VisuForestEventCenterController/getNearEvent?longitude='+longitude+"&latitude="+latitude,
     method: 'get',
   })
 }
 //获取附近摄像头
 export function getNearCamera(longitude,latitude) {
   return request({
-    url: '/center-fire/VisuForestEventCenterController/getNearCamera?longitude='+latitude+"&latitude="+latitude,
+    url: '/center-fire/VisuForestEventCenterController/getNearCamera?longitude='+longitude+"&latitude="+latitude,
     method: 'get',
   })
 }

+ 7 - 7
src/components/supermap.vue

@@ -743,13 +743,13 @@
         this.map.setZoom(level)
       },
       layerSwitching: function(url, isClear) {//图层切换  url 图层地址   isClear  是否清除图层
-        // if (isClear) {
-        //   if (this.deckglLayerLists != null) {
-        //     for (let i = 0; i < this.deckglLayerLists.length; i++) {
-        //       this.deckglLayerLists[i].remove()
-        //     }
-        //   }
-        // }
+        if (isClear) {
+          if (this.deckglLayerLists != null) {
+            for (let i = 0; i < this.deckglLayerLists.length; i++) {
+              this.deckglLayerLists[i].remove()
+            }
+          }
+        }
         this.deckglLayer = window.L.supermap.tiledMapLayer(url, {})
         this.map.addLayer(this.deckglLayer)
         this.deckglLayerLists.push(this.deckglLayer);

+ 14 - 13
src/views/disaster.vue

@@ -167,8 +167,9 @@
             <span>列表</span>
           </div>
           <div class="i-list-con h-19">
-            <div class="d-l-con" :class="{on:listCurrentIndex==index}" v-for="(item,index) in fireList" :key="index"   @click="choseFireList(item.id,index)">
-              <div class="d-l-l-text" >
+            <div class="d-l-con" :class="{on:listCurrentIndex==index}" v-for="(item,index) in fireList" :key="index"
+                 @click="choseFireList(item.id,item.eventId,index)">
+              <div class="d-l-l-text">
                 <i class="i-small"></i>
                 <h4>{{pickYear.getYear()+1900}}年第{{index+1}}场火灾</h4>
               </div>
@@ -339,8 +340,8 @@
     },
     created() {
       /** ----------------------------------底部按钮公用组件开始------------------------------------- */
-      window.showDialog=this.showDialog
-      window.choseLayerSwitching=this.choseLayerSwitching
+      window.showDialog = this.showDialog
+      window.choseLayerSwitching = this.choseLayerSwitching
       /** ----------------------------------底部按钮公用组件结束------------------------------------- */
     },
     mounted() {
@@ -348,7 +349,7 @@
     },
     data() {
       return {
-		listCurrentIndex:0,
+        listCurrentIndex: 0,
         numberFiresYear: 0,
         forestFireLossTotal: 0,
         fireLossTotalYear: 0,
@@ -474,14 +475,14 @@
       },
       //选择图层
       choseLayerSwitching(url) {
-        this.$refs.supermap.layerSwitching(url, true);
+        this.$refs.supermap.layerSwitching(url, true)
       },
       /** ----------------------------------底部按钮公用组件结束------------------------------------- */
-      choseFireList(id,index) {
-		this.listCurrentIndex = index
+      choseFireList(id,eventId, index) {
+        this.listCurrentIndex = index
         let that = this
-        selectFireLoseByid(id).then(res => {
-          this.graphicsList=[]
+        selectFireLoseByid(id,eventId).then(res => {
+          this.graphicsList = []
           //地图标记
           if (res.data.regionalFlagBOList != null && res.data.regionalFlagBOList.length > 0) {
             for (let i = 0; i < res.data.regionalFlagBOList.length; i++) {
@@ -495,7 +496,7 @@
               that.$refs.supermap.clearG()
               that.$refs.supermap.setGraphicsList(this.graphicsList, 'red')
             }, 1000)
-          }else{
+          } else {
             that.$refs.supermap.clearG()
           }
           //右侧
@@ -525,7 +526,7 @@
           this.otherFireCosts[0].elseBlazesPrice = res.data.visuForestFireLossBO.elseBlazesPrice != null ? res.data.visuForestFireLossBO.elseBlazesPrice : 0
         })
       },
-	  
+
       getInit() {
         let that = this
         //获取左侧菜单列表
@@ -552,7 +553,7 @@
           if (res.data.visuForestFireLossTimeBOList != null && res.data.visuForestFireLossTimeBOList.length > 0) {
             this.numberFiresYear = res.data.visuForestFireLossTimeBOList.length
             this.fireList = res.data.visuForestFireLossTimeBOList
-          }else{
+          } else {
             this.numberFiresYear = 0
           }