From e2bf4ab5fbcc29209d74101d99c0690d4ffbe234 Mon Sep 17 00:00:00 2001 From: 徐旺旺 <11530253@qq.com> Date: 星期五, 21 五月 2021 17:14:56 +0800 Subject: [PATCH] Merge branch 'develop' of http://xearth.cn:6600/r/wuyushui/SewerAndRainNetwork into develop --- src/components/panel/topicSearch/SewersSelect/AnalysisChoose/Flow.vue | 54 ++++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 42 insertions(+), 12 deletions(-) diff --git a/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/Flow.vue b/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/Flow.vue index f32daad..fb55bd6 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 @@ -158,7 +175,11 @@ const geom = JSON.parse(itm.geomText) const points = [] geom.coordinates.forEach((it, id) => { - points.push(it.reverse()) + const item = it.reverse() + if (it.length > 2) { + item.shift() + } + points.push(item) }) linkPipe.push(points) }) @@ -182,6 +203,15 @@ this.flowPipeLine.remove() this.flowPipeLine = null } + if (this.currentSelectResultLine != null) { + this.currentSelectResultLine.remove() + this.currentSelectResultLine = null + } + if (this.linkPipeline.length > 0) { + this.linkPipeline.forEach((itm, idx) => { + itm.remove() + }) + } } } } -- Gitblit v1.8.0