From dd9af28934e9b34f74a58cf3f92a472b898d738e Mon Sep 17 00:00:00 2001
From: seatonwan9 <seatonwan9@163.com>
Date: 星期五, 28 五月 2021 19:39:51 +0800
Subject: [PATCH] Merge branch 'develop' of http://xearth.cn:6600/r/wuyushui/SewerAndRainNetwork into develop
---
src/api/request.js | 3
src/components/base-page/enterprise-emergency/events-reported/ReportLocationSearch.vue | 82 ++++++++
src/utils/axios.js | 5
src/api/mapApi.js | 9
src/components/LayerController/logic/WasteWater.js | 15 +
src/components/base-page/WasteWater/Detail.vue | 15 +
src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue | 291 +++++++++++++++++++++--------
src/components/base-page/WasteWater/WasteWaterDayChart.vue | 3
src/components/base-page/enterprise-emergency/events-reported/EventsReported.vue | 7
src/api/mapUrl.js | 6
src/components/base-page/WasteWater/WasteWaterHoursChart.vue | 21 +
src/components/base-page/enterprise-emergency/events-reported/ReportLocation.vue | 92 ++++----
12 files changed, 398 insertions(+), 151 deletions(-)
diff --git a/src/api/mapApi.js b/src/api/mapApi.js
index a65399f..ae65d02 100644
--- a/src/api/mapApi.js
+++ b/src/api/mapApi.js
@@ -4,6 +4,7 @@
// 娴嬭瘯鐜IP锛歨ttp://10.238.221.113
import axios from '@utils/axios'
import * as mapUrl from './mapUrl'
+import qs from 'qs' // 瑙f瀽鍙傛暟
/**
* 璇ユ柟娉曢厤缃�
@@ -46,19 +47,19 @@
},
// 搴熸按鐐�
getWasteWater (data) {
- return axios.get(mapUrl.getWasteWater, data)
+ return axios.post(mapUrl.getWasteWater, qs.stringify(data), { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' })
},
// 搴熸按鐐规槑缁嗚〃
getWasteWaterMonitoringDetails (data) {
return axios.get(mapUrl.getWasteWaterMonitoringDetails, data)
},
// 搴熸按鏃ユ暟鎹拰灏忔椂鏁版嵁鍙婃槑缁嗚〃
- getQueryOnlineMonData (data) {
- return axios.get(mapUrl.getQueryOnlineMonData, data)
+ getQueryOnlineMonData (data, setHeaders) {
+ return axios.post(mapUrl.getQueryOnlineMonData, qs.stringify(data), { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' })
},
// 搴熸按浜哄伐鏁版嵁
getQueryLabMonData (data) {
- return axios.get(mapUrl.getQueryLabMonData, data)
+ return axios.post(mapUrl.getQueryLabMonData, qs.stringify(data), { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' })
},
// 搴熸按瀹炴椂鏁版嵁
getDataItems (data) {
diff --git a/src/api/mapUrl.js b/src/api/mapUrl.js
index b29d8aa..4ce8883 100644
--- a/src/api/mapUrl.js
+++ b/src/api/mapUrl.js
@@ -19,11 +19,11 @@
export const getWasteGasManualData = $HOST + '/wasteGas/QueryLabMonData'
// 搴熸按
-export const getWasteWater = $HOST + '/wasteWater/getWasteWater' // 搴熸按鐐逛俊鎭�
+export const getWasteWater = 'http://10.246.162.140:8080/EPInterface/DataService/EPMapService.asmx/ObtainningConInfo' // 搴熸按鐐逛俊鎭�
export const getWasteWaterMonitoring = $HOST + '/wasteWater/getWasteWaterMonitoring' // 搴熸按鐩戞祴鏁版嵁
export const getWasteWaterMonitoringDetails = $HOST + '/wasteWater/getWasteWaterMonitoringDetails' // 搴熸按鐩戞祴鏁版嵁鏄庣粏琛�
-export const getQueryOnlineMonData = $HOST + '/wasteWater/QueryOnlineMonData' // 搴熸按鏃ユ暟鎹皬鏃舵暟鎹強鏄庣粏琛ㄦ暟鎹�
-export const getQueryLabMonData = $HOST + '/wasteWater/QueryLabMonData' // 浜哄伐鏁版嵁
+export const getQueryOnlineMonData = 'http://10.246.162.140:8080/EPInterface/DataService/EPMapService.asmx/QueryOnlineMonData' // 搴熸按鏃ユ暟鎹皬鏃舵暟鎹強鏄庣粏琛ㄦ暟鎹�
+export const getQueryLabMonData = 'http://10.246.162.140:8080/EPInterface/DataService/EPMapService.asmx/QueryLabMonData' // 浜哄伐鏁版嵁
export const getDataItems = $HOST + '/wasteWater/RTDB/DataItems' // 瀹炴椂鏁版嵁
// 鍏徃
diff --git a/src/api/request.js b/src/api/request.js
index acdca70..0ac2c24 100644
--- a/src/api/request.js
+++ b/src/api/request.js
@@ -23,3 +23,6 @@
}
})
}
+export function reportLocationSearch (data = {}) {
+ return $http.get('http://10.246.133.164//api/search?', data)
+}
diff --git a/src/components/LayerController/logic/WasteWater.js b/src/components/LayerController/logic/WasteWater.js
index 09cc1f9..29658e1 100644
--- a/src/components/LayerController/logic/WasteWater.js
+++ b/src/components/LayerController/logic/WasteWater.js
@@ -27,7 +27,20 @@
L: L,
layer: layer
})
- const res = await mapApi.getWasteWater()
+ const res = await mapApi.getWasteWater({
+ companyId: 3900100145, // 浼佷笟鍚嶇О
+ id: '',
+ monType: 1, // 鍊间负1鏌ヨ搴熸按
+ userCode: 'wenchun.deng', // 瑙掕壊鍚嶇О
+ monDuration: '',
+ epName: '',
+ secdDeptId: '',
+ contrLevel: '',
+ dataStatus: '',
+ dataFlag: '',
+ runStatus: '',
+ emissTypeId: ''
+ })
const data = res.Result.DataInfo || {}
for (let i = 0; i < data.length; i++) {
// 缁忕含搴� 浣嶇疆
diff --git a/src/components/base-page/WasteWater/Detail.vue b/src/components/base-page/WasteWater/Detail.vue
index 5dc823d..91a92be 100644
--- a/src/components/base-page/WasteWater/Detail.vue
+++ b/src/components/base-page/WasteWater/Detail.vue
@@ -62,8 +62,20 @@
methods: {
async initdetail () {
const timeEnd = dayjs().format('YYYY-MM-DD HH:mm:ss')
- const timeStart = dayjs().subtract(3, 'minute').format('YYYY-MM-DD HH:mm:ss')
+ var timeStart = null
+ var oDate = new Date()
+ var year = oDate.getFullYear()
+ if ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) { // 鍒ゆ柇鏄钩骞磋繕鏄棸骞�
+ timeStart = dayjs().subtract(366, 'day').format('YYYY-MM-DD HH:mm:ss')
+ } else {
+ timeStart = dayjs().subtract(365, 'day').format('YYYY-MM-DD HH:mm:ss')
+ }
const data = {
+ poltSourceId: '',
+ poltMtrlId: '',
+ companyCode: '',
+ emissTypeId: '',
+ monItemId: 28,
companyId: 3900100145,
labMonPointId: 219,
beginTime: timeStart,
@@ -73,7 +85,6 @@
// console.log(result)
this.tableData = result
for (let i = 0; i < result.length; i++) {
- console.log(result[i].LabMonValue)
if (result[i].LabMonValue === '0') {
return '-'
}
diff --git a/src/components/base-page/WasteWater/WasteWaterDayChart.vue b/src/components/base-page/WasteWater/WasteWaterDayChart.vue
index 02244e7..1fcb2c9 100644
--- a/src/components/base-page/WasteWater/WasteWaterDayChart.vue
+++ b/src/components/base-page/WasteWater/WasteWaterDayChart.vue
@@ -100,6 +100,9 @@
},
async draw24Chart () {
const data = {
+ poltSourceId: '',
+ poltMtrlId: '',
+ emissTypeId: '',
onLineMonEmissPointId: 23,
monItemId: 28,
beginTime: this.formData.timeStart,
diff --git a/src/components/base-page/WasteWater/WasteWaterHoursChart.vue b/src/components/base-page/WasteWater/WasteWaterHoursChart.vue
index 765f402..2acfe80 100644
--- a/src/components/base-page/WasteWater/WasteWaterHoursChart.vue
+++ b/src/components/base-page/WasteWater/WasteWaterHoursChart.vue
@@ -79,8 +79,8 @@
formData: {
region: '25',
regionList: [25, 50, 75, 100],
- startTime: dayjs().subtract(16, 'hour').format('YYYY-MM-DD HH'),
- endTime: dayjs().format('YYYY-MM-DD HH')
+ startTime: dayjs().subtract(24, 'hour').format('YYYY-MM-DD HH:mm:ss'),
+ endTime: dayjs().format('YYYY-MM-DD HH:mm:ss')
},
chart: null,
jcdID: 1,
@@ -101,6 +101,9 @@
// 鍒濆鍖栨暟鎹姹�
async draw24Chart () {
const data = {
+ poltSourceId: '',
+ poltMtrlId: '',
+ emissTypeId: '',
onLineMonEmissPointId: 23,
monItemId: 28,
beginTime: this.formData.startTime,
@@ -327,12 +330,14 @@
biaozhuiz = bzzList[i].bzhui
}
}
- if (c.value[1] > biaozhuiz) {
- return zdcbcolor
- } else if (c.value[1] > biaozhuiz * 0.9) {
- return '#FFA500'
- } else {
- return '#33c95f'
+ if (c.value) {
+ if (c.value[1] > biaozhuiz) {
+ return zdcbcolor
+ } else if (c.value[1] > biaozhuiz * 0.9) {
+ return '#FFA500'
+ } else {
+ return '#33c95f'
+ }
}
},
lineStyle: { // 鎶樼嚎鐨勯鑹�
diff --git a/src/components/base-page/enterprise-emergency/events-reported/EventsReported.vue b/src/components/base-page/enterprise-emergency/events-reported/EventsReported.vue
index 934a193..5184ed2 100644
--- a/src/components/base-page/enterprise-emergency/events-reported/EventsReported.vue
+++ b/src/components/base-page/enterprise-emergency/events-reported/EventsReported.vue
@@ -132,7 +132,8 @@
</el-form-item>
</el-form>
<el-dialog
- custom-class="el-dialog--center"
+ custom-class="event-report-dialog"
+ title="浜嬪彂浣嶇疆瀹氫綅"
:visible.sync="dialogLocation"
:append-to-body="true"
:modal="false"
@@ -384,7 +385,7 @@
/* margin-left: 6.4rem !important;*/
/*}*/
- /deep/ .el-dialog--center {
+ /deep/ .event-report-dialog {
left: 5rem;
top: 1rem;
margin-top: 2rem;
@@ -392,6 +393,8 @@
}
/deep/ .el-dialog {
+ left: 5rem;
+ top: 1rem;
width: 3.087834rem;
}
diff --git a/src/components/base-page/enterprise-emergency/events-reported/ReportLocation.vue b/src/components/base-page/enterprise-emergency/events-reported/ReportLocation.vue
index bfb60e1..3e8e096 100644
--- a/src/components/base-page/enterprise-emergency/events-reported/ReportLocation.vue
+++ b/src/components/base-page/enterprise-emergency/events-reported/ReportLocation.vue
@@ -1,42 +1,33 @@
<template>
<div class="report-location-box">
- <div class="report-location">
- <el-tabs v-model="activeName">
- <el-tab-pane label="鐐瑰嚮瀹氫綅" name="first">
- <div class="click-location">
- <el-row>
- <el-input type="text" v-model="clickLocation" clearable @focus="focusLocation"></el-input>
- </el-row>
- <el-row>
- <el-button type="primary" @click="confirm">纭</el-button>
- </el-row>
+ <el-tabs v-model="activeName">
+ <el-tab-pane label="鎼滅储瀹氫綅" name="first">
+ <ReportLocationSearch></ReportLocationSearch>
+ </el-tab-pane>
+ <el-tab-pane label="绠℃瀹氫綅" name="second">
+ <ReportLocationSection></ReportLocationSection>
+ </el-tab-pane>
+ <el-tab-pane label="缁忕含搴﹀畾浣�" name="third">
+ <el-row class="place-box">
+ <div class="place-left">
+ <el-form :model="LongLatPos" label-width="90px">
+ <el-form-item label="缁忓害:">
+ <el-input v-model="LongLatPos.longPos"></el-input>
+ </el-form-item>
+ <el-form-item label="绾害:">
+ <el-input v-model="LongLatPos.latPos"></el-input>
+ </el-form-item>
+ </el-form>
</div>
- </el-tab-pane>
- <el-tab-pane label="绠℃瀹氫綅" name="second">
- <ReportLocationSection></ReportLocationSection>
- </el-tab-pane>
- <el-tab-pane label="缁忕含搴﹀畾浣�" name="third">
- <el-row class="place-box">
- <div class="place-left">
- <el-form :model="LongLatPos" label-width="90px">
- <el-form-item label="缁忓害:">
- <el-input v-model="LongLatPos.longPos"></el-input>
- </el-form-item>
- <el-form-item label="绾害:">
- <el-input v-model="LongLatPos.latPos"></el-input>
- </el-form-item>
- </el-form>
- </div>
- <div class="place-right">
- <el-button type="primary" @click="mapPoints">瀹氫綅</el-button>
- </div>
- </el-row>
- <div class="place-bottom" style="text-align: center;margin: 10px">
- <el-button type="primary" @click="confirm">纭</el-button>
+ <div class="place-right">
+ <el-button type="primary" @click="mapPoints">瀹氫綅</el-button>
</div>
- </el-tab-pane>
- </el-tabs>
- </div>
+ </el-row>
+ <div class="place-bottom" style="text-align: center;margin: 5px">
+ <el-button type="primary" @click="confirm">纭</el-button>
+ </div>
+ </el-tab-pane>
+ </el-tabs>
</div>
</template>
@@ -44,18 +35,20 @@
// import eventBus from '../../../../eventBus'
// 绠℃瀹氫綅缁勪欢
import ReportLocationSection from './ReportLocationSection'
+import ReportLocationSearch from './ReportLocationSearch'
+
+import iconUrl from '../../../../../public/assets/images/map/loc.png'
export default {
name: 'ReportLocation',
components: {
+ ReportLocationSearch,
ReportLocationSection
},
data () {
return {
// active tab鍒囨崲
activeName: 'first',
- // 鐐瑰嚮瀹氫綅缁戝畾鏁版嵁
- clickLocation: '',
// 缁忕含搴﹀畾浣�
LongLatPos: {
longPos: '',
@@ -81,6 +74,9 @@
// const point = [e.latlng.lng, e.latlng.lat]
const pointX = e.latlng.lng
const pointY = e.latlng.lat
+ // let marker = window.L.marker(point,{
+ //
+ // })
this.clickLocation = '\'' + pointX + '\'' + pointY + ''
this.mapPointResult(e)
},
@@ -88,6 +84,16 @@
console.log(e)
this.LongLatPos.longPos = e.latlng.lng
this.LongLatPos.latPos = e.latlng.lat
+ const as = [e.latlng.lat, e.latlng.lng]
+ // console.log(as)
+ const marker = window.L.marker(as, {
+ icon: window.L.icon({
+ iconUrl: iconUrl,
+ iconSize: [30, 30],
+ iconAnchor: [15, 15]
+ })
+ })
+ window.map.addLayer(marker)
},
// 鑾峰緱鐒︾偣 杩涜瀹氫綅
focusLocation () {
@@ -115,19 +121,7 @@
align-items: center;
justify-content: space-around;
}
- .click-location {
- margin: 0 auto;
- text-align: center;
- .el-input {
- width: 80%;
- margin: 15px auto;
- }
-
- .el-button {
- margin: 15px auto;
- }
- }
.place {
text-align: center;
diff --git a/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSearch.vue b/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSearch.vue
new file mode 100644
index 0000000..ba23015
--- /dev/null
+++ b/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSearch.vue
@@ -0,0 +1,82 @@
+<template>
+ <div class="click-location">
+ <el-row>
+ <el-input type="text" v-model="clickLocation" clearable @change="focusLocation"></el-input>
+ </el-row>
+ <el-row>
+ <el-button type="primary" @click="confirm" style="text-align: right">纭</el-button>
+ </el-row>
+ </div>
+</template>
+
+<script>
+
+import { reportLocationSearch } from '../../../../api/request'
+import { pulseEffect } from '../../../../utils/utils'
+export default {
+ name: 'ReportLocationSearch',
+ data () {
+ return {
+ // 鐐瑰嚮瀹氫綅缁戝畾鏁版嵁
+ clickLocation: ''
+ }
+ },
+ methods: {
+ // 鑾峰緱鐒︾偣 杩涜瀹氫綅
+ focusLocation () {
+ // console.log(this.clickLocation)
+ // console.log(window.map.getZoom())
+ // console.log(window.map.getBounds())
+ const getBoundsData = '' + window.map.getBounds()._southWest.lng + ',' + window.map.getBounds()._southWest.lat + ',' + window.map.getBounds()._northEast.lng + ',' + window.map.getBounds()._northEast.lat
+ const data = {
+ postStr: {
+ keyWord: this.clickLocation,
+ level: window.map.getZoom(),
+ mapBound: getBoundsData,
+ queryType: 7,
+ count: 14,
+ start: 0,
+ queryTerminal: 10000
+ },
+ type: 'query'
+ }
+ // console.log(data)
+ reportLocationSearch(data).then(res => {
+ console.log(res)
+ // const as = res.pois[0].lonlat.trim().split(' ')
+ // window.map.setView([as[1], as[0]], 17)
+ // pulseEffect([as[1], as[0]])
+ for (let i = 0; i < res.pois.length; i++) {
+ const as = res.pois[i].lonlat.trim().split(' ')
+ if (res.pois[i].name.indexOf(this.clickLocation) >= 0) {
+ window.map.setView([as[1], as[0]], 17)
+ pulseEffect([as[1], as[0]])
+ }
+ }
+ })
+ },
+ // 鐐瑰嚮纭鎸夐挳浜嬩欢
+ confirm () {
+ // 閫氳繃瀛愮粍浠跺悜鐖剁粍浠朵紶閫掓暟鎹�
+ this.$emit('locationClick', this.LongLatPos)
+ console.log('鎼滅储瀹氫綅')
+ }
+ }
+}
+</script>
+
+<style lang="less" scoped>
+ .click-location {
+ margin: 0 auto;
+ text-align: center;
+
+ .el-input {
+ width: 80%;
+ margin: 15px auto;
+ }
+
+ .el-button {
+ margin: 15px auto;
+ }
+ }
+</style>
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..0b57216 100644
--- a/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue
+++ b/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue
@@ -12,7 +12,8 @@
</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>
@@ -30,12 +31,12 @@
</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 +51,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 +67,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,19 +106,29 @@
</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%">
+ max-height="100"
+ style="width: 100%">
+ <el-table-column
+ show-overflow-tooltip
+ prop="properties.code"
+ label="闄勫睘璁炬柦缂栧彿">
+ </el-table-column>
<el-table-column
show-overflow-tooltip
prop="properties.name"
label="闄勫睘璁炬柦鍚嶇О">
</el-table-column>
+ <!-- <el-table-column-->
+ <!-- show-overflow-tooltip-->
+ <!-- prop="properties.measattribute"-->
+ <!-- label="闄勫睘璁炬柦鍚嶇О">-->
+ <!-- </el-table-column>-->
<el-table-column
show-overflow-tooltip
prop="properties.type"
@@ -126,21 +142,21 @@
</el-table>
</el-card>
</div>
- <el-row style="text-align: center;margin: 10px">
+ <el-row style="text-align: right;margin: 10px">
<el-button type="primary" @click="confirm">纭</el-button>
</el-row>
</div>
</template>
<script>
-import WfsHelper from '@components/helpers/WfsHelper'
-import AjaxUtils from '@utils/AjaxUtils'
+
// import { pulseEffect } from '../../../../utils/utils'
// import mapApi from '../../../../api/mapApi'
-
+import WfsHelper from '@components/helpers/WfsHelper'
+import AjaxUtils from '@utils/AjaxUtils'
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',
@@ -157,111 +173,226 @@
tableListSection: [],
// 闄勫睘璁炬柦鏌ヨ鍒楄〃鏁版嵁
tableDataAffFac: [],
- // 鍒嗛〉鍔熻兘
- pageSize: 3,
- total: 0,
- currentPage: 1
+ // 瀹氫箟绫诲瀷鍒ゆ柇 if 鏄悳绱㈠埌鐨勬暟鎹彲浠ヨ繘琛岀绾块�夋嫨 else 鐐瑰嚮瀹氫綅閫夋嫨鐨勭绾夸笉鍙互杩涜閫夋嫨
+ SectionAndAffFacTableJudge: false,
+ locateJudgmentSearch: false
}
},
mounted () {
this.wfsHelper = new WfsHelper()
},
methods: {
- // 鐐瑰嚮绠$嚎鍒楄〃 灞曠ず绠℃鍐呭
+ // 鐐瑰嚮绠$嚎鍒楄〃 灞曠ず绠℃鍐呭 鍜岄檮灞炶鏂藉唴瀹�
async sectionShowClick (val) {
console.log(val)
- // 绠℃鏌ヨ
- const sectionNameSearch = val.properties.pipename
- this.tableListSection = []
- this.wfsHelper.clearFilter()
- this.wfsHelper.setTypeName(['sewer:pipesegment'])
- this.wfsHelper.addLike('pipename', sectionNameSearch)
- this.wfsHelper.addEquals('pipename', '\'' + sectionNameSearch + '\'')
- const res = await AjaxUtils.GetDataAsynByUrl(this.wfsHelper.getUrl(), {})
- // console.log(res)
- if (res instanceof Object && Object.prototype.hasOwnProperty.call(res, 'features')) {
- this.tableListSection = res.features
+ // 濡傛灉 SectionAndAffFacTableJudge === true 鏄悳绱㈡暟鎹粨鏋滅殑鍒楄〃 鍙互杩涜 绠℃ 闄勫睘璁炬柦浜や簰 鐐瑰嚮瀹氫綅鏌ヨ缁撴灉 涓嶈繘琛岀偣鍑讳氦浜�
+ if (this.SectionAndAffFacTableJudge === true) {
+ // 绠℃鏌ヨ
+ const sectionNameSearch = val.properties.pipename
+ this.tableListSection = []
+ this.wfsHelper.clearFilter()
+ this.wfsHelper.setTypeName(['sewer:pipesegment'])
+ this.wfsHelper.addLike('pipename', sectionNameSearch)
+ this.wfsHelper.addEquals('pipename', '\'' + sectionNameSearch + '\'')
+ const res = await AjaxUtils.GetDataAsynByUrl(this.wfsHelper.getUrl(), {})
+ // console.log(res)
+ if (res instanceof Object && Object.prototype.hasOwnProperty.call(res, 'features')) {
+ this.tableListSection = res.features
+ }
+ this.wfsHelper = new WfsHelper()
+ // 闄勫睘璁炬柦鏌ヨ
+ this.tableDataAffFac = []
+ const AffFacSearch = val.properties.pipecode
+ console.log(AffFacSearch)
+ this.wfsHelper.clearFilter()
+ this.wfsHelper.setTypeName(['sewer:view_pipeline'])
+ 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])
+ // }
+ this.tableDataAffFac = resAffFac.features
+ }
+ this.wfsHelper = new WfsHelper()
}
- this.wfsHelper = new WfsHelper()
- // 闄勫睘璁炬柦鏌ヨ
- this.tableDataAffFac = []
- const AffFacSearch = val.properties.pipename
- this.wfsHelper.clearFilter()
- this.wfsHelper.setTypeName(['sewer:view_pipeline'])
- this.wfsHelper.addLike('name', AffFacSearch)
- this.wfsHelper.addEquals('name', '\'' + 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
- }
- this.wfsHelper = new WfsHelper()
},
// 鐐瑰嚮绠℃鍒楄〃 绠℃缂栫爜浼犻��
sectionCode (val) {
- console.log(val)
+ // console.log(val)
this.form.sectionName = val.properties.pipecode
},
// 鐐瑰嚮闄勫睘璁炬柦鍒楄〃 绠℃缂栫爜浼犻��
affFacName (val) {
- console.log(val)
+ // console.log(val)
this.form.affiliatedFacilities = val.properties.name
},
// 瀹氫綅鍔熻兘
localAdr (val) {
+ console.log(val)
fitBounds(val)
highlight(val)
},
- // 绠$嚎鐐瑰嚮鐐瑰嚮瀹氫綅鍔熻兘
+ // 绠$嚎 鐐瑰嚮瀹氫綅绠℃鐨勯�夋嫨鍔熻兘
pipeClickLocation () {
- // console.log('val')
- // this.selectPipeLine()
+ // 璁炬柦涓嶈繘琛� 绠$嚎琛ㄦ牸鏁版嵁鐨勭偣鍑讳氦浜�
+ this.SectionAndAffFacTableJudge = false
window.mapManager.clickDialogSwitch = false
- this.tableList = []
+ // 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)
+ // 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: 'sewer:pipeline',
+ QUERY_LAYERS: 'sewer:pipeline',
+ 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.sectionName = ''
+ this.form.affiliatedFacilities = ''
+ },
+ // 鐐瑰嚮瀹氫綅 鎿﹀绠℃
+ sectionData (e) {
+ const size = window.map.getSize()
+ var point = window.map.latLngToContainerPoint(e.latlng, window.map.getZoom())
+ const wmsParams = Object.assign({
+ LAYERS: 'sewer:pipesegment',
+ QUERY_LAYERS: 'sewer:pipesegment',
+ 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++) {
+ this.tableListSection.push(res.data.features[i])
+ }
+ })
+ },
+ // 闄勫睘璁炬柦
+ affFacData (e) {
+ const size = window.map.getSize()
+ var point = window.map.latLngToContainerPoint(e.latlng, window.map.getZoom())
+ const wmsParams = Object.assign({
+ LAYERS: 'sewer:view_pipeline',
+ QUERY_LAYERS: 'sewer:view_pipeline',
+ 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++) {
+ this.tableDataAffFac.push(res.data.features[i])
+ }
})
},
// 绠$嚎鎼滅储
async pipelineSearch () {
- // this.pipeTable = !this.pipeTable
+ this.SectionAndAffFacTableJudge = true
this.tableList = []
+ this.tableListSection = []
+ this.tableDataAffFac = []
this.wfsHelper.clearFilter()
this.wfsHelper.setTypeName(['sewer:pipeline'])
if (this.form.pipeName) {
- this.wfsHelper.addLike('name', this.form.pipeName)
+ this.wfsHelper.addLike('pipename', this.form.pipeName)
}
- // this.wfsHelper.addEquals('type', '\'' + this.form.pipeName + '\'')
+ // this.wfsHelper.addEquals('pipename', '\'' + this.form.pipeName + '\'')
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.total = res.totalFeatures
// console.log(res.features)
this.tableList = res.features
}
this.wfsHelper = new WfsHelper()
- },
- // 鍒嗛〉鍔熻兘 currentPage 鏀瑰彉鏃朵細瑙﹀彂
- handlePage (val) {
- // console.log(val)
- this.currentPage = val
- },
- // 鍒嗛〉鍔熻兘 pageSize 鏀瑰彉鏃朵細瑙﹀彂
- handleSizeChange (val) {
- // console.log(val)
- this.pageSize = val
+ // this.form.pipeName = ''
+ this.form.sectionName = ''
+ this.form.affiliatedFacilities = ''
},
// 鐐瑰嚮纭
confirm () {
- console.log('鐐瑰嚮纭畾閫夋嫨瀹屾垚')
+ // console.log('鐐瑰嚮纭畾閫夋嫨瀹屾垚')
eventBus.$emit('section-search', true)
+ this.form.pipeName = ''
+ this.form.sectionName = ''
+ this.form.affiliatedFacilities = ''
+ this.tableList = []
+ this.tableListSection = []
+ this.tableDataAffFac = []
+ this.SectionAndAffFacTableJudge = false
}
}
}
@@ -282,18 +413,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;
}
}
}
diff --git a/src/utils/axios.js b/src/utils/axios.js
index 47300fe..cca3604 100644
--- a/src/utils/axios.js
+++ b/src/utils/axios.js
@@ -191,11 +191,12 @@
params: $T.filterParams(params)
})
}
-$http.post = function (url, data = {}) {
+$http.post = function (url, data = {}, setHeaders) {
return Service({
url: url,
method: 'post',
- data: data
+ data: data,
+ headers: setHeaders || { 'Content-Type': 'application/json; charset=UTF-8' }
})
}
$http.put = function (url, data = {}) {
--
Gitblit v1.8.0