From 8eebe7cdf3865d37e8d21b5078c9721207a38b6d Mon Sep 17 00:00:00 2001
From: 陈泽平 <chenzeping>
Date: 星期六, 29 五月 2021 16:28:13 +0800
Subject: [PATCH] 企业应急-事件上报-管段定位修改
---
src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue | 198 ++++++++++++++++++++++++++-----------------------
1 files changed, 104 insertions(+), 94 deletions(-)
diff --git a/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue b/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue
index 3b46417..7498287 100644
--- a/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue
+++ b/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue
@@ -111,30 +111,28 @@
:data="tableDataAffFac"
border
@row-click="affFacName"
- height="100"
- max-height="100"
+ height="120"
+ max-height="140"
style="width: 100%">
<el-table-column
show-overflow-tooltip
+ width="150"
prop="properties.pipecode"
- label="闄勫睘璁炬柦缂栧彿">
+ label="绠$嚎缂栧彿">
</el-table-column>
<el-table-column
show-overflow-tooltip
- prop="properties.measattribute"
+ width="150"
+ prop="properties.name"
label="闄勫睘璁炬柦鍚嶇О">
</el-table-column>
<el-table-column
+ width="150"
show-overflow-tooltip
- prop="properties.code"
- label="闄勫睘璁炬柦鍚嶇О">
+ prop="properties.type"
+ label="璁炬柦绫诲瀷">
</el-table-column>
- <el-table-column
- show-overflow-tooltip
- prop="properties.datasource"
- label="闄勫睘璁炬柦绫诲瀷">
- </el-table-column>
- <el-table-column width="40" fixed="right" label="鎿嶄綔">
+ <el-table-column width="90" fixed="right" label="鎿嶄綔">
<template slot-scope="scope">
<el-button @click="localAdr(scope.row)" type="text" size="small">瀹氫綅</el-button>
</template>
@@ -149,12 +147,9 @@
</template>
<script>
-
-// import { pulseEffect } from '../../../../utils/utils'
-// import mapApi from '../../../../api/mapApi'
+import { highlight, fitBounds } from '../../../helpers/LocateHelper'
import WfsHelper from '@components/helpers/WfsHelper'
import AjaxUtils from '@utils/AjaxUtils'
-import { fitBounds, highlight } from '../../../../components/helpers/LocateHelper'
import eventBus from '../../../../eventBus'
import { WMS_URL } from '../../../../conf/Constants'
@@ -174,14 +169,37 @@
// 闄勫睘璁炬柦鏌ヨ鍒楄〃鏁版嵁
tableDataAffFac: [],
// 瀹氫箟绫诲瀷鍒ゆ柇 if 鏄悳绱㈠埌鐨勬暟鎹彲浠ヨ繘琛岀绾块�夋嫨 else 鐐瑰嚮瀹氫綅閫夋嫨鐨勭绾夸笉鍙互杩涜閫夋嫨
- SectionAndAffFacTableJudge: false,
- locateJudgmentSearch: false
+ SectionAndAffFacTableJudge: false
}
},
mounted () {
this.wfsHelper = new WfsHelper()
},
methods: {
+ // 绠$嚎鎼滅储
+ async pipelineSearch () {
+ this.SectionAndAffFacTableJudge = true
+ this.tableList = []
+ this.tableListSection = []
+ this.tableDataAffFac = []
+ this.wfsHelper.clearFilter()
+ this.wfsHelper.setTypeName(['sewer:pipeline'])
+ if (this.form.pipeName) {
+ this.wfsHelper.addLike('subchaname', this.form.pipeName)
+ }
+ // this.wfsHelper.addEquals('pipename', '\'' + this.form.pipeName + '\'')
+ const res = await AjaxUtils.GetDataAsynByUrl(this.wfsHelper.getUrl(), {})
+ // console.log(res)
+ if (res instanceof Object && Object.prototype.hasOwnProperty.call(res, 'features')) {
+ this.total = res.totalFeatures
+ // console.log(res.features)
+ this.tableList = res.features
+ }
+ this.wfsHelper = new WfsHelper()
+ this.form.pipeName = ''
+ this.form.sectionName = ''
+ this.form.affiliatedFacilities = ''
+ },
// 鐐瑰嚮绠$嚎鍒楄〃 灞曠ず绠℃鍐呭 鍜岄檮灞炶鏂藉唴瀹�
async sectionShowClick (val) {
console.log(val)
@@ -202,18 +220,18 @@
this.wfsHelper = new WfsHelper()
// 闄勫睘璁炬柦鏌ヨ
this.tableDataAffFac = []
- const AffFacSearch = val.properties.mediumtype
+ const AffFacSearch = val.properties.pipecode
console.log(AffFacSearch)
this.wfsHelper.clearFilter()
this.wfsHelper.setTypeName(['sewer:view_pipeline'])
- this.wfsHelper.addLike('type', AffFacSearch)
+ this.wfsHelper.addLike('pipecode', AffFacSearch)
// this.wfsHelper.addEquals('type', '\'' + AffFacSearch + '\'')
const resAffFac = await AjaxUtils.GetDataAsynByUrl(this.wfsHelper.getUrl(), {})
console.log(resAffFac)
if (resAffFac instanceof Object && Object.prototype.hasOwnProperty.call(resAffFac, 'features')) {
- // console.log(resAffFac.features)
// for (let i = 0; i < resAffFac.features.length; i++) {
- // console.log(resAffFac.features[i])
+ // // console.log(resAffFac.features[i])
+ // this.tableDataAffFac.push(resAffFac.features[i].properties)
// }
this.tableDataAffFac = resAffFac.features
}
@@ -232,7 +250,7 @@
},
// 瀹氫綅鍔熻兘
localAdr (val) {
- console.log(val)
+ // console.log(val)
fitBounds(val)
highlight(val)
},
@@ -240,59 +258,74 @@
pipeClickLocation () {
// 璁炬柦涓嶈繘琛� 绠$嚎琛ㄦ牸鏁版嵁鐨勭偣鍑讳氦浜�
this.SectionAndAffFacTableJudge = false
- window.mapManager.clickDialogSwitch = false
// this.tableList = []
// 鐐瑰嚮鑾峰彇鏁版嵁
window.map.on('click', (e) => {
- // window.mapManager.loadWfsDatas(e.latlng).then((res) => {
- // console.log(res)
- // for (let i = 0; i < res.features.length; i++) {
- // this.tableList.push(res.features[i])
- // this.tableListSection.push(res.features[i])
- // this.tableDataAffFac.push(res.features[i])
- // }
- // })
- // return new Promise((resolve, reject) => {
- const size = window.map.getSize()
- var point = window.map.latLngToContainerPoint(e.latlng, window.map.getZoom())
- const wmsParams = Object.assign({
- LAYERS: 'pipeline_group',
- QUERY_LAYERS: 'pipeline_group',
- WIDTH: size.x,
- HEIGHT: size.y,
- X: Math.round(point.x),
- Y: Math.round(point.y),
- BBOX: window.map.getBounds().toBBoxString()
- }, {
- VERSION: '1.1.1',
- SERVICE: 'WMS',
- REQUEST: 'GetFeatureInfo',
- // bbox: bbox,
- FORMAT: 'image/png',
- INFO_FORMAT: 'application/json',
- TRANSPARENT: true,
- FEATURE_COUNT: 50,
- SRS: 'EPSG:4326',
- EXCEPTIONS: 'application/vnd.ogc.se_inimage'
- })
- AjaxUtils.get4JsonDataByUrl(WMS_URL, wmsParams, (res) => {
- // console.log(res)
- for (let i = 0; i < res.data.features.length; i++) {
- // console.log(res.data.features[i])
- this.tableList.push(res.data.features[i])
+ // window.mapManager.clickDialogSwitch = false
+ window.mapManager.loadWfsDatas(e.latlng).then((res) => {
+ for (let i = 0; i < res.features.length; i++) {
+ console.log(res.features[i])
+ const ids = res.features[i].id.split('.')
+ // console.log(ids[0])
+ if (ids[0] === 'pipeline') {
+ this.tableList.push(res.features[i])
+ } else if (ids[0] === 'pipesegment') {
+ this.tableListSection.push(res.features[i])
+ } else {
+ this.tableDataAffFac.push(res.features[i])
+ // const obj = {
+ // properties: {
+ // pipecode: res.features[i].properties.code,
+ // name: res.features[i].properties.companyname,
+ // type: res.features[i].properties.mediumtype
+ // }
+ // }
+ // console.log(obj)
+ // this.tableDataAffFac.push(obj)
+ // console.log(this.tableDataAffFac)
+ }
}
})
- // 绠℃
- this.sectionData(e)
- // 闄勫睘璁炬柦
- this.affFacData(e)
+ window.map.off('click')
+ // const size = window.map.getSize()
+ // var point = window.map.latLngToContainerPoint(e.latlng, window.map.getZoom())
+ // const wmsParams = Object.assign({
+ // LAYERS: 'pipeline_group',
+ // QUERY_LAYERS: 'pipeline_group',
+ // WIDTH: size.x,
+ // HEIGHT: size.y,
+ // X: Math.round(point.x),
+ // Y: Math.round(point.y),
+ // BBOX: window.map.getBounds().toBBoxString()
+ // }, {
+ // VERSION: '1.1.1',
+ // SERVICE: 'WMS',
+ // REQUEST: 'GetFeatureInfo',
+ // // bbox: bbox,
+ // FORMAT: 'image/png',
+ // INFO_FORMAT: 'application/json',
+ // TRANSPARENT: true,
+ // FEATURE_COUNT: 50,
+ // SRS: 'EPSG:4326',
+ // EXCEPTIONS: 'application/vnd.ogc.se_inimage'
// })
+ // AjaxUtils.get4JsonDataByUrl(WMS_URL, wmsParams, (res) => {
+ // // console.log(res)
+ // for (let i = 0; i < res.data.features.length; i++) {
+ // // console.log(res.data.features[i])
+ // this.tableList.push(res.data.features[i])
+ // }
+ // })
+ // // 绠℃
+ // this.sectionData(e)
+ // // 闄勫睘璁炬柦
+ // this.affFacData(e)
})
// 鏁版嵁 閲嶆柊鑾峰彇 杩涜缃┖
this.tableList = []
this.tableListSection = []
- this.form.pipeName = ''
this.tableDataAffFac = []
+ this.form.pipeName = ''
this.form.sectionName = ''
this.form.affiliatedFacilities = ''
},
@@ -327,13 +360,15 @@
}
})
},
- // 闄勫睘璁炬柦
+ // 鐐瑰嚮瀹氫綅 鎿﹀闄勫睘璁炬柦
affFacData (e) {
const size = window.map.getSize()
var point = window.map.latLngToContainerPoint(e.latlng, window.map.getZoom())
const wmsParams = Object.assign({
- LAYERS: 'pipeline_fs',
- QUERY_LAYERS: 'pipeline_fs',
+ LAYERS: 'sewer:view_pipeline',
+ QUERY_LAYERS: 'sewer:view_pipeline',
+ // LAYERS: 'pipeline_fs',
+ // QUERY_LAYERS: 'pipeline_fs',
WIDTH: size.x,
HEIGHT: size.y,
X: Math.round(point.x),
@@ -356,37 +391,12 @@
for (let i = 0; i < res.data.features.length; i++) {
this.tableDataAffFac.push(res.data.features[i])
}
- console.log(this.tableDataAffFac)
})
- },
- // 绠$嚎鎼滅储
- async pipelineSearch () {
- this.SectionAndAffFacTableJudge = true
- this.tableList = []
- this.tableListSection = []
- this.tableDataAffFac = []
- this.wfsHelper.clearFilter()
- this.wfsHelper.setTypeName(['sewer:pipeline'])
- if (this.form.pipeName) {
- this.wfsHelper.addLike('pipename', this.form.pipeName)
- }
- // this.wfsHelper.addEquals('pipename', '\'' + this.form.pipeName + '\'')
- const res = await AjaxUtils.GetDataAsynByUrl(this.wfsHelper.getUrl(), {})
- // console.log(res)
- if (res instanceof Object && Object.prototype.hasOwnProperty.call(res, 'features')) {
- this.total = res.totalFeatures
- // console.log(res.features)
- this.tableList = res.features
- }
- this.wfsHelper = new WfsHelper()
- // this.form.pipeName = ''
- this.form.sectionName = ''
- this.form.affiliatedFacilities = ''
},
// 鐐瑰嚮纭
confirm () {
// console.log('鐐瑰嚮纭畾閫夋嫨瀹屾垚')
- eventBus.$emit('section-search', true)
+ eventBus.$emit('location-setChange', true)
this.form.pipeName = ''
this.form.sectionName = ''
this.form.affiliatedFacilities = ''
--
Gitblit v1.8.0