From f8865d1c7f36c4ffa66002e0dd3a9d5e99e4fe6b Mon Sep 17 00:00:00 2001 From: 徐旺旺 <11530253@qq.com> Date: 星期日, 30 五月 2021 13:45:44 +0800 Subject: [PATCH] Merge branch 'develop' of http://xearth.cn:6600/r/wuyushui/SewerAndRainNetwork into develop --- src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue | 275 +++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 187 insertions(+), 88 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 f899d47..3e9cbff 100644 --- a/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue +++ b/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue @@ -1,6 +1,6 @@ <template> <div class="ReportLocationSection"> - <el-form :model="form" label-width="90px"> + <el-form :model="form" label-width="120px"> <el-row class="pipe-line-search"> <el-col :span="12"> <el-form-item label="绠$嚎鍚嶇О:"> @@ -12,30 +12,38 @@ </el-form-item> </el-col> <el-col :span="8"> - <el-button type="primary" size="small" icon="el-icon-search" @click="pipeClickLocation">瀹氫綅</el-button> + <el-button type="primary" size="small" icon="el-icon-location-outline" @click="pipeClickLocation">瀹氫綅 + </el-button> </el-col> </el-row> <el-row> - <el-col :span="12"> + <el-col :span="24"> <el-form-item label="绠℃缂栫爜:"> <el-input v-model="form.sectionName" disabled></el-input> </el-form-item> </el-col> + </el-row> + <el-row> <el-col :span="12"> - <el-form-item label="闄勫睘璁炬柦:"> + <el-form-item label="闄勫睘璁炬柦鍚嶇О:"> <el-input v-model="form.affiliatedFacilities" disabled></el-input> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="闄勫睘璁炬柦缂栫爜:"> + <el-input v-model="form.affiliatedFacilitiesCode" disabled></el-input> </el-form-item> </el-col> </el-row> </el-form> <div class="pipe-table" v-show="this.tableList.length>=1"> <el-card> - <span class="fixed-style">绠$嚎鍚嶇О</span> + <span class="fixed-style" style="display: block">绠$嚎鍚嶇О</span> <el-table :data="tableList" border - height="240" - max-height="280" + height="120" + max-height="140" @row-click="sectionShowClick" style="width: 100%"> <el-table-column @@ -50,6 +58,11 @@ </el-table-column> <el-table-column show-overflow-tooltip + prop="properties.subchaname" + label="鏀嚎鍚嶇О"> + </el-table-column> + <el-table-column + show-overflow-tooltip prop="properties.mediumtype" label="绠$嚎绫诲瀷"> </el-table-column> @@ -61,13 +74,13 @@ </el-table> </el-card> <el-card> - <span class="fixed-style">绠℃鍒楄〃</span> + <span class="fixed-style" style="display: block">绠℃鍒楄〃</span> <el-table :data="tableListSection" border @row-click="sectionCode" height="100" - max-height="120" + max-height="100" style="width: 100%"> <el-table-column show-overflow-tooltip @@ -100,25 +113,33 @@ </template> </el-table-column> </el-table> - <span class="fixed-style">闄勫睘璁炬柦鍒楄〃</span> + <span class="fixed-style" style="display: block">闄勫睘璁炬柦鍒楄〃</span> <el-table :data="tableDataAffFac" border @row-click="affFacName" - height="100" - max-height="120" - style="width: 120%"> + height="120" + max-height="140" + style="width: 100%"> <el-table-column show-overflow-tooltip + width="150" + prop="properties.pipecode" + label="绠$嚎缂栧彿"> + </el-table-column> + <el-table-column + show-overflow-tooltip + width="150" prop="properties.name" label="闄勫睘璁炬柦鍚嶇О"> </el-table-column> <el-table-column + width="150" show-overflow-tooltip prop="properties.type" - label="闄勫睘璁炬柦绫诲瀷"> + 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> @@ -126,21 +147,18 @@ </el-table> </el-card> </div> - <el-row style="text-align: center;margin: 10px"> - <el-button type="primary" @click="confirm">纭</el-button> + <el-row style="text-align: right;margin: 10px"> + <el-button type="primary" @click="confirm" size="small">纭</el-button> </el-row> </div> </template> <script> +import { highlight, fitBounds } from '../../../helpers/LocateHelper' import WfsHelper from '@components/helpers/WfsHelper' import AjaxUtils from '@utils/AjaxUtils' -// import { pulseEffect } from '../../../../utils/utils' -// import mapApi from '../../../../api/mapApi' - -import { fitBounds, highlight } from '../../../../components/helpers/LocateHelper' import eventBus from '../../../../eventBus' -// import MapManager from '../../../helpers/MapManager' +import { WMS_URL } from '../../../../conf/Constants' export default { name: 'ReportLocationSection', @@ -149,7 +167,8 @@ form: { pipeName: '', sectionName: '', - affiliatedFacilities: '' + affiliatedFacilities: '', + affiliatedFacilitiesCode: '' }, // 绠$嚎鏌ヨ鏁版嵁鍒楄〃 tableList: [], @@ -157,20 +176,50 @@ tableListSection: [], // 闄勫睘璁炬柦鏌ヨ鍒楄〃鏁版嵁 tableDataAffFac: [], - // 鍒嗛〉鍔熻兘 - pageSize: 3, - total: 0, - currentPage: 1 + // 瀹氫箟绫诲瀷鍒ゆ柇 if 鏄悳绱㈠埌鐨勬暟鎹彲浠ヨ繘琛岀绾块�夋嫨 else 鐐瑰嚮瀹氫綅閫夋嫨鐨勭绾夸笉鍙互杩涜閫夋嫨 + SectionAndAffFacTableJudge: false } }, mounted () { this.wfsHelper = new WfsHelper() }, methods: { - // 鐐瑰嚮绠$嚎鍒楄〃 灞曠ず绠℃鍐呭 - async sectionShowClick (val) { - console.log(val) - // 绠℃鏌ヨ + // 绠$嚎鎼滅储 + 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 = '' + this.form.affiliatedFacilitiesCode = '' + }, + // 鐐瑰嚮绠$嚎鍒楄〃 灞曠ず绠℃鍐呭 鍜岄檮灞炶鏂藉唴瀹� + sectionShowClick (val) { + // console.log(val) + // this.SectionAndAffFacTableJudge = true + if (this.SectionAndAffFacTableJudge === true) { + this.searchSection(val) + this.searchAffFacData(val) + } + }, + // 绠℃鏌ヨ + async searchSection (val) { const sectionNameSearch = val.properties.pipename this.tableListSection = [] this.wfsHelper.clearFilter() @@ -182,86 +231,136 @@ if (res instanceof Object && Object.prototype.hasOwnProperty.call(res, 'features')) { this.tableListSection = res.features } - this.wfsHelper = new WfsHelper() - // 闄勫睘璁炬柦鏌ヨ + }, + // 闄勫睘璁炬柦鏌ヨ + async searchAffFacData (val) { this.tableDataAffFac = [] - const AffFacSearch = val.properties.pipename + const AffFacSearch = val.properties.pipecode this.wfsHelper.clearFilter() this.wfsHelper.setTypeName(['sewer:view_pipeline']) - this.wfsHelper.addLike('name', AffFacSearch) - this.wfsHelper.addEquals('name', '\'' + 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')) { this.tableDataAffFac = resAffFac.features } + }, + // 鎼滅储鐨勫叕鍏辨柟娉曚紭鍖� + async publicSearch (searchVal, searchKeyword, searchTypeName, tableListData) { + tableListData = [] this.wfsHelper = new WfsHelper() + this.wfsHelper.clearFilter() + this.wfsHelper.setTypeName(searchTypeName) + this.wfsHelper.addLike(searchKeyword, searchVal) + this.wfsHelper.addEquals(searchKeyword, '\'' + searchVal + '\'') + const res = await AjaxUtils.GetDataAsynByUrl(this.wfsHelper.getUrl(), {}) + // console.log(res) + if (res instanceof Object && Object.prototype.hasOwnProperty.call(res, 'features')) { + tableListData = res.features + } }, // 鐐瑰嚮绠℃鍒楄〃 绠℃缂栫爜浼犻�� sectionCode (val) { - console.log(val) - this.form.sectionName = val.properties.pipecode + // console.log(val) + this.form.sectionName = val.properties.pipesegcode }, // 鐐瑰嚮闄勫睘璁炬柦鍒楄〃 绠℃缂栫爜浼犻�� affFacName (val) { console.log(val) this.form.affiliatedFacilities = val.properties.name + this.form.affiliatedFacilitiesCode = val.properties.code }, // 瀹氫綅鍔熻兘 localAdr (val) { + // console.log(val) fitBounds(val) highlight(val) }, - // 绠$嚎鐐瑰嚮鐐瑰嚮瀹氫綅鍔熻兘 + // 绠$嚎 鐐瑰嚮瀹氫綅绠℃鐨勯�夋嫨鍔熻兘 pipeClickLocation () { - // console.log('val') - // this.selectPipeLine() - 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++) { - // console.log(res.features[i].properties) - this.tableList.push(res.features[i]) - } - // console.log(this.tableList) + // 璁炬柦涓嶈繘琛� 绠$嚎琛ㄦ牸鏁版嵁鐨勭偣鍑讳氦浜� + this.SectionAndAffFacTableJudge = false + if (this.SectionAndAffFacTableJudge === false) { + // 鐐瑰嚮鑾峰彇鏁版嵁 + window.map.on('click', (e) => { + this.SectionAndAffFacTableJudge = false + // 鐐瑰嚮鍦板浘鍏抽棴寮规 + window.mapManager.clickDialogSwitch = false + // 绠$嚎鐐瑰嚮鏁版嵁 + this.pipeData(e) + // 绠℃鐐瑰嚮鏁版嵁 + this.sectionData(e) + // 闄勫睘璁炬柦鏁版嵁 + this.affFacData(e) + // 鍏抽棴鐐瑰嚮浜嬩欢 + window.map.off('click') }) - }) - }, - // 绠$嚎鎼滅储 - async pipelineSearch () { - // this.pipeTable = !this.pipeTable + } + // 鏁版嵁 閲嶆柊鑾峰彇 杩涜缃┖ + this.form.pipeName = '' + this.form.sectionName = '' + this.form.affiliatedFacilities = '' + this.form.affiliatedFacilitiesCode = '' this.tableList = [] - this.wfsHelper.clearFilter() - this.wfsHelper.setTypeName(['sewer:pipeline']) - if (this.form.pipeName) { - this.wfsHelper.addLike('name', this.form.pipeName) - } - // this.wfsHelper.addEquals('type', '\'' + 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.tableListSection = [] + this.tableDataAffFac = [] }, - // 鍒嗛〉鍔熻兘 currentPage 鏀瑰彉鏃朵細瑙﹀彂 - handlePage (val) { - // console.log(val) - this.currentPage = val + // 鐐瑰嚮瀹氫綅鍖哄煙 鎼滃绠$嚎鏁版嵁 + pipeData (e) { + this.publicWay(e, 'sewer:pipeline', 'sewer:pipeline', this.tableList) }, - // 鍒嗛〉鍔熻兘 pageSize 鏀瑰彉鏃朵細瑙﹀彂 - handleSizeChange (val) { - // console.log(val) - this.pageSize = val + // 鐐瑰嚮瀹氫綅鍖哄煙 鎼滃绠℃鏁版嵁 + sectionData (e) { + this.publicWay(e, 'sewer:pipesegment', 'sewer:pipesegment', this.tableListSection) + }, + // 鐐瑰嚮瀹氫綅鍖哄煙 鎼滃闄勫睘璁炬柦鏁版嵁 + affFacData (e) { + this.publicWay(e, 'sewer:view_pipeline', 'sewer:view_pipeline', this.tableDataAffFac, 'pipecode <> \'\'') + }, + // 鐐瑰嚮鎸夐挳瀹氫綅 鐨勫叕鍏变簨浠� + publicWay (e, layer, queryLayer, dataList, cqlfilter) { + const defaultWmsParams = { + VERSION: '1.1.1', + SERVICE: 'WMS', + REQUEST: 'GetFeatureInfo', + FORMAT: 'image/png', + INFO_FORMAT: 'application/json', + TRANSPARENT: true, + FEATURE_COUNT: 50, + SRS: 'EPSG:4326', + cql_filter: cqlfilter, + EXCEPTIONS: 'application/vnd.ogc.se_inimage' + } + const size = window.map.getSize() + const point = window.map.latLngToContainerPoint(e.latlng, window.map.getZoom()) + const wmsParams = Object.assign({ + LAYERS: layer, + QUERY_LAYERS: queryLayer, + WIDTH: size.x, + HEIGHT: size.y, + X: Math.round(point.x), + Y: Math.round(point.y), + BBOX: window.map.getBounds().toBBoxString() + }, defaultWmsParams) + AjaxUtils.get4JsonDataByUrl(WMS_URL, wmsParams, (res) => { + // console.log(res) + for (let i = 0; i < res.data.features.length; i++) { + dataList.push(res.data.features[i]) + } + }) }, // 鐐瑰嚮纭 confirm () { - console.log('鐐瑰嚮纭畾閫夋嫨瀹屾垚') - eventBus.$emit('section-search', true) + // console.log('鐐瑰嚮纭畾閫夋嫨瀹屾垚') + eventBus.$emit('location-setChange', true) + this.form.pipeName = '' + this.form.sectionName = '' + this.form.affiliatedFacilities = '' + this.tableList = [] + this.tableListSection = [] + this.tableDataAffFac = [] + this.SectionAndAffFacTableJudge = false } } } @@ -282,18 +381,18 @@ } .pipe-table { - display: flex; - align-items: center; - justify-content: space-around; + /*display: flex;*/ + /*align-items: center;*/ + /*justify-content: space-around;*/ /deep/ .el-card { - width: 1.39523rem; - max-width: 1.39523rem; - height: 1.9343rem; - max-height: 1.9343rem; + /*width: 1.39523rem;*/ + /*max-width: 1.39523rem;*/ + /*height: 0.9343rem;*/ + /*max-height: 0.9343rem;*/ .el-table { - margin: 0.07345rem auto; + margin: 0.05345rem auto; } } } -- Gitblit v1.8.0