派生自 wuyushui/SewerAndRainNetwork

wangqi
2021-03-31 24d2724aaf2f8331fc179c87595eb9a4720cf8a9
修改文件接口路徑
6个文件已修改
8 文件已重命名
121 ■■■■■ 已修改文件
public/assets/images/map/exhaust/fq_blue.png 补丁 | 查看 | 原始文档 | blame | 历史
public/assets/images/map/exhaust/fq_bright_green.png 补丁 | 查看 | 原始文档 | blame | 历史
public/assets/images/map/exhaust/fq_gray.png 补丁 | 查看 | 原始文档 | blame | 历史
public/assets/images/map/exhaust/fq_green.png 补丁 | 查看 | 原始文档 | blame | 历史
public/assets/images/map/exhaust/fq_green_xc.png 补丁 | 查看 | 原始文档 | blame | 历史
public/assets/images/map/exhaust/fq_orange.png 补丁 | 查看 | 原始文档 | blame | 历史
public/assets/images/map/exhaust/fq_red.png 补丁 | 查看 | 原始文档 | blame | 历史
public/assets/images/map/exhaust/fq_yellow.png 补丁 | 查看 | 原始文档 | blame | 历史
src/api/mapApi.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/mapUrl.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/LayerController/logic/SolidWaste.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/LayerController/logic/WasteGas.js 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/axios.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/MapTemplate.vue 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/assets/images/map/exhaust/fq_blue.png

public/assets/images/map/exhaust/fq_bright_green.png

public/assets/images/map/exhaust/fq_gray.png

public/assets/images/map/exhaust/fq_green.png

public/assets/images/map/exhaust/fq_green_xc.png

public/assets/images/map/exhaust/fq_orange.png

public/assets/images/map/exhaust/fq_red.png

public/assets/images/map/exhaust/fq_yellow.png

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)
  // }
}
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'
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)
    }
  }
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
  }
}
src/utils/axios.js
@@ -83,7 +83,7 @@
// 创建axios实例
const Service = axios.create({
  timeout: 1000
  timeout: 5000
})
const CancelToken = axios.CancelToken
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)