派生自 wuyushui/SewerAndRainNetwork

徐旺旺
2021-05-21 e2bf4ab5fbcc29209d74101d99c0690d4ffbe234
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: [],
      // 流向 分析结果 的table表格数据
      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()
        })
      }
    }
  }
}