派生自 wuyushui/SewerAndRainNetwork

zhangshuaibao
2021-03-31 da2ff97717da1482d9a998074e9f1653f4de3178
从新设置数据请求方式
1个文件已添加
5个文件已修改
104 ■■■■ 已修改文件
src/api/mapApi.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/mapUrl.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/LayerController/logic/WasteWater.js 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/conf/Constants.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/conf/layers/LayerWasteWater.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/MapTemplate.vue 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/mapApi.js
@@ -4,11 +4,15 @@
// 测试环境IP:http://10.238.221.113
import axios from '@utils/axios'
import * as mapUrl from './mapUrl'
/**
 * 该方法配置
 */
export default {
  getUser (data) {
    return axios.get(mapUrl.GetUser, data)
  },
  getWasteWater (data) {
    return axios.get(mapUrl.GetWasteWater, data)
  }
}
src/api/mapUrl.js
@@ -4,3 +4,5 @@
import { $HOST } from './host'
export const GetUser = $HOST + '/user/getUser'
export const GetWasteWater = $HOST + '/wasteWater/getWasteWater'
src/components/LayerController/logic/WasteWater.js
New file
@@ -0,0 +1,49 @@
/**
 * 废水
 */
const AnimalService = require('../service/AnimalService').default
const AjaxUtils = require('../../../utils/AjaxUtils').default
// const getWasteWater = require('../../../utils/axios').default
module.exports = function () {
  /**
   * 返回marker对象数组
   * @param L leaflet对象
   */
  this.init = (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) {
      console.log(res)
      const data = res.data.Result.DataInfo
      for (let i = 0; i < data.length; i++) {
        // 经纬度 位置
        const positionX = data[i].Latitude
        const positionY = data[i].Longitude
        layer.addLayer(L.marker([positionX, positionY], {}))
      }
    })
  }
  this.bindTooltip = (layer) => {
    return 'aaaa'
  }
  this.clickListener = (e) => {
    console.log(e)
    this.animalService.pulseEffect(e.latlng)
  }
}
src/conf/Constants.js
@@ -8,7 +8,8 @@
  fsqy: 'Sample.js',
  fspfk: 'Sample.js',
  fsjcd: 'Sample.js',
  wasteGasJcd: 'WasteGas.js'
  wasteGasJcd: 'WasteGas.js',
  wasteWaterJcd: 'WasteWater.js'
}
export const props = {
src/conf/layers/LayerWasteWater.js
@@ -3,7 +3,7 @@
 * @type {string}
 */
export const LayerWasteWater = {
  code: 'pipeline',
  code: 'wasteWater',
  name: '废水',
  checked: true,
  layers: [
@@ -16,7 +16,7 @@
      minZoom: 10 // 在指定级别显示
    },
    {
      code: 'fsjcd',
      code: 'wasteWaterJcd',
      name: '监测点',
      sname: '监测点',
      checked: true, // 默认选中状态
src/views/MapTemplate.vue
@@ -17,7 +17,7 @@
    <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="ChangeWaterState" class="Waste-water">废水</el-button>-->
    <el-button type="primary" @click="AddGasHelper" class="flue-gas">废气</el-button>
    <PublicBounced ref="PublicBounced"></PublicBounced>
  </div>
@@ -40,7 +40,7 @@
import Enterprise from '../components/table/enterprise'
// 底图业务js逻辑
import AddSolidWasteHelper from '@components/BaseNav/SolidWaste/SolidWaste'
import AddWasteWaterHelper from '@components/BaseNav/WasteWater/WasteWater'
// import AddWasteWaterHelper from '@components/BaseNav/WasteWater/WasteWater'
import AddGasHelper from '@components/BaseNav/flueGas/flueGas'
// // 公共展示数据
import PublicBounced from '@components/BaseNav/PublicBounced/PublicBounced'
@@ -114,25 +114,25 @@
      AddSolidWaste.requestData(data)
      AddSolidWaste.SetSolidWasteContent(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)
    },
    // 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)