|
@@ -2,20 +2,20 @@
|
|
|
<div class="panel-container">
|
|
|
<!-- 纵剖面分析 -->
|
|
|
<div class="op-box">
|
|
|
- <el-button type="primary" size="small" style="width:100%" @click="mapSelect" :loading="loading">标记纵剖面控制点</el-button>
|
|
|
+ <el-button type="primary" size="small" style="width:100%" @click="mapSelect" :loading="loading||doLoading">标记纵剖面控制点</el-button>
|
|
|
<!-- <el-button type="primary" size="small" style="width:100%">标记纵剖面控制点</el-button> -->
|
|
|
</div>
|
|
|
<!-- 分析结果 -->
|
|
|
<div class="result-box">
|
|
|
- <div class="item-head">分析结果</div>
|
|
|
+ <div class="item-head">分析管线</div>
|
|
|
<div class="result-description">
|
|
|
- <div class="result-title">起点管段:<span v-cloak v-if="startPipe.SID">{{selectPipeConfig.name+'-'+startPipe.SID}}</span></div>
|
|
|
- <div>
|
|
|
+ <div class="result-title" v-if="startPipe.SID">起点管段:<span v-cloak>{{selectPipeConfig.name+'-'+startPipe.SID}}</span></div>
|
|
|
+ <div v-if="startPipe.SID">
|
|
|
<span v-cloak v-if="startPipe.MATERIAL">{{'材质:'+startPipe.MATERIAL}}</span>
|
|
|
<span v-cloak v-if="startPipe.DIAMETER" style="margin-left:10px">{{'管径:'+startPipe.DIAMETER}}</span>
|
|
|
</div>
|
|
|
- <div class="result-title">终点管段:<span v-cloak v-if="endPipe.SID">{{selectPipeConfig.name+'-'+endPipe.SID}}</span></div>
|
|
|
- <div>
|
|
|
+ <div class="result-title" v-if="endPipe.SID">终点管段:<span v-cloak>{{selectPipeConfig.name+'-'+endPipe.SID}}</span></div>
|
|
|
+ <div v-if="endPipe.SID">
|
|
|
<span v-cloak v-if="endPipe.MATERIAL">{{'材质:'+endPipe.MATERIAL}}</span>
|
|
|
<span v-cloak v-if="endPipe.DIAMETER" style="margin-left:10px">{{'管径:'+endPipe.DIAMETER}}</span>
|
|
|
</div>
|
|
@@ -32,7 +32,7 @@
|
|
|
<div class="table-chart">
|
|
|
<div class="item-head">管道</div>
|
|
|
<div class="table-container">
|
|
|
- <el-table :data="totalResultTable" stripe max-height="200"
|
|
|
+ <el-table :data="totalResultTable" stripe max-height="200" v-loading="doLoading"
|
|
|
:header-cell-style="{fontSize: '14px', fontWeight:'600',background:'#eaf1fd',color:'#909399'}" style="width: 100%">
|
|
|
<el-table-column prop="name" label="名称" align="center" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column prop="num" label="数量" align="center" show-overflow-tooltip></el-table-column>
|
|
@@ -48,20 +48,6 @@
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- 管网选择 -->
|
|
|
- <el-dialog title="选择管道类型" :visible.sync="dialogVisible" width="30%" :show-close="false" :close-on-click-modal="false">
|
|
|
- <div style="margin-bottom:10px">选择的点有以下<span v-cloak>{{netWorkConfigs.length}}</span>个管道,请选择一个作为起始管段</div>
|
|
|
- <div style="margin-top:10px">
|
|
|
- <ul class="pipe-type-list">
|
|
|
- <li v-for="(item,index) in netWorkConfigs" :key="index">
|
|
|
- <el-radio v-model="selectPipeConfig" :label="item">{{item.name+"("+item.feature.properties.SID+")"}}</el-radio>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- <div style="margin-top:10px;text-align:right">
|
|
|
- <el-button type="primary" size="medium" @click="confirmPipeType">确 认</el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -84,30 +70,96 @@ export default {
|
|
|
props: ['data'],
|
|
|
data() {
|
|
|
return {
|
|
|
- loading: false,
|
|
|
+ doLoading: false,
|
|
|
name: '',
|
|
|
pipeArray: [],
|
|
|
pipeLength: 0,
|
|
|
nodesArray: [],
|
|
|
- pipeDataSet: null,
|
|
|
- netWorkConfigs: [],
|
|
|
- mapClickEvent: null,
|
|
|
- clickType: 0,
|
|
|
- loopConfigNum: 0,
|
|
|
selectPipeConfig: {},
|
|
|
- firstSelectPoint: null,
|
|
|
- secondSelectPoint: null,
|
|
|
startPipe: {},
|
|
|
endPipe: {},
|
|
|
myChart: null,
|
|
|
selectPipeTemp: null,
|
|
|
- dialogVisible: false,
|
|
|
viewType: '3D视图',
|
|
|
- totalResultTable: []
|
|
|
+ totalResultTable: [],
|
|
|
+ selectFlag: false,
|
|
|
+ selectPipeLines: [] //选择的管线
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ pipeDataSet() {
|
|
|
+ return mapConfig.iServerUrl.netWorkConfig;// 获取所有管道网络的分析配置
|
|
|
+ },
|
|
|
+ // 获取点击查询状态
|
|
|
+ loading() {
|
|
|
+ if (this.selectFlag)
|
|
|
+ if (this.data.that.queryByClick.querying)
|
|
|
+ return this.data.that.queryByClick.querying
|
|
|
+ else return false
|
|
|
+ else return false
|
|
|
+ },
|
|
|
+ // 获取点击查询结果
|
|
|
+ resultInfo() {
|
|
|
+ return this.data.that.queryByClick.resultInfo
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ // 监听面板是否被改变
|
|
|
+ '$store.state.map.P_editableTabsValue': function (val, oldVal) {
|
|
|
+ if (val == 'parallelSectionAnalysis') {
|
|
|
+ this.vectorLayer.setVisible(true)
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.vectorLayer.setVisible(false)
|
|
|
+ this.doLoading = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ '$store.state.common.ViewLayout': function (val, oldVal) {
|
|
|
+ if (val == '3D视图') this.viewType = '2D视图'
|
|
|
+ else this.viewType = '3D视图'
|
|
|
+ },
|
|
|
+ loading(val, oldVal) {
|
|
|
+ if (this.selectFlag && !val && this.selectPipeLines.length < 2) {
|
|
|
+ // 点击查询结束
|
|
|
+ if (!this.resultInfo || !this.resultInfo.feature.dataType.type == "line") {
|
|
|
+ this.$message.error('未选中管线!')
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ if (this.selectPipeLines.length == 0) {
|
|
|
+ this.$message.success(`已经选择${this.resultInfo.feature.dataType.label},请继续选择`)
|
|
|
+ }
|
|
|
+ if (this.selectPipeLines.length == 1 &&
|
|
|
+ JSON.stringify(this.resultInfo.feature.dataType) !==
|
|
|
+ JSON.stringify(this.selectPipeLines[0].feature.dataType)) { // 判断两次点击选择的管线是不是一样
|
|
|
+ this.$message.warning(`该管线不是${this.selectPipeLines[0].feature.dataType.label},请选择类型系统的管线!`)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.selectPipeLines.push(this.resultInfo)
|
|
|
+ if (this.selectPipeLines.length == 1) {
|
|
|
+ this.startPipe = this.selectPipeLines[0].feature.properties // 起点管段
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.selectPipeLines.length == 2) {
|
|
|
+ console.log(this.selectPipeLines)
|
|
|
+ this.endPipe = this.selectPipeLines[1].feature.properties // 终点管段
|
|
|
+ this.selectFlag = false
|
|
|
+ this.selectPipeConfig = this.getNetWorkConfig(this.resultInfo) //获取对应的网络分析配置
|
|
|
+ if (!this.selectPipeConfig) {
|
|
|
+ this.$message.error(`该管线没有配置网络分析服务!`)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 开始分析
|
|
|
+ this.doAnalyze()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
+ destroyed() {
|
|
|
+ this.data.that.map.removeLayer(this.vectorLayer)
|
|
|
+ this.$store.dispatch('map/delHalfPanels', 'parallelSectionPipeResult');
|
|
|
+ },
|
|
|
mounted() {
|
|
|
- this.pipeDataSet = mapConfig.iServerUrl.netWorkConfig // 获取所有管道网络的分析配置
|
|
|
this.loadChart()
|
|
|
// 创建显示图层
|
|
|
this.vectorLayer = new VectorLayer({
|
|
@@ -131,29 +183,6 @@ export default {
|
|
|
})
|
|
|
this.data.that.map.addLayer(this.vectorLayer)
|
|
|
},
|
|
|
- watch: {
|
|
|
- // 监听面板是否被改变
|
|
|
- '$store.state.map.P_editableTabsValue': function (val, oldVal) {
|
|
|
- if (val == 'parallelSectionAnalysis') {
|
|
|
- this.vectorLayer.setVisible(true)
|
|
|
- }
|
|
|
- else {
|
|
|
- this.vectorLayer.setVisible(false)
|
|
|
- unByKey(this.mapClickEvent) // 移除地图点击事件
|
|
|
- this.loading=false
|
|
|
- this.clickType = 0
|
|
|
- }
|
|
|
- },
|
|
|
- '$store.state.common.ViewLayout': function (val, oldVal) {
|
|
|
- if (val == '3D视图') this.viewType = '2D视图'
|
|
|
- else this.viewType = '3D视图'
|
|
|
- }
|
|
|
- },
|
|
|
- destroyed() {
|
|
|
- this.data.that.map.removeLayer(this.vectorLayer)
|
|
|
- unByKey(this.mapClickEvent)
|
|
|
- this.$store.dispatch('map/delHalfPanels', 'parallelSectionPipeResult');
|
|
|
- },
|
|
|
methods: {
|
|
|
/**
|
|
|
* 加载图表
|
|
@@ -223,7 +252,7 @@ export default {
|
|
|
this.vectorLayer.getSource().removeFeature(this.vectorLayer.getSource().getFeatureById("pipe_point"))
|
|
|
})
|
|
|
},
|
|
|
- /** 图标鼠标移动,地图显示管点 */
|
|
|
+ /** 图表鼠标移动,地图显示管点 */
|
|
|
showPoint(index) {
|
|
|
let coordinate = this.nodesArray[index]
|
|
|
let feature = new Feature({
|
|
@@ -254,204 +283,118 @@ export default {
|
|
|
this.startPipe = this.endPipe = {}
|
|
|
this.pipeArray = []
|
|
|
this.pipeLength = 0
|
|
|
- this.clickType = 0
|
|
|
- if (this.mapClickEvent) unByKey(this.mapClickEvent)
|
|
|
this.loadChart()
|
|
|
- // 定义地图点击事件
|
|
|
- this.mapClickEvent = this.data.that.map.on("click", e => {
|
|
|
- this.queryPipeData(e.coordinate)
|
|
|
- })
|
|
|
-
|
|
|
+ this.selectPipeLines = []
|
|
|
+ this.totalResultTable = []
|
|
|
+ this.selectFlag = true
|
|
|
},
|
|
|
/**
|
|
|
- * 在点击的地方查询管道类型
|
|
|
- * @param {Array} 坐标点
|
|
|
- */
|
|
|
- async queryPipeData(coordinate) {
|
|
|
- this.loading = true // 执行状态
|
|
|
- this.netWorkConfigs = []
|
|
|
- this.loopConfigNum = 0
|
|
|
- let point = turf.buffer(turf.point(coordinate), 0.0006, { units: 'kilometers' }) // 缓冲0.6米
|
|
|
- if (this.clickType == 0) {
|
|
|
- for (let i = 0; i < this.pipeDataSet.length; i++) {
|
|
|
- const item = this.pipeDataSet[i];
|
|
|
- await this.geometryQueryService(new GeoJSON().readFeature(point).getGeometry(), item, coordinate).then(res => {
|
|
|
- if (res.result.features.features.length > 0) {
|
|
|
- for (let j = 0; j < res.result.features.features.length; j++) {
|
|
|
- const feature = res.result.features.features[j]
|
|
|
- let element = JSON.parse(JSON.stringify(item))
|
|
|
- element['feature'] = feature
|
|
|
- this.netWorkConfigs.push(element)
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- if (this.netWorkConfigs.length == 0) {
|
|
|
- this.loading = false // 关闭执行状态
|
|
|
- this.$message.error('未选中管道!')
|
|
|
+ * 获取网络分析配置
|
|
|
+ */
|
|
|
+ getNetWorkConfig(selectInfo) {
|
|
|
+ let netWorkConfig = null
|
|
|
+ this.pipeDataSet.forEach(item => {
|
|
|
+ if (item.name == selectInfo.feature.dataType.label) {
|
|
|
+ netWorkConfig = item;
|
|
|
return
|
|
|
}
|
|
|
- this.selectPipeConfig = this.netWorkConfigs[0]
|
|
|
- if (this.netWorkConfigs.length == 1) {
|
|
|
- this.$message.success(`已经选择${this.selectPipeConfig.name},请选择第二段`)
|
|
|
- this.clickType += 1
|
|
|
- } else {
|
|
|
- /**如果该处有多种类型的管道,弹窗选择管道类型 */
|
|
|
- this.dialogVisible = true
|
|
|
- this.clickType += 1
|
|
|
- }
|
|
|
- this.firstSelectPoint = new Point(coordinate) // 记录选择的点
|
|
|
- } else {
|
|
|
- this.secondClickQuery(new GeoJSON().readFeature(point).getGeometry(), coordinate)
|
|
|
- this.loading = true // 执行状态
|
|
|
- }
|
|
|
- },
|
|
|
- /**根据配置查询管线 */
|
|
|
- geometryQueryService(geometry, item, coordinate) {
|
|
|
- let url = mapConfig.iServerUrl.pipelineDataServer.url
|
|
|
- // 空间查询参数
|
|
|
- let geoQueryConf = this.geoQueryConf(geometry, item)
|
|
|
- return new Promise((resolve) => {
|
|
|
- geoQueryConf.featureService.getFeaturesByGeometry(geoQueryConf.geometryParam, serviceResult => {
|
|
|
- if (serviceResult.type == "processFailed") {
|
|
|
- this.$message.error(`查询失败,${serviceResult.error.errorMsg}!`);
|
|
|
- return
|
|
|
- }
|
|
|
- resolve(serviceResult);
|
|
|
- })
|
|
|
- });
|
|
|
- },
|
|
|
- /**
|
|
|
- * 配置几何查询服务
|
|
|
- */
|
|
|
- geoQueryConf(geometry, config) {
|
|
|
- let url = mapConfig.iServerUrl.pipelineDataServer.url
|
|
|
- // 空间查询参数
|
|
|
- let geometryParam = new SuperMap.GetFeaturesByGeometryParameters({
|
|
|
- toIndex: -1,
|
|
|
- maxFeatures: 10000000,
|
|
|
- datasetNames: [config.pipeDatasetName],
|
|
|
- geometry: geometry,
|
|
|
- spatialQueryMode: "INTERSECT" // 相交空间查询模式
|
|
|
})
|
|
|
- return { geometryParam: geometryParam, featureService: new FeatureService(url) }
|
|
|
+ return netWorkConfig
|
|
|
},
|
|
|
/**
|
|
|
* 第二次点击,查询和分析
|
|
|
*/
|
|
|
- secondClickQuery(geometry, coordinate) {
|
|
|
- let geoQueryConf = this.geoQueryConf(geometry, this.selectPipeConfig)
|
|
|
- geoQueryConf.featureService.getFeaturesByGeometry(geoQueryConf.geometryParam, serviceResult => {
|
|
|
- // console.log('第二次查询结果:', serviceResult.result.features.features.length)
|
|
|
- if (serviceResult.type == "processFailed") {
|
|
|
- this.$message.error(`获取终点管线失败,${serviceResult.error.errorMsg}!`);
|
|
|
- this.loading = false // 关闭执行状态
|
|
|
- return
|
|
|
- }
|
|
|
- let features = JSON.parse(JSON.stringify(serviceResult.result.features.features))
|
|
|
- // 查询到第二次选择的管线
|
|
|
- if (features.length > 0) {
|
|
|
- this.clickType += 1
|
|
|
- this.$message.success(`此处有${this.selectPipeConfig.name}!`)
|
|
|
- this.secondSelectPoint = new Point(coordinate)
|
|
|
- //创建最佳路径分析参数实例
|
|
|
- let resultSetting = new SuperMap.TransportationAnalystResultSetting({
|
|
|
- returnEdgeFeatures: true,
|
|
|
- returnEdgeGeometry: true,
|
|
|
- returnEdgeIDs: true,
|
|
|
- returnNodeFeatures: true,
|
|
|
- returnNodeGeometry: true,
|
|
|
- returnNodeIDs: true,
|
|
|
- returnPathGuides: true,
|
|
|
- returnRoutes: true
|
|
|
- });
|
|
|
+ doAnalyze() {
|
|
|
+ //创建最佳路径分析参数实例
|
|
|
+ let resultSetting = new SuperMap.TransportationAnalystResultSetting({
|
|
|
+ returnEdgeFeatures: true,
|
|
|
+ returnEdgeGeometry: true,
|
|
|
+ returnEdgeIDs: true,
|
|
|
+ returnNodeFeatures: true,
|
|
|
+ returnNodeGeometry: true,
|
|
|
+ returnNodeIDs: true,
|
|
|
+ returnPathGuides: true,
|
|
|
+ returnRoutes: true
|
|
|
+ });
|
|
|
|
|
|
- let analystParameter = new SuperMap.TransportationAnalystParameter({
|
|
|
- resultSetting: resultSetting,
|
|
|
- weightFieldName: "SmLength"
|
|
|
- });
|
|
|
- // console.log('888', this.firstSelectPoint, this.secondSelectPoint)
|
|
|
- const firstPoint = { x: this.firstSelectPoint.getCoordinates()[0], y: this.firstSelectPoint.getCoordinates()[1] }
|
|
|
- const secondPoint = { x: this.secondSelectPoint.getCoordinates()[0], y: this.secondSelectPoint.getCoordinates()[1] }
|
|
|
+ let analystParameter = new SuperMap.TransportationAnalystParameter({
|
|
|
+ resultSetting: resultSetting,
|
|
|
+ weightFieldName: "SmLength"
|
|
|
+ });
|
|
|
|
|
|
- let findPathParameter = new SuperMap.FindPathParameters({
|
|
|
- isAnalyzeById: false,
|
|
|
- nodes: [firstPoint, secondPoint], // 加入起点和终点
|
|
|
- hasLeastEdgeCount: false,
|
|
|
- parameter: analystParameter
|
|
|
- });
|
|
|
+ const firstPoint = { x: this.selectPipeLines[0].coordinate[0], y: this.selectPipeLines[0].coordinate[1] }
|
|
|
+ const secondPoint = { x: this.selectPipeLines[1].coordinate[0], y: this.selectPipeLines[1].coordinate[1] }
|
|
|
|
|
|
- let networkAnalystService = new NetworkAnalystService(this.selectPipeConfig.netWorkServiceurl)
|
|
|
+ let findPathParameter = new SuperMap.FindPathParameters({
|
|
|
+ isAnalyzeById: false,
|
|
|
+ nodes: [firstPoint, secondPoint], // 加入起点和终点
|
|
|
+ hasLeastEdgeCount: false,
|
|
|
+ parameter: analystParameter
|
|
|
+ });
|
|
|
|
|
|
- //进行查找
|
|
|
- networkAnalystService.findPath(findPathParameter, serviceResult => {
|
|
|
- // console.log("纵剖面分析结果:", serviceResult)
|
|
|
- if (serviceResult.type == "processFailed") {
|
|
|
- this.$message.error('纵剖面分析失败,确保选择的管道是连续的!');
|
|
|
- this.loading = false
|
|
|
- return
|
|
|
- }
|
|
|
- let proj = this.data.that.map.getView().getProjection()
|
|
|
- let nodes = [] //管点
|
|
|
- let pipes = [] // 管段
|
|
|
- let tempLength = [] // 管段长度
|
|
|
- let nodeDistance = [0] // 管点距离
|
|
|
- let groundHeightArray = [] // 地面高程
|
|
|
- let nodeHeightArray = [] // 管点高程
|
|
|
- serviceResult.result.pathList.map(result => {
|
|
|
- this.vectorLayer.getSource().addFeatures(new GeoJSON().readFeatures(result.edgeFeatures))
|
|
|
- let features = result.edgeFeatures.features
|
|
|
- this.startPipe = features[0].properties // 起点管段
|
|
|
- this.endPipe = features[features.length - 1].properties // 终点管段
|
|
|
- for (let i = 0; i < features.length; i++) {
|
|
|
- // console.log('输出:', features[i])
|
|
|
- let item = features[i]
|
|
|
- item.properties['geometry'] = item.geometry
|
|
|
- pipes.push(item.properties)
|
|
|
- let len = getLength(new GeoJSON().readGeometry(item.geometry), { "projection": proj, "radius": 6378137 })
|
|
|
- tempLength.push(len)
|
|
|
- nodeDistance.push(eval(tempLength.join("+")).toFixed(0))
|
|
|
- if (i == 0) {
|
|
|
- nodes.push(new GeoJSON().readGeometry(item.geometry).getFirstCoordinate())// 第一段管段起点坐标
|
|
|
- nodes.push(new GeoJSON().readGeometry(item.geometry).getLastCoordinate()) // 第一段管段终点坐标
|
|
|
- let startHeight = parseFloat(item.properties.START_HEIGHT) // 起点高程
|
|
|
- let endHeight = parseFloat(item.properties.END_HEIGHT) // 终点高程
|
|
|
- // 地面高程=管点高程+埋深
|
|
|
- let startGroundHeight = startHeight + parseFloat(item.properties.START_DEPTH) // 起点地面高程
|
|
|
- let endGroundHeight = endHeight + parseFloat(item.properties.END_DEPTH) // 终点地面高程
|
|
|
+ let networkAnalystService = new NetworkAnalystService(this.selectPipeConfig.netWorkServiceurl)
|
|
|
|
|
|
- groundHeightArray.push(startGroundHeight.toFixed(3))
|
|
|
- nodeHeightArray.push(startHeight.toFixed(3))
|
|
|
- groundHeightArray.push(endGroundHeight.toFixed(3))
|
|
|
- nodeHeightArray.push(endHeight.toFixed(3))
|
|
|
- } else {
|
|
|
- nodes.push(new GeoJSON().readGeometry(item.geometry).getLastCoordinate()) // 管段终点坐标
|
|
|
- let endHeight = parseFloat(item.properties.END_HEIGHT) // 终点高程
|
|
|
- let endGroundHeight = endHeight + parseFloat(item.properties.END_DEPTH) // 终点地面高程
|
|
|
- groundHeightArray.push(endGroundHeight.toFixed(3))
|
|
|
- nodeHeightArray.push(endHeight.toFixed(3))
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- this.pipeArray = pipes
|
|
|
- this.nodesArray = nodes
|
|
|
- this.pipeLength = nodeDistance[nodeDistance.length - 1]
|
|
|
- let yMin = Math.min(...nodeHeightArray) - 0.5
|
|
|
- let yMax = Math.max(...groundHeightArray) + 0.5
|
|
|
- this.loadChart(groundHeightArray, nodeHeightArray, nodeDistance, yMin, yMax)
|
|
|
- this.totalResultTable = [{
|
|
|
- name: '相连管线',
|
|
|
- num: this.pipeArray.length + '个/' + this.pipeLength + 'm',
|
|
|
- data: this.pipeArray,
|
|
|
- fields: this.getFields('line')
|
|
|
- }]
|
|
|
- unByKey(this.mapClickEvent)
|
|
|
- this.clickType = 0
|
|
|
- this.loading = false // 关闭执行状态
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.$message.error(`此处无${this.selectPipeConfig.name}!`)
|
|
|
+ //进行查找
|
|
|
+ networkAnalystService.findPath(findPathParameter, serviceResult => {
|
|
|
+ if (serviceResult.type == "processFailed") {
|
|
|
+ this.$message.error('纵剖面分析失败,请确保选择的管道是连续的!');
|
|
|
+ this.doLoading = false
|
|
|
+ return
|
|
|
}
|
|
|
+ let proj = this.data.that.map.getView().getProjection()
|
|
|
+ let nodes = [] //管点
|
|
|
+ let pipes = [] // 管段
|
|
|
+ let tempLength = [] // 管段长度
|
|
|
+ let nodeDistance = [0] // 管点距离
|
|
|
+ let groundHeightArray = [] // 地面高程
|
|
|
+ let nodeHeightArray = [] // 管点高程
|
|
|
+ serviceResult.result.pathList.map(result => {
|
|
|
+ this.vectorLayer.getSource().addFeatures(new GeoJSON().readFeatures(result.edgeFeatures))
|
|
|
+ let features = result.edgeFeatures.features
|
|
|
+ for (let i = 0; i < features.length; i++) {
|
|
|
+ // console.log('输出:', features[i])
|
|
|
+ let item = features[i]
|
|
|
+ item.properties['geometry'] = item.geometry
|
|
|
+ pipes.push(item.properties)
|
|
|
+ let len = getLength(new GeoJSON().readGeometry(item.geometry), { "projection": proj, "radius": 6378137 })
|
|
|
+ tempLength.push(len)
|
|
|
+ nodeDistance.push(eval(tempLength.join("+")).toFixed(0))
|
|
|
+ if (i == 0) {
|
|
|
+ nodes.push(new GeoJSON().readGeometry(item.geometry).getFirstCoordinate())// 第一段管段起点坐标
|
|
|
+ nodes.push(new GeoJSON().readGeometry(item.geometry).getLastCoordinate()) // 第一段管段终点坐标
|
|
|
+ let startHeight = parseFloat(item.properties.START_HEIGHT) // 起点高程
|
|
|
+ let endHeight = parseFloat(item.properties.END_HEIGHT) // 终点高程
|
|
|
+ // 地面高程=管点高程+埋深
|
|
|
+ let startGroundHeight = startHeight + parseFloat(item.properties.START_DEPTH) // 起点地面高程
|
|
|
+ let endGroundHeight = endHeight + parseFloat(item.properties.END_DEPTH) // 终点地面高程
|
|
|
+
|
|
|
+ groundHeightArray.push(startGroundHeight.toFixed(3))
|
|
|
+ nodeHeightArray.push(startHeight.toFixed(3))
|
|
|
+ groundHeightArray.push(endGroundHeight.toFixed(3))
|
|
|
+ nodeHeightArray.push(endHeight.toFixed(3))
|
|
|
+ } else {
|
|
|
+ nodes.push(new GeoJSON().readGeometry(item.geometry).getLastCoordinate()) // 管段终点坐标
|
|
|
+ let endHeight = parseFloat(item.properties.END_HEIGHT) // 终点高程
|
|
|
+ let endGroundHeight = endHeight + parseFloat(item.properties.END_DEPTH) // 终点地面高程
|
|
|
+ groundHeightArray.push(endGroundHeight.toFixed(3))
|
|
|
+ nodeHeightArray.push(endHeight.toFixed(3))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.pipeArray = pipes
|
|
|
+ this.nodesArray = nodes
|
|
|
+ this.pipeLength = nodeDistance[nodeDistance.length - 1]
|
|
|
+ let yMin = Math.min(...nodeHeightArray) - 0.5
|
|
|
+ let yMax = Math.max(...groundHeightArray) + 0.5
|
|
|
+ this.loadChart(groundHeightArray, nodeHeightArray, nodeDistance, yMin, yMax)
|
|
|
+ this.totalResultTable = [{
|
|
|
+ name: '相连管线',
|
|
|
+ num: this.pipeArray.length + '个/' + this.pipeLength + 'm',
|
|
|
+ data: this.pipeArray,
|
|
|
+ fields: this.getFields('line')
|
|
|
+ }]
|
|
|
+ this.data.that.popupWindowClose() // 清除地图视图点击选择的要素,关闭弹窗
|
|
|
+ this.doLoading = false // 关闭执行状态
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
@@ -470,41 +413,6 @@ export default {
|
|
|
}
|
|
|
return fields
|
|
|
},
|
|
|
- /**
|
|
|
- * 确认管道类型
|
|
|
- */
|
|
|
- confirmPipeType() {
|
|
|
- this.$message.success(`已经选择${this.selectPipeConfig.name},请选择第二段`)
|
|
|
- this.dialogVisible = false
|
|
|
- },
|
|
|
- /**
|
|
|
- * 表格查看定位点击事件
|
|
|
- */
|
|
|
- tableRowLook(scope) {
|
|
|
- let popupPosition = [] // 弹窗位置
|
|
|
- let geometry = new GeoJSON().readGeometry(scope.row.geometry)
|
|
|
- // 弹窗的信息
|
|
|
- let infoObject = {
|
|
|
- properties: scope.row,
|
|
|
- dataType: { label: '' },
|
|
|
- geometry: scope.row.geometry
|
|
|
- }
|
|
|
- let feature = new Feature({
|
|
|
- geometry: geometry,
|
|
|
- })
|
|
|
- if (geometry.getType() == 'LineString') {
|
|
|
- popupPosition = getCenter(geometry.getExtent())
|
|
|
- infoObject.dataType.label = this.selectPipeConfig.name
|
|
|
- } else {
|
|
|
- popupPosition = geometry.getCoordinates()
|
|
|
- infoObject.dataType.label = this.selectPipeConfig.pointName
|
|
|
- }
|
|
|
- // 弹窗显示
|
|
|
- this.data.that.popupWindowShow(popupPosition, infoObject)
|
|
|
- setTimeout(() => {
|
|
|
- this.data.that.map.getView().fit(feature.getGeometry().getExtent(), { duration: 600 })
|
|
|
- }, 200);
|
|
|
- },
|
|
|
/**
|
|
|
* 二三维场景转换
|
|
|
*/
|