From b187fa62b3e02d8417d73139dcf3e2271268788d Mon Sep 17 00:00:00 2001
From: 陈泽平 <chenzeping>
Date: 星期五, 21 五月 2021 09:00:42 +0800
Subject: [PATCH] 管线分析功能问题修改
---
/dev/null | 54 ------------------
src/components/panel/topicSearch/SewersSelect/AnalysisChoose/Tube.vue | 39 +++++++++---
src/components/panel/topicSearch/SewersSelect/AnalysisChoose/Flow.vue | 43 ++++++++++---
src/components/panel/topicSearch/SewersSelect/AnalysisChoose/PublicWay.js | 11 +++
src/components/panel/topicSearch/SewersSelect/AnalysisChoose/CrossSectional.vue | 15 +++-
src/components/panel/topicSearch/SewersSearch.vue | 12 ++--
src/components/panel/topicSearch/SewersSelect/SewersAnalysis.vue | 5 -
7 files changed, 90 insertions(+), 89 deletions(-)
diff --git a/src/components/panel/topicSearch/SewersSearch.vue b/src/components/panel/topicSearch/SewersSearch.vue
index 1948348..ebcf873 100644
--- a/src/components/panel/topicSearch/SewersSearch.vue
+++ b/src/components/panel/topicSearch/SewersSearch.vue
@@ -171,18 +171,18 @@
// 鎼滅储鍔熻兘
async handleSearch () {
// console.log(this.form.dataType.sname, this.form.keyword)
+ // console.log(this.form)
this.list = []
this.wfsHelper.clearFilter()
// todo 鐜板湪绠$綉杩樻病鍖哄垎寮�绫诲瀷锛屽悗闈㈡敼
this.wfsHelper.setTypeName([this.form.dataType.typeName])
if (this.form.keyword) {
- this.wfsHelper.addLike('name', this.form.keyword)
- this.wfsHelper.setFilter(this.form.keyword)
+ this.wfsHelper.addLike('pipename', this.form.keyword)
}
- // const filter = this.form.dataType.filter
- // if (filter) {
- // this.wfsHelper.setFilter(filter)
- // }
+ const filter = this.form.dataType.filter
+ if (filter) {
+ this.wfsHelper.setFilter(filter)
+ }
// const _this = this
const res = await AjaxUtils.GetDataAsynByUrl(this.wfsHelper.getUrl(), {})
if (res instanceof Object && Object.prototype.hasOwnProperty.call(res, 'features')) {
diff --git a/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/CrossSectional.vue b/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/CrossSectional.vue
index 918f08e..a0c7fce 100644
--- a/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/CrossSectional.vue
+++ b/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/CrossSectional.vue
@@ -12,7 +12,7 @@
<el-table-column prop="mediumtype" label="浠嬭川绫诲瀷" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="x" label="鏂潰(缁忓害)" :show-overflow-tooltip="true" width="80"></el-table-column>
<el-table-column prop="y" label="鏂潰(绾害)" :show-overflow-tooltip="true" width="80"></el-table-column>
- <el-table-column prop="z" label="鏂潰(楂樼▼)" :show-overflow-tooltip="true" width="80"></el-table-column>
+ <el-table-column prop="z" label="鏂潰楂樼▼(m)" :show-overflow-tooltip="true" width="80"></el-table-column>
<el-table-column prop="spacing" label="闂磋窛(m)" width="80"></el-table-column>
</el-table>
<span class="fixed-style">鏂潰鍥�</span>
@@ -47,6 +47,13 @@
// 浣跨敤 DrwLine鏂规硶
eventBus.$on('draw-hdm-line', (points) => {
this.getHdmPoint(points)
+ })
+ this.$nextTick(() => {
+ eventBus.$on('tabData-change', (obj) => {
+ if (obj) {
+ this.jdmClear()
+ }
+ })
})
},
methods: {
@@ -86,9 +93,9 @@
for (let i = 0; i < dataPoint.length; i++) {
const obj = {
mediumtype: dataPoint[i].pipelines.extraData.mediumtype,
- x: parseFloat(dataPoint[i].crossPoint3D.x).toFixed(4),
- y: parseFloat(dataPoint[i].crossPoint3D.y).toFixed(4),
- z: parseFloat(dataPoint[i].crossPoint3D.z).toFixed(4),
+ x: parseFloat(dataPoint[i].crossPoint3D.x).toFixed(8),
+ y: parseFloat(dataPoint[i].crossPoint3D.y).toFixed(8),
+ z: parseFloat(dataPoint[i].crossPoint3D.z).toFixed(2),
spacing: spacingList[i - 1]
}
this.tableData.push(obj)
diff --git a/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/DrawLine.js b/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/DrawLine.js
deleted file mode 100644
index 386bdb3..0000000
--- a/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/DrawLine.js
+++ /dev/null
@@ -1,54 +0,0 @@
-import L from 'leaflet'
-import eventBus from '../../../../../eventBus'
-
-class DrawLine {
- constructor (map) {
- this.points = []
- this.color = 'red'
- this.layers = L.layerGroup()
- this.polyline = null
- this.marker = null
- this.points = []
- this.polyline = null
- this.marker = null
- this.map = map
- }
-
- init = () => {
- this.map.on('click', this.click)
- this.map.on('mousemove', this.mousemove)
- this.map.on('dblclick', this.dbClick)
- }
-
- click = (e) => {
- this.map.doubleClickZoom.disable()
- this.points.push(e.latlng)
- if (this.points.length > 1) {
- this.dbClick()
- }
- }
-
- mousemove = (e) => {
- this.points.push(e.latlng)
- if (this.polyline) { this.map.removeLayer(this.polyline) }
- this.polyline = L.polyline(this.points, { showMeasurements: false, color: 'red' })
- this.polyline.addTo(this.layers)
- this.layers.addTo(this.map)
- this.points.pop()
- }
-
- dbClick = (e) => {
- this.polyline.addTo(this.layers)
- this.map.off('click', this.click).off('mousemove', this.mousemove).off('dblclick', this.dbClick)
- eventBus.$emit('draw-hdm-line', this.points)
- }
-
- destory () {
- if (this.polyline) { this.map.removeLayer(this.polyline) }
- if (this.marker) { this.marker.remove() }
- this.points = []
- this.layers.clearLayers()
- }
-}
-
-export default DrawLine
diff --git a/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/Flow.vue b/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/Flow.vue
index f32daad..aead8c4 100644
--- a/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/Flow.vue
+++ b/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/Flow.vue
@@ -39,6 +39,7 @@
<script>
import mapApi from '../../../../../api/mapApi'
import { createFlowLine } from './PublicWay'
+import eventBus from '../../../../../eventBus'
export default {
name: 'Flow',
@@ -48,27 +49,43 @@
tableDataLiuxiang: [],
// 娴佸悜 鍒嗘瀽缁撴灉 鐨則able琛ㄦ牸鏁版嵁
lxTableDataResult: [],
- linkPipeline: []
+ linkPipeline: [],
+ currentSelectResultLine: null
}
+ },
+ mounted () {
+ this.$nextTick(() => {
+ eventBus.$on('tabData-change', (obj) => {
+ if (obj) {
+ this.handleClick()
+ }
+ })
+ })
},
methods: {
// tab鍒囨崲
- handleClick (tab, event) {
- console.log(event)
- // console.log(tab)
- this.clearLinkPipe()
+ handleClick () {
this.clearLX()
this.linkClear()
- this.jdmClear()
- this.currentLinkIsTrue = ''
- this.bgFm = []
- this.bgPipeLine = []
- this.tableData = []
this.tableDataLiuxiang = []
this.tableDataLinkStart = []
this.tableDataLinkEnd = []
this.tableDataLinkResult = []
this.lxTableDataResult = []
+ },
+ linkClear () {
+ if (this.currentSelectStartLine != null) {
+ this.currentSelectStartLine.remove()
+ this.currentSelectStartLine = null
+ }
+ if (this.currentSelectEndLine != null) {
+ this.currentSelectEndLine.remove()
+ this.currentSelectEndLine = null
+ }
+ if (this.currentSelectResultLine != null) {
+ this.currentSelectResultLine.remove()
+ this.currentSelectResultLine = null
+ }
},
// 瀹氫綅鏂规硶浜嬩欢
linkResultSelect (e) {
@@ -145,7 +162,7 @@
},
// 鐐瑰嚮鏄剧ず娴佸悜 table鍒楄〃涓殑鏁版嵁 => 杩涜瀹樼綉娴佸悜鐨勬樉绀�
async lxQuery (e) {
- console.log(e)
+ // console.log(e)
this.clearLinkPipe()
const param = {
// lineNodeID: e.startpoint
@@ -182,6 +199,10 @@
this.flowPipeLine.remove()
this.flowPipeLine = null
}
+ if (this.currentSelectResultLine != null) {
+ this.currentSelectResultLine.remove()
+ this.currentSelectResultLine = null
+ }
}
}
}
diff --git a/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/PublicWay.js b/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/PublicWay.js
index 933302b..81573d0 100644
--- a/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/PublicWay.js
+++ b/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/PublicWay.js
@@ -1,5 +1,16 @@
+export function selectPipeLine () {
+ window.map.on('click', this.selectClick)
+}
+
export function createFlowLine (param) {
const flowLine = window.L.polyline(param.points, param.option)
flowLine.addTo(window.map)
return flowLine
}
+
+export function linkClear (linkClear) {
+ if (this.linkClear != null) {
+ this.linkClear.remove()
+ this.linkClear = null
+ }
+}
diff --git a/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/Tube.vue b/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/Tube.vue
index 5f49873..11ae76b 100644
--- a/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/Tube.vue
+++ b/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/Tube.vue
@@ -46,6 +46,7 @@
import mapApi from '../../../../../api/mapApi'
import { pulseEffect } from '../../../../../utils/utils'
import { createFlowLine } from './PublicWay'
+import eventBus from '../../../../../eventBus'
export default {
name: 'Tube',
@@ -58,26 +59,38 @@
bgPipeLine: [],
// 鐖嗙 闇�瑕佸叧闂殑闃�闂� table琛ㄦ牸鏁版嵁
bgFm: [],
- linkPipeline: []
+ linkPipeline: [],
+ currentSelectEndLine: null
}
},
+ mounted () {
+ this.$nextTick(() => {
+ eventBus.$on('tabData-change', (obj) => {
+ if (obj) {
+ this.handleClick()
+ }
+ })
+ })
+ },
methods: {
- handleClick (tab, event) {
- console.log(event)
- // console.log(tab)
+ handleClick () {
this.clearLinkPipe()
- this.currentLinkIsTrue = ''
+ this.linkClear()
this.bgFm = []
this.bgPipeLine = []
- this.tableData = []
- this.tableDataLiuxiang = []
- this.tableDataLinkStart = []
- this.tableDataLinkEnd = []
- this.tableDataLinkResult = []
- this.lxTableDataResult = []
+ },
+ linkClear () {
+ if (this.currentSelectStartLine != null) {
+ this.currentSelectStartLine.remove()
+ this.currentSelectStartLine = null
+ }
if (this.currentSelectEndLine != null) {
this.currentSelectEndLine.remove()
this.currentSelectEndLine = null
+ }
+ if (this.currentSelectResultLine != null) {
+ this.currentSelectResultLine.remove()
+ this.currentSelectResultLine = null
}
},
// 鍦板浘涓婄偣鍑�
@@ -113,6 +126,10 @@
})
}
this.linkPipeline = []
+ if (this.currentSelectEndLine != null) {
+ this.currentSelectEndLine.remove()
+ this.currentSelectEndLine = null
+ }
},
// 鐖嗙 ===> 閫夋嫨绠℃
bgClick () {
diff --git a/src/components/panel/topicSearch/SewersSelect/SewersAnalysis.vue b/src/components/panel/topicSearch/SewersSelect/SewersAnalysis.vue
index b163263..dba9bd3 100644
--- a/src/components/panel/topicSearch/SewersSelect/SewersAnalysis.vue
+++ b/src/components/panel/topicSearch/SewersSelect/SewersAnalysis.vue
@@ -36,13 +36,12 @@
return {
// 鍦板浘鐐瑰嚮绫诲瀷 first杩為�氭�х偣鍑� second鐖嗙鐐瑰嚮 third娴佸悜鐐瑰嚮 fourth妯柇闈�
activeName: 'first',
- tableData: false,
- tableDataList: []
+ tableData: false
}
},
methods: {
// tab鍒囨崲
- handleClick (tab, event) {
+ handleClick () {
eventBus.$emit('tabData-change', true)
}
}
--
Gitblit v1.8.0