From 24d2724aaf2f8331fc179c87595eb9a4720cf8a9 Mon Sep 17 00:00:00 2001
From: wangqi <magical1908@outlook.com>
Date: 星期三, 31 三月 2021 14:32:40 +0800
Subject: [PATCH] 修改文件接口路徑

---
 public/assets/images/map/exhaust/fq_bright_green.png |    0 
 src/components/LayerController/logic/WasteGas.js     |   63 ++++++++++++--------
 public/assets/images/map/exhaust/fq_green_xc.png     |    0 
 src/api/mapApi.js                                    |    6 +-
 src/views/MapTemplate.vue                            |   46 +--------------
 public/assets/images/map/exhaust/fq_orange.png       |    0 
 src/api/mapUrl.js                                    |    2 
 public/assets/images/map/exhaust/fq_blue.png         |    0 
 public/assets/images/map/exhaust/fq_green.png        |    0 
 src/utils/axios.js                                   |    2 
 public/assets/images/map/exhaust/fq_gray.png         |    0 
 public/assets/images/map/exhaust/fq_yellow.png       |    0 
 public/assets/images/map/exhaust/fq_red.png          |    0 
 src/components/LayerController/logic/SolidWaste.js   |    2 
 14 files changed, 47 insertions(+), 74 deletions(-)

diff --git a/src/assets/images/map-pages/basenav/flugas/exhaust/fq_blue.png b/public/assets/images/map/exhaust/fq_blue.png
similarity index 100%
rename from src/assets/images/map-pages/basenav/flugas/exhaust/fq_blue.png
rename to public/assets/images/map/exhaust/fq_blue.png
Binary files differ
diff --git a/src/assets/images/map-pages/basenav/flugas/exhaust/fq_bright_green.png b/public/assets/images/map/exhaust/fq_bright_green.png
similarity index 100%
rename from src/assets/images/map-pages/basenav/flugas/exhaust/fq_bright_green.png
rename to public/assets/images/map/exhaust/fq_bright_green.png
Binary files differ
diff --git a/src/assets/images/map-pages/basenav/flugas/exhaust/fq_gray.png b/public/assets/images/map/exhaust/fq_gray.png
similarity index 100%
rename from src/assets/images/map-pages/basenav/flugas/exhaust/fq_gray.png
rename to public/assets/images/map/exhaust/fq_gray.png
Binary files differ
diff --git a/src/assets/images/map-pages/basenav/flugas/exhaust/fq_green.png b/public/assets/images/map/exhaust/fq_green.png
similarity index 100%
rename from src/assets/images/map-pages/basenav/flugas/exhaust/fq_green.png
rename to public/assets/images/map/exhaust/fq_green.png
Binary files differ
diff --git a/src/assets/images/map-pages/basenav/flugas/exhaust/fq_green_xc.png b/public/assets/images/map/exhaust/fq_green_xc.png
similarity index 100%
rename from src/assets/images/map-pages/basenav/flugas/exhaust/fq_green_xc.png
rename to public/assets/images/map/exhaust/fq_green_xc.png
Binary files differ
diff --git a/src/assets/images/map-pages/basenav/flugas/exhaust/fq_orange.png b/public/assets/images/map/exhaust/fq_orange.png
similarity index 100%
rename from src/assets/images/map-pages/basenav/flugas/exhaust/fq_orange.png
rename to public/assets/images/map/exhaust/fq_orange.png
Binary files differ
diff --git a/src/assets/images/map-pages/basenav/flugas/exhaust/fq_red.png b/public/assets/images/map/exhaust/fq_red.png
similarity index 100%
rename from src/assets/images/map-pages/basenav/flugas/exhaust/fq_red.png
rename to public/assets/images/map/exhaust/fq_red.png
Binary files differ
diff --git a/src/assets/images/map-pages/basenav/flugas/exhaust/fq_yellow.png b/public/assets/images/map/exhaust/fq_yellow.png
similarity index 100%
rename from src/assets/images/map-pages/basenav/flugas/exhaust/fq_yellow.png
rename to public/assets/images/map/exhaust/fq_yellow.png
Binary files differ
diff --git a/src/api/mapApi.js b/src/api/mapApi.js
index 4c19989..7590948 100644
--- a/src/api/mapApi.js
+++ b/src/api/mapApi.js
@@ -14,8 +14,8 @@
   },
   getSolidWaste (data) {
     return axios.get(mapUrl.getSolidWaste, data)
+  },
+  GetWasteGas (data) {
+    return axios.get(mapUrl.GetWasteGas, data)
   }
