| | |
| | | }) |
| | | }, |
| | | methods: { |
| | | // 横断面清除 |
| | | jdmClear () { |
| | | this.hdmParam = null |
| | | this.tableData = [] |
| | | this.option = [] |
| | | this.myChartShow = false |
| | | this.myChart.clear() |
| | | if (this.measure != null) { |
| | | this.measure.destory() |
| | | } |
| | | }, |
| | | // 横断面 线段绘制 |
| | | drawLine () { |
| | | if (this.measure === null) { |
| | |
| | | } |
| | | // 已绘制线图 进行绘制横断面数据分析 |
| | | const res = await mapApi.getCrossSection(this.hdmParam) |
| | | // 调用数据处理方法 |
| | | this.dealWithData(res) |
| | | // // 调用数据处理方法 |
| | | // this.dealWithData(res) |
| | | // table数据处理 |
| | | const dataPoint = res.data.point |
| | | // 存储间距list |
| | |
| | | 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] |
| | | spacing: spacingList[i - 1], |
| | | startpointz: dataPoint[i].pipelines.extraData.startpointz, |
| | | diameter: dataPoint[i].pipelines.extraData.diameter |
| | | } |
| | | this.tableData.push(obj) |
| | | } |
| | | // 调用数据处理方法 |
| | | this.dealWithData(this.tableData) |
| | | }, |
| | | // 对获取到的数据进行处理 |
| | | dealWithData (e) { |
| | | console.log(e) |
| | | const dataPoint = e.data.point |
| | | const spacingList = e.data.pointInterval.reverse() |
| | | const dataList = [] |
| | | for (let i = 0; i < dataPoint.length; i++) { |
| | | const obj = { |
| | | mediumtype: dataPoint[i].pipelines.extraData.mediumtype, |
| | | startpointz: dataPoint[i].pipelines.extraData.startpointz, |
| | | diameter: dataPoint[i].pipelines.extraData.diameter, |
| | | spacing: spacingList[i - 1], |
| | | x: parseFloat(dataPoint[i].crossPoint3D.x).toFixed(8), |
| | | y: parseFloat(dataPoint[i].crossPoint3D.y).toFixed(8), |
| | | z: parseFloat(dataPoint[i].crossPoint3D.z).toFixed(2) |
| | | } |
| | | dataList.push(obj) |
| | | } |
| | | dealWithData (dataList) { |
| | | console.log(dataList) |
| | | // const dataPoint = e.data.point |
| | | // const spacingList = e.data.pointInterval.reverse() |
| | | // const dataList = [] |
| | | // for (let i = 0; i < dataPoint.length; i++) { |
| | | // const obj = { |
| | | // mediumtype: dataPoint[i].pipelines.extraData.mediumtype, |
| | | // startpointz: dataPoint[i].pipelines.extraData.startpointz, |
| | | // diameter: dataPoint[i].pipelines.extraData.diameter, |
| | | // spacing: spacingList[i - 1], |
| | | // x: parseFloat(dataPoint[i].crossPoint3D.x).toFixed(8), |
| | | // y: parseFloat(dataPoint[i].crossPoint3D.y).toFixed(8), |
| | | // z: parseFloat(dataPoint[i].crossPoint3D.z).toFixed(2) |
| | | // } |
| | | // dataList.push(obj) |
| | | // } |
| | | // 横向坐标数据 |
| | | const xAxisData = [] |
| | | const dataObj = [] |
| | |
| | | }, |
| | | show: true |
| | | }, |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: '#fff', |
| | | width: 2 |
| | | } |
| | | }, |
| | | // data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], |
| | | data: xAxisData, |
| | | axisLabel: { |
| | | interval: 0, |
| | | textStyle: { |
| | | color: '#fff' |
| | | } |
| | | }, |
| | | margin: 20 |
| | | } |
| | | }, |
| | | yAxis: { |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: '#fff', |
| | | width: 2 |
| | | } |
| | | }, |
| | | axisPointer: { |
| | | snap: true |
| | | }, |
| | |
| | | this.myChartShow = true |
| | | this.myChart.clear() |
| | | this.myChart.setOption(option) |
| | | }, |
| | | // 横断面清除 |
| | | jdmClear () { |
| | | this.hdmParam = null |
| | | this.tableData = [] |
| | | this.option = [] |
| | | this.myChartShow = false |
| | | this.myChart.clear() |
| | | if (this.measure != null) { |
| | | this.measure.destory() |
| | | } |
| | | } |
| | | } |
| | | } |