From da2ff97717da1482d9a998074e9f1653f4de3178 Mon Sep 17 00:00:00 2001 From: zhangshuaibao <15731629597@163.com> Date: 星期三, 31 三月 2021 11:19:12 +0800 Subject: [PATCH] 从新设置数据请求方式 --- src/conf/layers/LayerWasteWater.js | 4 +- src/conf/Constants.js | 3 + src/api/mapApi.js | 4 ++ src/components/LayerController/logic/WasteWater.js | 49 ++++++++++++++++++++++++ src/views/MapTemplate.vue | 42 ++++++++++---------- src/api/mapUrl.js | 2 + 6 files changed, 80 insertions(+), 24 deletions(-) diff --git a/src/api/mapApi.js b/src/api/mapApi.js index 7376708..46ef340 100644 --- a/src/api/mapApi.js +++ b/src/api/mapApi.js @@ -4,11 +4,15 @@ // 娴嬭瘯鐜IP锛歨ttp://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) } } diff --git a/src/api/mapUrl.js b/src/api/mapUrl.js index f5f7815..131d7a2 100644 --- a/src/api/mapUrl.js +++ b/src/api/mapUrl.js @@ -4,3 +4,5 @@ import { $HOST } from './host' export const GetUser = $HOST + '/user/getUser' + +export const GetWasteWater = $HOST + '/wasteWater/getWasteWater' diff --git a/src/components/LayerController/logic/WasteWater.js b/src/components/LayerController/logic/WasteWater.js new file mode 100644 index 0000000..b862b44 --- /dev/null +++ b/src/components/LayerController/logic/WasteWater.js @@ -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) + } +} diff --git a/src/conf/Constants.js b/src/conf/Constants.js index 97a3af7..e5a51f1 100644 --- a/src/conf/Constants.js +++ b/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 = { diff --git a/src/conf/layers/LayerWasteWater.js b/src/conf/layers/LayerWasteWater.js index 3f1ff32..f1d71de 100644 --- a/src/conf/layers/LayerWasteWater.js +++ b/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, // 榛樿閫変腑鐘舵�� diff --git a/src/views/MapTemplate.vue b/src/views/MapTemplate.vue index 0809498..ea2a854 100644 --- a/src/views/MapTemplate.vue +++ b/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) -- Gitblit v1.8.0