-  // getWasteGas (data) {
-  //   return axios.get(mapUrl.GetWasteGas, data)
-  // }
 }
diff --git a/src/api/mapUrl.js b/src/api/mapUrl.js
index e84ab6c..d0bc6a0 100644
--- a/src/api/mapUrl.js
+++ b/src/api/mapUrl.js
@@ -5,6 +5,6 @@
 
 export const GetUser = $HOST + '/user/getUser'
 
-// export const GetWasteGas = $HOST + '/wasteGas/getWasteGas'
+export const GetWasteGas = $HOST + '/wasteGas/getWasteGas'
 
 export const getSolidWaste = $HOST + '/wasteSolid/getSolidWaste'
diff --git a/src/components/LayerController/logic/SolidWaste.js b/src/components/LayerController/logic/SolidWaste.js
index dfc5841..b883a04 100644
--- a/src/components/LayerController/logic/SolidWaste.js
+++ b/src/components/LayerController/logic/SolidWaste.js
@@ -14,7 +14,6 @@
    * @param L leaflet瀵硅薄
    */
   this.init = async (layer, L) => {
-    // const SolidWasteIcon = this.SolidWasteIcon()
     this.animalService = new AnimalService({
       L: L,
       layer: layer
@@ -38,7 +37,6 @@
           iconAnchor: [25, 25]
         })
       })
-
       layer.addLayer(marker)
     }
   }
diff --git a/src/components/LayerController/logic/WasteGas.js b/src/components/LayerController/logic/WasteGas.js
index 4613288..b2ead2d 100644
--- a/src/components/LayerController/logic/WasteGas.js
+++ b/src/components/LayerController/logic/WasteGas.js
@@ -2,38 +2,41 @@
  * 搴熸皵
  */
 const AnimalService = require('../service/AnimalService').default
-const AjaxUtils = require('../../../utils/AjaxUtils').default
+// const AjaxUtils = require('../../../utils/AjaxUtils').default
 
