From 5785717a5ff9ce8691544c9fe8d9493e1a9e746f Mon Sep 17 00:00:00 2001 From: zhangshuaibao <15731629597@163.com> Date: 星期三, 31 三月 2021 16:03:37 +0800 Subject: [PATCH] Merge branch 'develop' of http://xearth.cn:6600/r/wuyushui/SewerAndRainNetwork into develop --- src/conf/layers/LayerFsss.js | 79 +++++++++ public/assets/images/map/company.png | 0 src/conf/layers/LayerPipeLine.js | 77 +++++++++ src/conf/layers/LayerArea.js | 36 ++++ src/conf/layers/LayerPk.js | 26 +++ src/api/mapApi.js | 3 src/components/LayerController/logic/Company.js | 59 +++++++ src/components/LayerController/logic/Sample.js | 44 +++++ src/api/mapUrl.js | 2 src/components/LayerController/modules/LcServiceLayer.vue | 5 src/conf/layers/LayerHbss.js | 79 +++++++++ src/conf/Constants.js | 5 src/conf/MapConfig.js | 7 src/components/LayerController/logic/SolidWaste.js | 2 14 files changed, 413 insertions(+), 11 deletions(-) diff --git a/public/assets/images/map/company.png b/public/assets/images/map/company.png new file mode 100644 index 0000000..a48d213 --- /dev/null +++ b/public/assets/images/map/company.png Binary files differ diff --git a/src/api/mapApi.js b/src/api/mapApi.js index 9ed8266..cebf2b3 100644 --- a/src/api/mapApi.js +++ b/src/api/mapApi.js @@ -23,5 +23,8 @@ }, GetWasteGas (data) { return axios.get(mapUrl.GetWasteGas, data) + }, + getCompany (data) { + return axios.get(mapUrl.getCompany, data) } } diff --git a/src/api/mapUrl.js b/src/api/mapUrl.js index 9db2667..1b986df 100644 --- a/src/api/mapUrl.js +++ b/src/api/mapUrl.js @@ -12,3 +12,5 @@ export const getWasteWater = $HOST + '/wasteWater/getWasteWater' export const getSolidWasteBaseInfo = $HOST + '/wasteSolid/getSolidWasteBaseInfo' + +export const getCompany = $HOST + '/company/getCompany' diff --git a/src/components/LayerController/logic/Company.js b/src/components/LayerController/logic/Company.js new file mode 100644 index 0000000..f4ff3f0 --- /dev/null +++ b/src/components/LayerController/logic/Company.js @@ -0,0 +1,59 @@ +/** + * 鍥哄簾 + */ +// 鍖哄垎涓嶅悓绫诲瀷 浣跨敤涓嶅悓img +const companyImg = '/assets/images/map/company.png' + +const mapApi = require('../../../api/mapApi').default +const AnimalService = require('../service/AnimalService').default + +module.exports = function () { + /** + * 杩斿洖marker瀵硅薄鏁扮粍 + * @param L leaflet瀵硅薄 + */ + this.init = async (layer, L) => { + // const SolidWasteIcon = this.SolidWasteIcon() + this.animalService = new AnimalService({ + L: L, + layer: layer + }) + const res = await mapApi.getCompany() + console.log(res) + const data = res.Result.DataInfo || {} + for (let i = 0; i < data.length; i++) { + // 缁忕含搴� 浣嶇疆 + const positionX = data[i].Latitude + const positionY = data[i].Longitude + + var iconUrl = companyImg + const marker = L.marker.magic([positionX, positionY], { + icon: L.icon({ + iconUrl: iconUrl, + iconSize: [50, 50], + iconAnchor: [25, 25] + }) + }) + + layer.addLayer(marker) + } + } + + this.bindTooltip = (layer) => { + console.log(layer) + return '浼佷笟' + } + + this.clickListener = (layer) => { + /* this.animalService.pulseEffect(e.latlng) + console.log(e) + return this.PublicBounced.$el + */ + console.log(layer) + } + + // 鍥哄簾鐐瑰嚮杩涜鐨� 鍐呭鐨勮缃� + // SetSolidWasteContent (config, containerPopup) { + // this.SolidWastePopup = containerPopup + // } +} diff --git a/src/components/LayerController/logic/Sample.js b/src/components/LayerController/logic/Sample.js index 063123f..20fe78f 100644 --- a/src/components/LayerController/logic/Sample.js +++ b/src/components/LayerController/logic/Sample.js @@ -1,9 +1,45 @@ +/** + * 搴熸皵 + */ +const AnimalService = require('../service/AnimalService').default +const AjaxUtils = require('../../../utils/AjaxUtils').default + module.exports = function () { - this.init = (L) => { - console.log('sample init !!!') + /** + * 杩斿洖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) { + 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], { test: '122224' })) + } + }) } - this.clickListener = (e, data) => { - console.log('sample clickListener !!!') + this.bindTooltip = (layer) => { + return layer.options.test + } + + this.clickListener = (e) => { + this.animalService.pulseEffect(e.latlng) } } diff --git a/src/components/LayerController/logic/SolidWaste.js b/src/components/LayerController/logic/SolidWaste.js index fc55978..dd48fcc 100644 --- a/src/components/LayerController/logic/SolidWaste.js +++ b/src/components/LayerController/logic/SolidWaste.js @@ -60,6 +60,8 @@ const PublicBounced = window.Vue.extend(publicBounced) const instance = new PublicBounced() instance.setData(result, 'gufei') + instance.$mount() + document.body.appendChild(instance.$el) } // 涓嶅悓绫诲瀷鍥剧墖灏佽 diff --git a/src/components/LayerController/modules/LcServiceLayer.vue b/src/components/LayerController/modules/LcServiceLayer.vue index ab589f0..87ea4a7 100644 --- a/src/components/LayerController/modules/LcServiceLayer.vue +++ b/src/components/LayerController/modules/LcServiceLayer.vue @@ -6,7 +6,7 @@ <div class="wms-panel"> <div v-for="item in serviceLayers" :key="item.code" class="layerbox"> <div><input type="checkbox" :name="'wmsLayer_'+item.code" :checked="item.checked" :value="item.code" - @change="swAllLayers(item)"/>{{ item.name }} <span @click="swFilter(item)" + @change="swAllLayers(item)"/>{{ item.name }} <span @click="swFilter(item)" v-if="item.childLayer" class="btn-filter">杩囨护</span> </div> <div class="layerbox-item"> @@ -14,8 +14,7 @@ :name="'wmsSublayers_'+item.code+'_'+itm.code" :checked="itm.checked" :value="itm.code" - @change="swWmsLayer(itm)"/>{{ - itm.name }} + @change="swWmsLayer(itm)"/>{{ itm.name }} </div> </div> </div> diff --git a/src/conf/Constants.js b/src/conf/Constants.js index 5d3e5a3..92212b0 100644 --- a/src/conf/Constants.js +++ b/src/conf/Constants.js @@ -5,12 +5,13 @@ } export const logicMapper = { - fsqy: 'Sample.js', + // fsqy: 'Sample.js', fspfk: 'Sample.js', fsjcd: 'Sample.js', wasteGasJcd: 'WasteGas.js', wasteWaterJcd: 'WasteWater.js', - solidWasteJcd: 'SolidWaste.js' + solidWasteJcd: 'SolidWaste.js', + fsqy: 'Company.js' } export const props = { diff --git a/src/conf/MapConfig.js b/src/conf/MapConfig.js index d9dfc6d..ea8b7fb 100644 --- a/src/conf/MapConfig.js +++ b/src/conf/MapConfig.js @@ -1,9 +1,12 @@ 锘縤mport * as L from 'leaflet' import TDT from './TDT' -import { LayerSewersLine, LayerSewersPoint } from './layers/LayerSewers' +import { LayerSewersPoint } from './layers/LayerSewers' import { LayerWasteWater } from './layers/LayerWasteWater' import { LayerSolidWaste } from './layers/LayerSolidWaste' import { LayerWasteGas } from './layers/LayerWasteGas' +import { LayerPipeLine } from './layers/LayerPipeLine' +import { LayerArea } from './layers/LayerArea' +import { LayerPk } from './layers/LayerPk' const curWwwPath = window.document.location.href const pathname = window.document.location.pathname @@ -43,7 +46,7 @@ IntranetBaseMaps: TDT.intranet, InternetBaseMaps: TDT.internet, Layers: { - LayerSewersLine: [LayerSewersLine, LayerWasteWater, LayerWasteGas, LayerSolidWaste], + LayerSewersLine: [LayerPipeLine, LayerArea, LayerPk, LayerWasteWater, LayerWasteGas, LayerSolidWaste], layerSewersPoint: LayerSewersPoint } // 姹¢洦姘村浘灞傞厤缃� } diff --git a/src/conf/layers/LayerArea.js b/src/conf/layers/LayerArea.js new file mode 100644 index 0000000..b4dd2b9 --- /dev/null +++ b/src/conf/layers/LayerArea.js @@ -0,0 +1,36 @@ +/** + * 鍖哄煙 + */ +export const LayerArea = { + code: 'sewersArea', + name: '鍖哄煙淇℃伅', + checked: true, + layers: [ + { + code: 'sewersAreaGs', + name: '鍏徃', + sname: '鍏徃', // 琛ㄥ悕 + checked: true, // 榛樿閫変腑鐘舵�� + url: '?TYPENAME=绠$綉', + minZoom: 10, // 鍦ㄦ寚瀹氱骇鍒樉绀� + childLayer: 'fsss,hbss' // 鍏宠仈PointLayers + }, + { + code: 'sewersAreaMt', + name: '鐮佸ご', + sname: '鐮佸ご', + checked: true, // 榛樿閫変腑鐘舵�� + wfs: '?TYPENAME=鍚补姹℃按', + minZoom: 10, + childLayer: 'fsss,hbss' // 鍏宠仈PointLayers + }, + { + code: 'sewersAreaZz', + name: '瑁呯疆鍖�', + sname: '瑁呯疆鍖�', + checked: true, // 榛樿閫変腑鐘舵�� + wfs: '?TYPENAME=鍚洂姹℃按', + minZoom: 10 + } + ] +} diff --git a/src/conf/layers/LayerFsss.js b/src/conf/layers/LayerFsss.js new file mode 100644 index 0000000..ce4269c --- /dev/null +++ b/src/conf/layers/LayerFsss.js @@ -0,0 +1,79 @@ +/** + * 鍖哄煙 + */ +const APP_GIS_HOST_2 = 'http://xearth.cn:8088' +const WFS_URL = APP_GIS_HOST_2 + '/server/ogcserver/PipeLine/wfs' +export const LayerFsss = { + code: 'sewersFsss', + name: '闄勫睘璁炬柦', + checked: false, // 榛樿閫変腑鐘舵�� + layers: [ + { + code: 'fourlink', + name: '鍥涢��', + sname: '鍥涢��', + checked: true, + minZoom: 10, + wfs: WFS_URL + '?TYPENAME=鍥涢��', + icon: 'sewers/鍥涢��.png' + }, + { + code: 'tee', + name: '涓夐��', + sname: '涓夐��', + checked: false, + minZoom: 10, + wfs: WFS_URL + '?TYPENAME=涓夐��', + icon: 'sewers/涓夐��.png' + }, + { + code: 'piperack', + name: '绠℃灦(澧�)', + sname: 'PipeRack', + minZoom: 10, + wfs: WFS_URL + '?TYPENAME=绠℃灦', + checked: false + }, + { + code: 'pipegallery', + name: '绠″粖(甯�)', + sname: 'PipeGallery', + minZoom: 10, + wfs: WFS_URL + '?TYPENAME=绠″粖', + checked: false + }, + { + code: 'pipesegment', + name: '娴佸悜', + sname: 'ywslx', + wfs: WFS_URL + '?TYPENAME=娴佸悜', + checked: false + }, + { + code: 'pipeline', + name: '绠$綉', + minZoom: 10, + sname: 'pipeline', + wfs: WFS_URL + '?TYPENAME=绠$綉', + checked: false + }, + { + code: 'valve', + name: '闃�闂�', + minZoom: 10, + sname: 'valve', + checked: false, + wfs: WFS_URL + '?TYPENAME=闃�闂�', + icon: 'sewers/闃�闂�.png' + }, + { + code: 'elbow', + name: '寮ご', + sname: 'Elbow', + minZoom: 10, + checked: false, + wfs: WFS_URL + '?TYPENAME=寮ご', + icon: 'sewers/寮ご.png' + } + ] +} diff --git a/src/conf/layers/LayerHbss.js b/src/conf/layers/LayerHbss.js new file mode 100644 index 0000000..c77b633 --- /dev/null +++ b/src/conf/layers/LayerHbss.js @@ -0,0 +1,79 @@ +/** + * 鍖哄煙 + */ +const APP_GIS_HOST_2 = 'http://xearth.cn:8088' +const WFS_URL = APP_GIS_HOST_2 + '/server/ogcserver/PipeLine/wfs' +export const LayerFsss = { + code: 'sewersFsss', + name: '鐜繚璁炬柦', + checked: false, // 榛樿閫変腑鐘舵�� + layers: [ + { + code: 'fourlink', + name: '鍥涢��', + sname: '鍥涢��', + checked: true, + minZoom: 10, + wfs: WFS_URL + '?TYPENAME=鍥涢��', + icon: 'sewers/鍥涢��.png' + }, + { + code: 'tee', + name: '涓夐��', + sname: '涓夐��', + checked: false, + minZoom: 10, + wfs: WFS_URL + '?TYPENAME=涓夐��', + icon: 'sewers/涓夐��.png' + }, + { + code: 'piperack', + name: '绠℃灦(澧�)', + sname: 'PipeRack', + minZoom: 10, + wfs: WFS_URL + '?TYPENAME=绠℃灦', + checked: false + }, + { + code: 'pipegallery', + name: '绠″粖(甯�)', + sname: 'PipeGallery', + minZoom: 10, + wfs: WFS_URL + '?TYPENAME=绠″粖', + checked: false + }, + { + code: 'pipesegment', + name: '娴佸悜', + sname: 'ywslx', + wfs: WFS_URL + '?TYPENAME=娴佸悜', + checked: false + }, + { + code: 'pipeline', + name: '绠$綉', + minZoom: 10, + sname: 'pipeline', + wfs: WFS_URL + '?TYPENAME=绠$綉', + checked: false + }, + { + code: 'valve', + name: '闃�闂�', + minZoom: 10, + sname: 'valve', + checked: false, + wfs: WFS_URL + '?TYPENAME=闃�闂�', + icon: 'sewers/闃�闂�.png' + }, + { + code: 'elbow', + name: '寮ご', + sname: 'Elbow', + minZoom: 10, + checked: false, + wfs: WFS_URL + '?TYPENAME=寮ご', + icon: 'sewers/寮ご.png' + } + ] +} diff --git a/src/conf/layers/LayerPipeLine.js b/src/conf/layers/LayerPipeLine.js new file mode 100644 index 0000000..c90a7f4 --- /dev/null +++ b/src/conf/layers/LayerPipeLine.js @@ -0,0 +1,77 @@ +/** + * 绠$綉 + */ +const APP_GIS_HOST_2 = 'http://xearth.cn:8088' +const WFS_URL = APP_GIS_HOST_2 + '/server/ogcserver/PipeLine/wfs' + +export const LayerPipeLine = { + code: 'sewersPipeLine', + name: '绠$嚎', + checked: true, + layers: [ + { + code: 'rainline', + name: '闆ㄦ按绾�', + sname: '闆ㄦ按绾�', + checked: true, + wfs: WFS_URL + '?TYPENAME=绠$綉', + minZoom: 10 // 鍦ㄦ寚瀹氱骇鍒樉绀� + }, + { + code: 'accidentline', + name: '浜嬫晠姘寸嚎', + sname: '浜嬫晠姘�', + checked: true, // 榛樿閫変腑鐘舵�� + wfs: WFS_URL + '?TYPENAME=浜嬫晠姘�', + minZoom: 10 + }, + { + code: 'oilline', + name: '鍚补姹℃按绾�', + sname: '鍚补姹℃按', + checked: true, // 榛樿閫変腑鐘舵�� + wfs: WFS_URL + '?TYPENAME=鍚补姹℃按', + minZoom: 10 + }, + { + code: 'saltline', + name: '鍚洂姹℃按绾�', + sname: '鍚洂姹℃按', + checked: true, // 榛樿閫変腑鐘舵�� + wfs: WFS_URL + '?TYPENAME=鍚洂姹℃按', + minZoom: 10 + }, + { + code: 'alkaliline', + name: '鍚⒈姹℃按绾�', + sname: '鍚⒈姹℃按', + checked: true, // 榛樿閫変腑鐘舵�� + wfs: WFS_URL + '?TYPENAME=鍚⒈姹℃按', + minZoom: 10 + }, + { + code: 'lifeline', + name: '鐢熸椿姹℃按', + sname: '鐢熸椿姹℃按', + checked: true, // 榛樿閫変腑鐘舵�� + wfs: WFS_URL + '?TYPENAME=鐢熸椿姹℃按', + minZoom: 10 + }, + { + code: 'purifyline', + name: '鍑�鍖栨按绾�', + sname: '鍑�鍖栨按', + checked: true, // 榛樿閫変腑鐘舵�� + wfs: WFS_URL + '?TYPENAME=鍑�鍖栨按', + minZoom: 10 + }, + { + code: 'loopline', + name: '寰幆姘寸嚎', + sname: '寰幆姘�', + checked: true, // 榛樿閫変腑鐘舵�� + wfs: WFS_URL + '?TYPENAME=寰幆姘�', + minZoom: 10 + } + ] +} diff --git a/src/conf/layers/LayerPk.js b/src/conf/layers/LayerPk.js new file mode 100644 index 0000000..ab13cdf --- /dev/null +++ b/src/conf/layers/LayerPk.js @@ -0,0 +1,26 @@ +/** + * 鎺掑彛 + */ +export const LayerPk = { + code: 'sewersPk', + name: '鎺掑彛', + checked: true, + layers: [ + { + code: 'sewersNpk', + name: '鍐呮帓鍙�', + sname: '鍐呮帓鍙�', + checked: true, + wfs: '?TYPENAME=绠$綉', + minZoom: 10 // 鍦ㄦ寚瀹氱骇鍒樉绀� + }, + { + code: 'sewersWpk', + name: '澶栨帓鍙�', + sname: '澶栨帓鍙�', + checked: true, // 榛樿閫変腑鐘舵�� + wfs: '?TYPENAME=浜嬫晠姘�', + minZoom: 10 + } + ] +} -- Gitblit v1.8.0