From be771111fb2a9770a9fbf13c5d7e976bf8688b6d Mon Sep 17 00:00:00 2001 From: 陈泽平 <chenzeping> Date: 星期二, 18 五月 2021 11:08:38 +0800 Subject: [PATCH] 问题修改 --- public/assets/images/map/sewers/生产污水.png | 0 public/assets/images/map/sewers/含油污水.png | 0 /dev/null | 45 ----------- src/components/LayerController/logic/WasteGas.js | 8 - src/components/panel/topicSearch/EnterpriseEmergency/ResourcesQuery.vue | 11 ++ src/components/panel/topicSearch/WaterWasteSearch.vue | 2 src/components/panel/topicSearch/GasWasteSearch.vue | 2 src/components/LayerController/logic/WasteWater.js | 2 src/components/LayerController/logic/WasteSolid.js | 4 src/components/panel/topicSearch/SolidWasteSearch.vue | 127 ++++++++++--------------------- 10 files changed, 55 insertions(+), 146 deletions(-) diff --git "a/public/assets/images/map/sewers/\345\220\253\346\262\271\346\261\241\346\260\264.png" "b/public/assets/images/map/sewers/\345\220\253\346\262\271\346\261\241\346\260\264.png" index 38b284c..be8083c 100644 --- "a/public/assets/images/map/sewers/\345\220\253\346\262\271\346\261\241\346\260\264.png" +++ "b/public/assets/images/map/sewers/\345\220\253\346\262\271\346\261\241\346\260\264.png" Binary files differ diff --git "a/public/assets/images/map/sewers/\347\224\237\344\272\247\346\261\241\346\260\264.png" "b/public/assets/images/map/sewers/\347\224\237\344\272\247\346\261\241\346\260\264.png" index 0897c51..1e565df 100644 --- "a/public/assets/images/map/sewers/\347\224\237\344\272\247\346\261\241\346\260\264.png" +++ "b/public/assets/images/map/sewers/\347\224\237\344\272\247\346\261\241\346\260\264.png" Binary files differ diff --git a/src/components/LayerController/logic/Sample.js b/src/components/LayerController/logic/Sample.js deleted file mode 100644 index 20fe78f..0000000 --- a/src/components/LayerController/logic/Sample.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * 搴熸皵 - */ -const AnimalService = require('../service/AnimalService').default -const AjaxUtils = require('../../../utils/AjaxUtils').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) { - 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.bindTooltip = (layer) => { - return layer.options.test - } - - this.clickListener = (e) => { - this.animalService.pulseEffect(e.latlng) - } -} diff --git a/src/components/LayerController/logic/WasteGas.js b/src/components/LayerController/logic/WasteGas.js index 6c2fe65..935c9ff 100644 --- a/src/components/LayerController/logic/WasteGas.js +++ b/src/components/LayerController/logic/WasteGas.js @@ -37,12 +37,6 @@ // 瀹氫箟绫诲瀷 鐢ㄦ潵鍖哄垎鏁版嵁 const ContrLevel = data[i].ContrLevel var iconUrl = this.differentTypes(ContrLevel) - // const marker = L.canvasMarker([positionX, positionY], { - // img: { - // // url: 'assets/images/map/marker-icon.png', - // url: iconUrl, - // size: STYLES.ICON_SIZE - // } const marker = L.marker([positionX, positionY], { test: data[i], icon: L.icon({ @@ -68,7 +62,7 @@ const res = e.layer.options.test window.$layer.open({ content: { - content: WasteGasIndex, // 缁勪欢 + comp: WasteGasIndex, // 缁勪欢 parent: this, // 鐖剁粍浠� data: { // 浼犻�掔殑鍙傛暟 storagePlaceId: res diff --git a/src/components/LayerController/logic/WasteSolid.js b/src/components/LayerController/logic/WasteSolid.js index 1b9cd9c..ad4b1e0 100644 --- a/src/components/LayerController/logic/WasteSolid.js +++ b/src/components/LayerController/logic/WasteSolid.js @@ -1,7 +1,7 @@ /** * 鍥哄簾 */ -const WasteSolidIndex = require('@components/BaseNav/WasteSolid/WasteSolidIndex').default +const WasteSolidIndex = require('../../../components/BaseNav/WasteSolid/WasteSolidIndex').default // 鍖哄垎涓嶅悓绫诲瀷 浣跨敤涓嶅悓img const defaultImg = '/assets/images/map/solidwaste/voc.png' const setting = '/assets/images/map/solidwaste/gf_green2.png' @@ -60,7 +60,7 @@ const title = e.layer.options.totransferData.Name window.$layer.open({ content: { - content: WasteSolidIndex, // 缁勪欢 + comp: WasteSolidIndex, // 缁勪欢 parent: this, // 鐖剁粍浠� data: { // 浼犻�掔殑鍙傛暟 storagePlaceId: e.layer.options.totransferData.StoragePlaceId diff --git a/src/components/LayerController/logic/WasteWater.js b/src/components/LayerController/logic/WasteWater.js index 267fe0a..6203258 100644 --- a/src/components/LayerController/logic/WasteWater.js +++ b/src/components/LayerController/logic/WasteWater.js @@ -61,7 +61,7 @@ const res = e.layer.options.totransferData window.$layer.open({ content: { - content: WasteWaterIndex, // 缁勪欢 + comp: WasteWaterIndex, // 缁勪欢 parent: this, // 鐖剁粍浠� data: { // 浼犻�掔殑鍙傛暟 // info: this.info diff --git a/src/components/panel/topicSearch/EnterpriseEmergency/ResourcesQuery.vue b/src/components/panel/topicSearch/EnterpriseEmergency/ResourcesQuery.vue index 3c9a2ee..5c2f333 100644 --- a/src/components/panel/topicSearch/EnterpriseEmergency/ResourcesQuery.vue +++ b/src/components/panel/topicSearch/EnterpriseEmergency/ResourcesQuery.vue @@ -59,6 +59,8 @@ import { LayerEmergencySource } from '../../../../conf/layers/LayerEmergencySource' import { LayerSurroundings } from '../../../../conf/layers/LayerSurroundings' import { pulseEffect } from '../../../../utils/utils' +import { openPopup } from '../../../helpers/LocateHelper' +// import { fitBounds, highlight, openPopup } from '../../helpers/LocateHelper' export default { name: 'ResourcesQuery', @@ -128,16 +130,19 @@ this.wfsHelper.addLike('name', this.form.keyword) } const res = await AjaxUtils.GetDataAsynByUrl(this.wfsHelper.getUrl(), {}) - console.log(res) + // console.log(res) if (res instanceof Object && Object.prototype.hasOwnProperty.call(res, 'features')) { this.list = res.features } }, // 鏌ヨ瀹氫綅鍔熻兘 handleLocation (val, index) { + // console.log(val) this.activeNum = index - window.map.setView([val.properties.y, val.properties.x], 16) - pulseEffect([val.properties.y, val.properties.x]) + const positionArea = [val.properties.y, val.properties.x] + window.map.setView(positionArea, 16) + pulseEffect(positionArea) + openPopup(positionArea, val.id) } } } diff --git a/src/components/panel/topicSearch/GasWasteSearch.vue b/src/components/panel/topicSearch/GasWasteSearch.vue index 42df935..73fc8d6 100644 --- a/src/components/panel/topicSearch/GasWasteSearch.vue +++ b/src/components/panel/topicSearch/GasWasteSearch.vue @@ -169,7 +169,7 @@ window.map.setView(pos, 15) window.$layer.open({ content: { - content: WasteWaterIndex, // 缁勪欢 + comp: WasteWaterIndex, // 缁勪欢 parent: this, // 鐖剁粍浠� data: { // 浼犻�掔殑鍙傛暟 storagePlaceId: val diff --git a/src/components/panel/topicSearch/SolidWasteSearch.vue b/src/components/panel/topicSearch/SolidWasteSearch.vue index cc8a508..deb1d88 100644 --- a/src/components/panel/topicSearch/SolidWasteSearch.vue +++ b/src/components/panel/topicSearch/SolidWasteSearch.vue @@ -3,16 +3,25 @@ <div class="panel-title">{{ title }}</div> <div class="search-panel "> <el-form ref="form" :model="form" label-width="90px" class="search-form"> - <el-form-item v-for="(item,index) in solidWasteTypeOptions" :key="index" :label="item.label+'锛�'" - size="mini" - class="search-panel-item"> + <el-form-item label="璁炬柦绫诲瀷锛�" size="mini" class="search-panel-item"> <el-select style="width: 100%" v-model="form.pipelineType" @change="handlePipelineType" :popper-class="'select-down'"> <el-option - v-for="item in solidWasteTypeOptions.labelList" - :key="item.value" - :label="item.label" - :value="item.value"> + v-for="item in items" + :key="item.code" + :label="item.name" + :value="item.name"> + </el-option> + </el-select> + </el-form-item> + <el-form-item :label="form.pipelineType+'锛�'" size="mini"> + <el-select style="width: 100%" v-model="form.dataType" value-key="code" + :popper-class="'select-down'" @change="handleDataType"> + <el-option + v-for="item in subItems" + :key="item.code" + :label="item.name" + :value="item"> </el-option> </el-select> </el-form-item> @@ -28,8 +37,8 @@ </el-form> </div> <el-scrollbar style="height:286.22px"> - <div class="environmental-risk-list" v-for="(item,index) in searchDataDisplay" :key="index" - @click="setBounced(item)"> + <div class="environmental-risk-list" v-for="(item,index) in list" :key="index" + @click="setBounced(item, index)"> <img src="../../../../public/assets/images/map/solidwaste/gf_green2.png" alt="" class="state"> <div> <h3>###鐐煎寲閮�</h3> @@ -46,6 +55,7 @@ import mapApi from '@/api/mapApi' import WasteSolidIndex from '@/components/BaseNav/WasteSolid/WasteSolidIndex' import { pulseEffect, setPanTo } from '../../../utils/utils' +import { LayerWasteSolid } from '../../../conf/layers/LayerWasteSolid' export default { name: 'SolidWasteSearch', @@ -54,7 +64,9 @@ return { judgeVisible: true, form: { - keyword: '鍥哄簾闈㈡澘鏁版嵁鏌ヨ', + pipelineType: '鍥哄簾', + dataType: '', + keyword: '', // 鏁版嵁鐨勪紶閫� transferData: 1 }, @@ -73,97 +85,42 @@ } ], // 鏁版嵁鎼滅储涔嬪悗锛屽瓨鍌ㄦ暟鎹殑 - searchDataDisplay: [], - solidWasteTypeOptions: [{ - value: '1', - label: '鍖哄煙', - options: [{ - value: '1', - layerName: '鍥哄簾', - key: 'pipename', - label: '鍏ㄩ儴鍥哄簾' - }], - labelList: [{ - label: '杈撻�佷粙璐�', - key: 'mediumtype' - }, { - label: '闀垮害(m)', - key: 'length' - }] - }, { - value: '2', - label: '浼佷笟鍚嶇О', - options: [{ - value: '1', - layerName: '鍥哄簾', - key: 'pipename', - label: '鍏ㄩ儴鍥哄簾' - }], - labelList: [{ - label: '杈撻�佷粙璐�', - key: 'mediumtype' - }, { - label: '闀垮害(m)', - key: 'length' - }] - }, { - value: '3', - label: '浜岀骇鍗曚綅', - options: [{ - value: '1', - layerName: '鍥哄簾', - key: 'pipename', - label: '鍏ㄩ儴鍥哄簾' - }], - labelList: [{ - label: '杈撻�佷粙璐�', - key: 'mediumtype' - }, { - label: '闀垮害(m)', - key: 'length' - }] - }, { - value: '4', - label: '浼佷笟鍚嶇О', - options: [{ - value: '1', - layerName: '鍥哄簾', - key: 'pipename', - label: '鍏ㄩ儴鍥哄簾' - }], - labelList: [{ - label: '杈撻�佷粙璐�', - key: 'mediumtype' - }, { - label: '闀垮害(m)', - key: 'length' - }] - }] + items: [LayerWasteSolid], + subItems: LayerWasteSolid.layers, + list: [] } }, methods: { // select鐨刼ption鐨勬暟鎹�夋嫨 handlePipelineType (val) { - this.solidWasteTypeOptions.forEach(item => { - if (val === item.value) { - this.handleSearch(item.value) + this.list = [] + for (let i = 0; i < this.items.length; i++) { + const item = this.items[i] + if (val === item.name) { + this.subItems = item.layers + return } - }) + } + }, + handleDataType () { + this.list = [] }, // 鐐瑰嚮鎼滅储瀹炵幇鏁版嵁鐨勬悳绱㈠睍绀� async handleSearch (data) { // console.log(this.form.keyword) const result = await mapApi.getSolidWaste(data) - this.searchDataDisplay = result.Result.DataInfo + this.list = result.Result.DataInfo }, // 鏁版嵁灞曠ず,鐐瑰嚮杩涜寮规鍙婄偣鐨勫睍绀� - setBounced (val) { - console.log(val) + setBounced (val, index) { const pos = [val.Latitude, val.Longitude] window.map.setView(pos, 15) + this.activeNum = index + pulseEffect([val.Latitude, val.Longitude]) + setPanTo(pos, 200) window.$layer.open({ content: { - content: WasteSolidIndex, // 缁勪欢 + comp: WasteSolidIndex, // 缁勪欢 parent: this, // 鐖剁粍浠� data: { // 浼犻�掔殑鍙傛暟 storagePlaceId: val.StoragePlaceId @@ -171,8 +128,6 @@ }, title: val.Name }) - pulseEffect([val.Latitude, val.Longitude]) - setPanTo(pos, 200) } } } diff --git a/src/components/panel/topicSearch/WaterWasteSearch.vue b/src/components/panel/topicSearch/WaterWasteSearch.vue index f49cd6d..c1f5409 100644 --- a/src/components/panel/topicSearch/WaterWasteSearch.vue +++ b/src/components/panel/topicSearch/WaterWasteSearch.vue @@ -192,7 +192,7 @@ window.map.setView(pos, 15) window.$layer.open({ content: { - content: WasteWaterIndex, // 缁勪欢 + comp: WasteWaterIndex, // 缁勪欢 parent: this, // 鐖剁粍浠� data: { // 浼犻�掔殑鍙傛暟 storagePlaceId: val -- Gitblit v1.8.0