From 0f48a555610e595eca25c73a74dff6bd49897eec Mon Sep 17 00:00:00 2001 From: zhangshuaibao <15731629597@163.com> Date: 星期三, 31 三月 2021 15:49:22 +0800 Subject: [PATCH] Merge branch 'develop' of http://xearth.cn:6600/r/wuyushui/SewerAndRainNetwork into develop --- src/components/BaseNav/SolidWaste/SolidWaste.js | 15 ++--- src/api/request.js | 9 -- src/conf/MapConfig.js | 4 src/api/mapApi.js | 3 + src/views/MapTemplate.vue | 59 +++++++++++++++++++ src/api/mapUrl.js | 2 src/components/BaseNav/PublicBounced/PublicBounced.vue | 25 +++++-- src/components/LayerController/logic/SolidWaste.js | 41 ++++++++----- 8 files changed, 112 insertions(+), 46 deletions(-) diff --git a/src/api/mapApi.js b/src/api/mapApi.js index 95c9f42..9ed8266 100644 --- a/src/api/mapApi.js +++ b/src/api/mapApi.js @@ -18,6 +18,9 @@ getWasteWater (data) { return axios.get(mapUrl.getWasteWater, data) }, + getSolidWasteBaseInfo (data) { + return axios.get(mapUrl.getSolidWasteBaseInfo, data) + }, GetWasteGas (data) { return axios.get(mapUrl.GetWasteGas, data) } diff --git a/src/api/mapUrl.js b/src/api/mapUrl.js index 8b9b168..9db2667 100644 --- a/src/api/mapUrl.js +++ b/src/api/mapUrl.js @@ -10,3 +10,5 @@ export const getSolidWaste = $HOST + '/wasteSolid/getSolidWaste' export const getWasteWater = $HOST + '/wasteWater/getWasteWater' + +export const getSolidWasteBaseInfo = $HOST + '/wasteSolid/getSolidWasteBaseInfo' diff --git a/src/api/request.js b/src/api/request.js index bceceb3..5db8fa9 100644 --- a/src/api/request.js +++ b/src/api/request.js @@ -2,19 +2,12 @@ import Qs from 'qs' export const QueryStoragePlaceListByCompanyAndName = (data = {}) => { - return $http.post('/EPInterface/DataService/EPMapService.asmx/QueryStoragePlaceListByCompanyAndName', Qs.stringify(data), { + return $http.post('http://10.246.162.140:8080/EPInterface/DataService/EPMapService.asmx/QueryStoragePlaceListByCompanyAndName', Qs.stringify(data), { headers: { 'Content-Type': 'application/json' } }) } -// export const QueryStoragePlaceListByCompanyAndName = (data = {}) => { -// return $http.get('http://xearth.cn:3000/wasteSolid/getSolidWaste', Qs.stringify(data), { -// headers: { -// 'Content-Type': 'application/json' -// } -// }) -// } export const FlueGas = (data = {}) => { return $http.post('/EPInterface/DataService/EPMapService.asmx/ObtainningConInfo', Qs.stringify(data), { headers: { diff --git a/src/components/BaseNav/PublicBounced/PublicBounced.vue b/src/components/BaseNav/PublicBounced/PublicBounced.vue index 8756e92..ff6bfb2 100644 --- a/src/components/BaseNav/PublicBounced/PublicBounced.vue +++ b/src/components/BaseNav/PublicBounced/PublicBounced.vue @@ -1,5 +1,5 @@ <template> - <div class="public-bounced" v-draw v-show="flag"> + <div class="public-bounced" v-if="flag"> <div class="public-bounced-title"> <span>{{ displayContent.Name }}</span> <i class="el-icon-circle-close" @click="closePopup"></i> @@ -7,9 +7,10 @@ <div class="public-bounced-content"> <div class="public-bounced-content-left"> <GasTab :displayContent="displayContent"></GasTab> - <!-- <PublicTable v-if="value === 'gufei'" :requestSolidWasteData="displayContent.StoragePlaceId"></PublicTable>--> - <PublicTable></PublicTable> - <!-- <GasECharts v-else></GasECharts>--> + <PublicTable v-if="value === 'gufei'" :requestSolidWasteData="displayContent.StoragePlaceId"></PublicTable> + <GasECharts v-else></GasECharts> + <!-- <PublicTable></PublicTable>--> + <!-- <GasECharts></GasECharts>--> </div> <div class="public-bounced-content-right"> <GasVideo></GasVideo> @@ -23,7 +24,7 @@ import '@/components/BaseNav/SolidWaste/directive/dir' import GasTab from '@components/BaseNav/PublicBounced/GasComponents/GasTab' import PublicTable from '@components/BaseNav/PublicBounced/GasComponents/PublicTable' -// import GasECharts from '@components/BaseNav/PublicBounced/GasComponents/GasECharts' +import GasECharts from '@components/BaseNav/PublicBounced/GasComponents/GasECharts' import GasVideo from '@components/BaseNav/PublicBounced/GasComponents/GasVideo' export default { @@ -31,7 +32,7 @@ components: { GasTab, PublicTable, - // GasECharts, + GasECharts, GasVideo }, data () { @@ -41,11 +42,19 @@ } }, methods: { - setData (data) { + setData (data, value) { + console.log(data) + console.log(value) this.displayContent = data this.flag = true - // this.value = value + this.value = value + console.log(this.flag) }, + // setData (data) { + // this.displayContent = data + // this.flag = true + // // this.value = value + // }, closePopup () { this.flag = false } diff --git a/src/components/BaseNav/SolidWaste/SolidWaste.js b/src/components/BaseNav/SolidWaste/SolidWaste.js index 7cedfa6..8babe45 100644 --- a/src/components/BaseNav/SolidWaste/SolidWaste.js +++ b/src/components/BaseNav/SolidWaste/SolidWaste.js @@ -1,7 +1,8 @@ import { QueryStoragePlaceListByCompanyAndName } from '@/api/request' // 灞曠ず鍥剧墖 -import defaultImg from '@assets/images/map-pages/basenav/solidwaste/voc.png' -import Setting from '@assets/images/map-pages/basenav/solidwaste/gf_green.png' + +import defaultImg from '../../../../public/assets/images/map/solidwaste/voc.png' +import setting from '../../../../public/assets/images/map/solidwaste/gf_green.png' // 搴曞浘涓氬姟灞曠ず鐐� class AddSolidWasteHelper { @@ -63,13 +64,9 @@ marker.on('click', (e) => { try { // console.log(e) - // console.log(this.map.getCenter()) - // console.log(this.map.setCenter([e.target.getLatLng().lat, e.target.getLatLng().lng])) - // this.map.flyTo([e.target.getLatLng().lat, e.target.getLatLng().lng]) - // this.map.panTo([e.target.getLatLng().lat, e.target.getLatLng().lng], 100) - this.setPanTo(e.target.getLatLng(), 250) + this.setPanTo(e.target.getLatLng(), 200) this.EffectOfPulse(e.target.getLatLng()) - // this.SolidWastePopup.setData(data[i], 'gufei') + this.SolidWastePopup.setData(data[i], 'gufei') return this.SolidWastePopup.$el } catch (error) { console.log(error) @@ -114,7 +111,7 @@ EffectOfChange = defaultImg this.EffectOfPulse(position, this.solidWasteMarkersLabels, this.SolidWasteLayerGroup) } else { - EffectOfChange = Setting + EffectOfChange = setting } return EffectOfChange } diff --git a/src/components/LayerController/logic/SolidWaste.js b/src/components/LayerController/logic/SolidWaste.js index 7211b05..fc55978 100644 --- a/src/components/LayerController/logic/SolidWaste.js +++ b/src/components/LayerController/logic/SolidWaste.js @@ -5,8 +5,12 @@ const defaultImg = '/assets/images/map/solidwaste/voc.png' const setting = '/assets/images/map/solidwaste/gf_green.png' +// 璇锋眰鎺ュ彛鏁版嵁 const mapApi = require('../../../api/mapApi').default +// 浣跨敤灏佽鏂规硶 const AnimalService = require('../service/AnimalService').default + +const publicBounced = require('../../BaseNav/PublicBounced/PublicBounced').default module.exports = function () { /** @@ -18,19 +22,20 @@ L: L, layer: layer }) - const res = await mapApi.getSolidWaste() - console.log(res) - const data = res.Result.DataInfo || {} - for (let i = 0; i < data.length; i++) { + const result = await mapApi.getSolidWaste() + const getSolidWasteData = result.Result.DataInfo || {} + // 寰幆閬嶅巻鏁版嵁 鏍规嵁杩涜marker 鐨勫垱寤� + for (let i = 0; i < getSolidWasteData.length; i++) { // 缁忕含搴� 浣嶇疆 - const positionX = data[i].Latitude - const positionY = data[i].Longitude + const positionX = getSolidWasteData[i].Latitude + const positionY = getSolidWasteData[i].Longitude - // 瀹氫箟绫诲瀷 鐢ㄦ潵鍖哄垎鏁版嵁鐨勪笉鍚� - const judgeValue = data[i].StorageQty + // 瀹氫箟绫诲瀷 鐢ㄦ潵鍖哄垎鏁版嵁鐨勪笉鍚� 1.鎺ュ彛鎺ュ彛鏁版嵁鏉ヨ繘琛屾暟鎹殑鍒ゆ柇 2.鏍规嵁鏁版嵁绫诲瀷鐨勪笉鍚岋紝杩涜涓嶅悓绫诲瀷鐨勫浘鐗囨樉绀� + const judgeValue = getSolidWasteData[i].StorageQty var iconUrl = this.differentTypes(judgeValue) - const marker = L.marker.magic([positionX, positionY], { + const marker = L.marker([positionX, positionY], { + test: getSolidWasteData[i], icon: L.icon({ iconUrl: iconUrl, iconSize: [50, 50], @@ -42,13 +47,19 @@ } this.bindTooltip = (layer) => { - return '娴嬭瘯鍥哄簾' + return layer.options.test.Name } - this.clickListener = (e) => { + this.clickListener = async (e) => { this.animalService.pulseEffect(e.latlng) - console.log(e) - return this.PublicBounced.$el + const dataValue = { + StoragePlaceId: e.layer.options.test.StoragePlaceId + } + const result = await mapApi.getSolidWasteBaseInfo(dataValue) + // console.log(result) + const PublicBounced = window.Vue.extend(publicBounced) + const instance = new PublicBounced() + instance.setData(result, 'gufei') } // 涓嶅悓绫诲瀷鍥剧墖灏佽 @@ -61,8 +72,4 @@ } return effectOfChange } - // 鍥哄簾鐐瑰嚮杩涜鐨� 鍐呭鐨勮缃� - // SetSolidWasteContent (config, containerPopup) { - // this.SolidWastePopup = containerPopup - // } } diff --git a/src/conf/MapConfig.js b/src/conf/MapConfig.js index d1ece05..d9dfc6d 100644 --- a/src/conf/MapConfig.js +++ b/src/conf/MapConfig.js @@ -25,8 +25,8 @@ minZoom: 3, maxZoom: 18, // center: [26, 104], - // center: [38.828558921813965, 117.41676807403564], - center: [29.769515991210938, 107.03567504882812], + center: [38.828558921813965, 117.41676807403564], + // center: [29.454345703125, 113.40362548828125], zoom: 14, worldCopyJump: true, inertia: true, diff --git a/src/views/MapTemplate.vue b/src/views/MapTemplate.vue index 08c1765..e3e491d 100644 --- a/src/views/MapTemplate.vue +++ b/src/views/MapTemplate.vue @@ -39,8 +39,9 @@ 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 AddSolidWasteHelper from '@components/BaseNav/SolidWaste/SolidWaste' +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' @@ -81,6 +82,56 @@ }) }, methods: { + ChangeState () { + const data = { + companyId: 3900100145, + userCode: 'wenchun.deng', + name: '', + marginWarr: '', + longDayWarr: '' + } + const AddSolidWaste = new AddSolidWasteHelper({ map: this.map }) + AddSolidWaste.requestData(data) + AddSolidWaste.SetSolidWasteContent(this.config, this.$refs.PublicBounced) + }, + 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) @@ -113,6 +164,10 @@ this.vectorLayerHelper = Sgis.initVectorLayersHelper(this.map) // 鍒濆鍖栧姩鎬佽绱犲浘灞傚姪鎵� this.vectorLayerHelper.initVectorLayers(this.config) + this.ChangeState() + // this.AddGasHelper() + // this.ChangeWaterState() + this.saveMapStatus() // this.setMapObj(this.mapObj) // this.setBasemapHelper(this.basemapHelper) -- Gitblit v1.8.0