From c60e56e2b6ceb633c6b10f5dc52e3da88129ad70 Mon Sep 17 00:00:00 2001 From: 陈泽平 <chenzeping> Date: 星期五, 21 五月 2021 17:35:41 +0800 Subject: [PATCH] 管线分析相关功能问题修改 --- src/components/panel/topicSearch/SewersSelect/AnalysisChoose/Tube.vue | 45 +++++++++++++++++++++++++++++++++------------ 1 files changed, 33 insertions(+), 12 deletions(-) diff --git a/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/Tube.vue b/src/components/panel/topicSearch/SewersSelect/AnalysisChoose/Tube.vue index 5f49873..9addf11 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 () { @@ -175,7 +192,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) }) -- Gitblit v1.8.0