+// 鍖哄垎涓嶅悓绫诲瀷 浣跨敤涓嶅悓img
+const defaultImg = '/assets/images/map/exhaust/fq_blue.png'
+const setting = '/assets/images/map/exhaust/fq_gray.png'
+
+const mapApi = require('../../../api/mapApi').default
 module.exports = function () {
   /**
    * 杩斿洖marker瀵硅薄鏁扮粍
    * @param L leaflet瀵硅薄
    */
-  this.init = (layer, L) => {
+  this.init = async (layer, L) => {
     this.animalService = new AnimalService({ L: L, layer: layer })
-    AjaxUtils.get4JsonDataByUrl('http://10.246.162.140:8080/EPInterface/DataService/EPMapService.asmx/ObtainningConInfo', {
-      companyId: 3900100145,
-      id: '',
-      monType: 1,
-      userCode: 'wenchun.deng',
-      monDuration: '',
-      epName: '',
-      secdDeptId: '',
-      contrLevel: '',
-      dataStatus: '',
-      dataFlag: '',
-      runStatus: '',
-      emissTypeId: ''
-    }, function (res) {
-      const data = res.data.Result.DataInfo
-      // console.log(data)
-      for (let i = 0; i < data.length; i++) {
-        // 缁忕含搴� 浣嶇疆
-        const positionX = data[i].Latitude
-        const positionY = data[i].Longitude
-        layer.addLayer(L.marker([positionX, positionY], {}))
-      }
-    })
+    const res = await mapApi.GetWasteGas()
+    const data = res.Result.DataInfo || {}
+    console.log(data)
+    for (let i = 0; i < data.length; i++) {
+      // 缁忕含搴� 浣嶇疆
+      const positionX = data[i].Latitude
+      const positionY = data[i].Longitude
+      // 瀹氫箟绫诲瀷 鐢ㄦ潵鍖哄垎鏁版嵁
+      const judgeValue = data[i].StorageQty
+      var iconUrl = this.differentTypes(judgeValue)
+
+      const marker = L.marker.magic([positionX, positionY], {
+        icon: L.icon({
+          iconUrl: iconUrl,
+          iconSize: [50, 50],
+          iconAnchor: [25, 25]
+        })
+      })
+      layer.addLayer(marker)
+      // layer.addLayer(L.marker([positionX, positionY], {}))
+    }
   }
 
   this.bindTooltip = (layer) => {
@@ -45,4 +48,14 @@
     console.log(e)
     this.animalService.pulseEffect(e.latlng)
   }
+  // 涓嶅悓绫诲瀷鍥剧墖灏佽
+  this.differentTypes = (judgeValue) => {
+    var effectOfChange
+    if (judgeValue === 1) {
+      effectOfChange = defaultImg
+    } else {
+      effectOfChange = setting
+    }
+    return effectOfChange
+  }
 }
diff --git a/src/utils/axios.js b/src/utils/axios.js
index d42baf4..8324abe 100644
--- a/src/utils/axios.js
+++ b/src/utils/axios.js
@@ -83,7 +83,7 @@
 
 // 鍒涘缓axios瀹炰緥
 const Service = axios.create({
-  timeout: 1000
+  timeout: 5000
 })
 
 const CancelToken = axios.CancelToken
diff --git a/src/views/MapTemplate.vue b/src/views/MapTemplate.vue
index dd708d9..1d74c4f 100644
--- a/src/views/MapTemplate.vue
+++ b/src/views/MapTemplate.vue
@@ -17,8 +17,8 @@
     <enterprise></enterprise>
     <!--    <el-button id="map-btn" el-icon-c-scale-to-original icon="el-icon-c-scale-to-original" circle @click="isShowHidden"></el-button>-->
     <!--    <el-button type="primary" @click="ChangeState" class="solid-waste">鍥哄簾</el-button>-->
-    <el-button type="primary" @click="ChangeWaterState" class="Waste-water">搴熸按</el-button>
-    <el-button type="primary" @click="AddGasHelper" class="flue-gas">搴熸皵</el-button>
+<!--    <el-button type="primary" @click="ChangeWaterState" class="Waste-water">搴熸按</el-button>-->
+<!--    <el-button type="primary" @click="AddGasHelper" class="flue-gas">搴熸皵</el-button>-->
     <PublicBounced ref="PublicBounced"></PublicBounced>
   </div>
 </template>
@@ -39,8 +39,8 @@
 import LegendPanel from '@components/panel/LegendPanel'
 import Enterprise from '../components/table/enterprise'
 // 搴曞浘涓氬姟js閫昏緫
-import AddWasteWaterHelper from '@components/BaseNav/WasteWater/WasteWater'
-import AddGasHelper from '@components/BaseNav/flueGas/flueGas'
+// import AddWasteWaterHelper from '@components/BaseNav/WasteWater/WasteWater'
+// import AddGasHelper from '@components/BaseNav/flueGas/flueGas'
 // // 鍏叡灞曠ず鏁版嵁
 import PublicBounced from '@components/BaseNav/PublicBounced/PublicBounced'
 import LayerFactory from '@components/LayerController/service/LayerFactory'
@@ -82,44 +82,6 @@
     })
   },
   methods: {
-    AddGasHelper () {
-      const data = {
-        companyId: 3900100145,
-        id: '',
-        monType: 2,
-        userCode: 'wenchun.deng',
-        monDuration: '',
-        epName: '',
-        secdDeptId: '',
-        contrLevel: '',
-        dataStatus: '',
-        dataFlag: '',
-        runStatus: '',
-        emissTypeId: ''
-      }
-      const AddGas = new AddGasHelper({ map: this.map })
-      AddGas.requestData(data)
-      AddGas.SetPlueGasContent(this.config, this.$refs.PublicBounced)
-    },
-    ChangeWaterState () {
-      const data = {
-        companyId: 3900100145,
-        id: '',
-        monType: 1,
-        userCode: 'wenchun.deng',
-        monDuration: '',
-        epName: '',
-        secdDeptId: '',
-        contrLevel: '',
-        dataStatus: '',
-        dataFlag: '',
-        runStatus: '',
-        emissTypeId: ''
-      }
-      const AddWasteWater = new AddWasteWaterHelper({ map: this.map })
-      AddWasteWater.requestData(data)
-      AddWasteWater.SetWasteWaterContent(this.config, this.$refs.PublicBounced)
-    },
     saveMapStatus () {
       window.serviceLayerHelper = this.serviceLayerHelper
       this.$store.commit('setMapObj', this.map)

--
Gitblit v1.8.0