派生自 wuyushui/SewerAndRainNetwork

陈泽平
2021-05-30 bfd90be7b80fa5391681530c62e3761742879fcf
Merge branch 'develop' of http://xearth.cn:6600/r/wuyushui/SewerAndRainNetwork into develop
1个文件已删除
4个文件已添加
3个文件已修改
170 ■■■■ 已修改文件
dist.zip 补丁 | 查看 | 原始文档 | blame | 历史
public/assets/governEquipment.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/assets/images/map/governEquipment/govern_green.png 补丁 | 查看 | 原始文档 | blame | 历史
src/api/mapApi.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/LayerController/logic/GovernEquipment.js 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/LayerController/logic/SourcesPollution.js 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/conf/Constants.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/conf/layers/LayerEnvRisk.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dist.zip
Binary files differ
public/assets/governEquipment.json
New file
@@ -0,0 +1,22 @@
[
  {
    "no": 0,
    "company": "扬子石化",
    "plate": "炼油板块",
    "unitName": "芳烃厂、炼油厂",
    "governName": "硫磺回收治理设施",
    "Longitude": 118.7936111111,
    "Latitude": 32.2583305556,
    "status": 1
  },
  {
    "no": 1,
    "company": "中韩石化",
    "plate": "炼油板块",
    "unitName": "炼油二部",
    "governName": "催化裂化治理设施",
    "Longitude": 114.44016,
    "Latitude": 30.65305,
    "status": 1
  }
]
public/assets/images/map/governEquipment/govern_green.png
src/api/mapApi.js
@@ -90,6 +90,9 @@
  getSourcesPoll (data) {
    return axios.get(mapUrl.getSourcesPoll, data)
  },
  getGovernEquipment (data) {
    return axios.get('/assets/governEquipment.json', data)
  },
  getEnvironmentRisk (data) {
    return axios.get('/assets/environmentRisk.json', data)
  },
src/components/LayerController/logic/GovernEquipment.js
New file
@@ -0,0 +1,93 @@
/**
 * 污染源
 */
// 信息组件
const GovernEquipmentIndex = require('../../base-page/RiskSource/RiskSourceIndex.vue').default
// 使用封装方法
const AnimalService = require('../service/AnimalService').default
// 请求接口数据
const mapApi = require('../../../api/mapApi').default
// 公共方法 panTo() 引用
const { setPanTo } = require('../../../utils/utils')
const governGreen = '/assets/images/map/governEquipment/govern_green.png'
module.exports = function () {
  /**
   * 初始化并加载图层
   * @param L leaflet对象
   */
  this.init = async (layer, L) => {
    this.animalService = new AnimalService({
      L: L,
      layer: layer
    })
    const data = await mapApi.getGovernEquipment()
    for (let i = 0; i < data.length; i++) {
      const postion = [data[i].Latitude, data[i].Longitude] // 坐标
      const iconUrl = this.governIconUrl(data[i].status) // 治理设施图标
      const marker = L.marker(postion, {
        totransferData: data[i],
        icon: L.icon({
          iconUrl: iconUrl,
          iconSize: [30, 30],
          iconAnchor: [15, 15]
        })
      })
      layer.addLayer(marker)
    }
  }
  /**
   * 提示窗
   * @param layer
   * @returns {string}
   */
  this.bindTooltip = (layer) => {
    return layer.options.totransferData.governName
  }
  /**
   * 信息弹窗
   * @param e
   */
  this.clickListener = (e) => {
    // 脉冲效果
    this.animalService.pulseEffect(e.latlng)
    // 信息弹窗平移
    setPanTo(e.latlng, 200)
    // 弹框标题
    const title = e.layer.options.totransferData.Name
    window.$layer.open({
      content: {
        comp: GovernEquipmentIndex, // 组件
        parent: this, // 父组件
        data: { // 传递的参数
          riskSourceId: e.layer.options.totransferData.no
        }
      },
      title: title // 标题
    })
  }
  /**
   * 治理设施图标配置
   * @param t
   * @returns {string}
   */
  this.governIconUrl = (t) => {
    let iconUrl = null
    switch (t) {
      case 1:
        iconUrl = governGreen
        break
      case 2:
        iconUrl = ''
        break
      default:
        iconUrl = ''
        break
    }
    return iconUrl
  }
}
src/components/LayerController/logic/SourcesPollution.js
File was deleted
src/conf/Constants.js
@@ -17,12 +17,12 @@
}
export const logicMapper = {
  wasteGasPfk: 'WasteGas.js',
  wasteWaterPfk: 'WasteWater.js',
  wasteSolidCcd: 'WasteSolid.js',
  wasteGasPfk: 'WasteGas.js', // 废气
  wasteWaterPfk: 'WasteWater.js', // 废水
  wasteSolidCcd: 'WasteSolid.js', // 固废
  sewersAreaGs: 'Company.js',
  pipesegment: 'PipeLineAnimal.js',
  pollutionSources: 'SourcesPollution.js',
  pollutionSourcesZlss: 'GovernEquipment.js', // 污染源-治理设施
  envRiskChart: 'EnvironmentRisk.js', // 风险统计图
  envRiskMajor: 'RiskSource.js', // 重大风险源
  envRiskFirst: 'RiskSource.js', // 一级风险源
src/conf/layers/LayerEnvRisk.js
@@ -26,7 +26,7 @@
      name: '重大风险',
      sname: '重大风险',
      checked: false, // 默认选中状态
      minZoom: 10,
      // minZoom: 10,
      color: 'red',
      level: 0
    },
@@ -36,7 +36,7 @@
      sname: '一级风险',
      checked: false, // 默认选中状态
      type: 0,
      minZoom: 10,
      // minZoom: 10,
      color: 'sandybrown',
      level: 1
    },
@@ -46,7 +46,7 @@
      sname: '二级风险',
      checked: false,
      type: 0,
      minZoom: 10,
      // minZoom: 10,
      color: 'yellow',
      level: 2
    },
@@ -56,7 +56,7 @@
      sname: '三级风险',
      checked: false,
      type: 0,
      minZoom: 10,
      // minZoom: 10,
      color: 'green',
      level: 3
    }