| | |
| | | methods: { |
| | | // 地图上点击 |
| | | selectPipeLine () { |
| | | // window.mapManager.clickDialogSwitch = false |
| | | window.map.on('click', this.selectClick) |
| | | // 关闭弹窗 |
| | | window.layerFactory.clickSwitch = false |
| | | // window.mapManager.clickDialogSwitch = true |
| | | }, |
| | | // 地图上点击回调 |
| | | selectClick (e) { |
| | | // console.log(e) |
| | | window.map.off('click', this.selectClick) |
| | | const point = [e.latlng.lng, e.latlng.lat] |
| | | this.getPipeLine(point) |
| | |
| | | } |
| | | // 根据参数请求接口数据 |
| | | const res = await mapApi.findPipelineByClickPoint(param) |
| | | // console.log(res) |
| | | console.log(res) |
| | | if (this.linkType === 1) { |
| | | this.tableDataLinkStart = res.data |
| | | } else { |
| | |
| | | }, |
| | | // 连通性 ===> 地图点击起始管段e |
| | | linkClickStart (e) { |
| | | // console.log('地图点击起始管段') |
| | | this.linkType = 1 |
| | | this.selectPipeLine() |
| | | }, |
| | |
| | | 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) |
| | | }) |