Browse Source

净距分析

username 3 years ago
parent
commit
c6c32e2328

+ 1 - 1
config/evn.dev.js

@@ -1,5 +1,5 @@
 /**开发地址配置 */
 export default {
-    BASE_URL: 'http://192.168.2.186:1111',
+    BASE_URL: 'http://192.168.2.82:1111',
     ISERVER_BASE_URL: 'http://117.174.10.73:8090/'
 }

+ 2 - 2
config/evn.staging.js

@@ -1,5 +1,5 @@
 /**测试地址配置 */
 export default {
-    BASE_URL:'http://117.174.10.73:1111',
-    ISERVER_BASE_URL:'http://117.174.10.73:8090/'
+    BASE_URL: 'http://117.174.10.73:1111',
+    ISERVER_BASE_URL: 'http://117.174.10.73:8090/'
 }

BIN
kxc_web.zip


+ 35 - 26
src/api/kxc/pipelineSystem.js

@@ -1,44 +1,53 @@
 import request from '@/utils/request'
 /**
-  * 使用模块:
-  *    综合管线系统
-  * 说明:
-  *    get和delete传值用params,
-  *    post和put传值用data
-  */
+ * 使用模块:
+ *    综合管线系统
+ * 说明:
+ *    get和delete传值用params,
+ *    post和put传值用data
+ */
 /**********************************综合管线系统请求接口************************************/
 //综合管线维护日志记录
 export function pipelineMaintain(data) {
-  return request({
-    url: '/kxc/pipelineMaintain',
-    method: 'post',
-    data
-  })
+    return request({
+        url: '/kxc/pipelineMaintain',
+        method: 'post',
+        data
+    })
 }
 
 //管线维护记录按条件分页查询
 export function pipelineMaintainPage(params) {
-  return request({
-    url: '/kxc/pipelineMaintain/page',
-    method: 'get',
-    params
-  })
+    return request({
+        url: '/kxc/pipelineMaintain/page',
+        method: 'get',
+        params
+    })
 }
 
 //获取管线管点的中文字段
 export function getFields(param) {
-  return request({
-    url: '/kxc/pipelineMaintain/getPipelineColName/' + param,
-    method: 'get',
-    param
-  })
+    return request({
+        url: '/kxc/pipelineMaintain/getPipelineColName/' + param,
+        method: 'get',
+        param
+    })
 }
 
 // 追踪分析接口
 export function trackingAnalysis(data) {
-  return request({
-    url: '/kxc/pipelineMaintain/getPipelineConnect',
-    method: 'post',
-    data
-  })
+    return request({
+        url: '/kxc/pipelineMaintain/getPipelineConnect',
+        method: 'post',
+        data
+    })
+}
+
+// 净距分析接口
+export function getPipelineDistance(data) {
+    return request({
+        url: '/kxc/pipelineMaintain/getPipelineDistance',
+        method: 'post',
+        data
+    })
 }

+ 31 - 14
src/views/kxcSystem/pipelineSystem/specialtyAnalysis/clearDistanceAnalysis/css.scss

@@ -38,17 +38,33 @@
         padding: 10px;
         .result-description {
             width: 100%;
-            height: 64px;
+            min-height: 60px;
             background: #f6f6f6;
             border-radius: 4px;
-            >div {
-                width: 100%;
-                height: 32px;
-                line-height: 32px;
-                font-size: 14px;
-            }
-            .result-title {
-                font-weight: 600;
+            .contant {
+                >div {
+                    float: left;
+                    height: 50px;
+                    &:first-child,
+                    &:last-child {
+                        width: calc(50% - 15px);
+                        p {
+                            font-size: 14px;
+                            height: 30px;
+                            text-align: center;
+                            line-height: 30px;
+                            font-weight: 600;
+                        }
+                    }
+                    &:nth-child(2) {
+                        font-size: 16px;
+                        font-weight: 600;
+                        width: 30px;
+                        // background-color: #f40;
+                        text-align: center;
+                        line-height: 50px;
+                    }
+                }
             }
         }
     }
@@ -61,6 +77,7 @@
             width: calc(50% - 14.5px);
             height: 70px;
             display: inline-block;
+            vertical-align: top;
             border-radius: 5px;
             font-size: 0;
             &:first-child {
@@ -76,13 +93,13 @@
                 color: #fff;
                 font-size: 14px;
                 &:last-child {
-                    height: 30px;
-                    line-height: 30px;
-                    font-weight: 500;
+                    height: 35px;
+                    line-height: 35px;
+                    font-weight: 600;
                 }
                 &:first-child {
-                    height: 30px;
-                    line-height: 30px;
+                    height: 35px;
+                    line-height: 35px;
                     font-size: 16px;
                     span {
                         font-weight: 600;

+ 130 - 23
src/views/kxcSystem/pipelineSystem/specialtyAnalysis/clearDistanceAnalysis/widget.vue

@@ -2,38 +2,47 @@
   <!-- <div>净距分析</div> -->
   <div class="panel-container">
     <div class="op-box">
-      <el-button type="primary" size="small" style="width:100%" :loading="loading" @click="selectFlag=true">选择分析管线</el-button>
+      <el-button type="primary" size="small" style="width:100%" :loading="loading" @click="select">选择分析管线</el-button>
     </div>
 
     <!-- 分析结果 -->
     <div class="result-box">
       <div class="item-head">分析管线
-        <el-button type="text" style="padding:0;margin-left:10px">查看</el-button>
+        <!-- <el-button type="text" style="padding:0;margin-left:10px">查看</el-button> -->
       </div>
       <div class="result-description">
-        <div class="result-title" v-cloak></div>
-        <div v-cloak></div>
+        <div class="contant" v-if="selectPipeLines.length>0">
+          <div>
+            <p>{{selectPipeLines[0].feature.properties.TYPENAME}}</p>
+            <p>{{selectPipeLines[0].feature.properties.SID}}</p>
+          </div>
+          <div>VS</div>
+          <div v-if="selectPipeLines.length==2">
+            <p>{{selectPipeLines[1].feature.properties.TYPENAME}}</p>
+            <p>{{selectPipeLines[1].feature.properties.SID}}</p>
+          </div>
+        </div>
       </div>
     </div>
     <div class="op-box">
-      <el-button type="primary" size="small" style="width:100%" :loading="false">开始分析</el-button>
+      <el-button type="primary" size="small" style="width:100%" :loading="false" @click="start">开始分析</el-button>
     </div>
     <div class="op-box">
       <div class="item-head">分析结果</div>
       <div class="result-total">
         <div class="panel-item" :style="'background-color:'+bgc">
-          <div></div>
-          <div>合规</div>
+          <div>{{resultDes}}</div>
+          <div v-cloak>{{result}}</div>
         </div>
         <div class="panel-item">
-          <div></div>
-          <div>标准</div>
+          <div>净距标准</div>
+          <div v-cloak>{{standard}}</div>
         </div>
       </div>
     </div>
 
     <div class="op-box">
-      <el-button type="danger" size="small" style="width:100%">清除结果</el-button>
+      <el-button type="danger" size="small" style="width:100%" @click="clearResult()">清除结果</el-button>
     </div>
   </div>
 </template>
@@ -49,6 +58,8 @@ import { Vector as VectorLayer } from 'ol/layer';
 import { Style, Circle, Icon, Fill, RegularShape, Stroke, Text } from 'ol/style';
 import * as turf from '@turf/turf'
 import { getCenter } from 'ol/extent';
+
+import { getPipelineDistance } from '@/api/kxc/pipelineSystem'
 export default {
   props: ["data"],
   data() {
@@ -57,6 +68,9 @@ export default {
       selectFlag: false,
       selectPipeLines: [], // 选择的管线,只有两个
       vectorLayer: null,
+      resultDes:'合规',
+      result: '',
+      standard: ''
     }
   },
   computed: {
@@ -85,7 +99,7 @@ export default {
       }
     },
     loading(val, oldVal) {
-      if (this.selectFlag && !val && this.selectPipeLines.length < 3) {
+      if (this.selectFlag && !val && this.selectPipeLines.length < 2) {
         // 点击查询结束
         if (!this.resultInfo || !this.resultInfo.feature.dataType.type == "line") {
           this.$message.error('未选中管线!')
@@ -113,34 +127,127 @@ export default {
     this.data.that.map.addLayer(this.vectorLayer)
   },
   methods: {
+    select() {
+      this.clear()
+      this.selectFlag = true
+    },
     /**
      * 开始分析
      */
     start() {
+      let lineFeature1 = this.selectPipeLines[0].feature
+      let lineFeature2 = this.selectPipeLines[1].feature
+      this.vectorLayer.getSource().addFeature(new GeoJSON().readFeature(lineFeature1))
+      this.vectorLayer.getSource().addFeature(new GeoJSON().readFeature(lineFeature2))
       // 先判断两条管线是否有投影交点;有交点:计算垂直净距,无交点:计算水平净距
-      // const intersects = turf.lineIntersect(new GeoJSON().writeGeometryObject(this.drawLineGeo), element.geometry);
-
+      const intersects = turf.lineIntersect(lineFeature1, lineFeature2);
+      // 有交点
+      if (intersects.features.length > 0) {
+        let iPointCoord = new GeoJSON().readFeature(intersects.features[0]).getGeometry().getCoordinates()
+        const verticalInterval = this.clacLineVerticalInterval(lineFeature1, lineFeature2, iPointCoord) // 垂直净距
+        // alert("垂直净距:" + verticalInterval.toString())
+        this.result = "垂直净距:" + (verticalInterval * 1000).toFixed(2) + ' m'
+      }
+      // 无交点
+      else {
+        const levelInterval = this.clacLevelInterval(lineFeature1, lineFeature2)
+        // alert("水平净距:" + levelInterval.toString())
+        this.result = "水平净距:" + (levelInterval * 1000).toFixed(2) + ' m'
+        this.compareLevelInterval(lineFeature1, lineFeature2, (levelInterval * 1000).toFixed(2))
+      }
     },
-    /**计算交点的高程 */
+    /**
+     * 计算交点的高程
+     */
     calcIpointHeight(startPoint, endPoint, iPoint) {
       // 利用空间直线两点式方程得到交点高程,即交点z坐标
       return (endPoint.z - startPoint.z) * (iPoint.x - startPoint.x) / (endPoint.x - startPoint.x) + startPoint.z
     },
     /**
-     * 计算水平净距
+     * 计算两条线段之间的最小距离,即水平净距
      */
-    getLevelInterval() {
-      // var pt = turf.point([0, 0]);
-      // var line = turf.lineString([[1, 1], [-1, 1]]);
-      // var distance = turf.pointToLineDistance(pt, line, { units: 'miles' });
-      //=69.11854715938406
-
+    clacLevelInterval(line1, line2) {
+      let distance = []
+      const point1 = turf.point(new GeoJSON().readFeature(line1).getGeometry().getFirstCoordinate())
+      const point2 = turf.point(new GeoJSON().readFeature(line1).getGeometry().getLastCoordinate())
+      const point3 = turf.point(new GeoJSON().readFeature(line2).getGeometry().getFirstCoordinate())
+      const point4 = turf.point(new GeoJSON().readFeature(line2).getGeometry().getLastCoordinate())
+      distance.push(turf.pointToLineDistance(point1, line2, { units: 'kilometers' }))
+      distance.push(turf.pointToLineDistance(point2, line2, { units: 'kilometers' }))
+      distance.push(turf.pointToLineDistance(point3, line1, { units: 'kilometers' }))
+      distance.push(turf.pointToLineDistance(point4, line1, { units: 'kilometers' }))
+      distance.sort((a, b) => { return a - b }) //升序排序
+      // 水平净距
+      return distance[0]
+    },
+    /**
+     * 计算垂直距离,即垂直净距
+     */
+    clacLineVerticalInterval(line1, line2, iPointCoord) {
+      const startPoint1 = {
+        x: line1.geometry.coordinates[0][0],
+        z: parseFloat(line1.properties.START_HEIGHT) - parseFloat(line1.properties.START_DEPTH)
+      }
+      const endPoint1 = {
+        x: line1.geometry.coordinates[1][0],
+        z: parseFloat(line1.properties.END_HEIGHT) - parseFloat(line1.properties.END_DEPTH)
+      }
+      const startPoint2 = {
+        x: line2.geometry.coordinates[0][0],
+        z: parseFloat(line2.properties.START_HEIGHT) - parseFloat(line2.properties.START_DEPTH)
+      }
+      const endPoint2 = {
+        x: line2.geometry.coordinates[1][0],
+        z: parseFloat(line2.properties.END_HEIGHT) - parseFloat(line2.properties.END_DEPTH)
+      }
+      const iPoint = { x: parseFloat(iPointCoord[0]) }
+      const iPointZ1 = this.calcIpointHeight(startPoint1, endPoint1, iPoint)
+      const iPointZ2 = this.calcIpointHeight(startPoint2, endPoint2, iPoint)
+      // 垂直净距
+      return Math.abs(iPointZ1 - iPointZ2)
     },
     /**
-     * 计算垂直净距
+     * 水平净距比较
      */
-    getVerticalInterval() {
+    compareLevelInterval(line1, line2, value) {
+      // 判断是否为燃气管道
 
+      // 非燃气管道
+      let data = {
+        pipeType: line1.properties.TYPENAME,
+        pipeTypeAttr: line1.properties.BURYTYPE == '直埋' ? '直埋' : '',
+        comparePipeType: line2.properties.TYPENAME,
+        comparePipeTypeAttr: line2.properties.BURYTYPE == '直埋' ? '直埋' : ''
+      }
+      getPipelineDistance(data).then(res => {
+        console.log("比对结果:", res)
+        let resVal = res.result[0].distanceValue
+        this.standard = '≥ ' + resVal
+        if (value < parseFloat(resVal).toFixed(2)) {
+          this.bgc = '#f40'
+          this.resultDes = '不合规'
+        }
+        else {
+          this.bgc = '#02baaf'
+          this.resultDes = '合规'
+        }
+      })
+    },
+    /**
+     * 清除结果
+     */
+    clearResult() {
+      this.selectFlag = false
+      this.clear()
+    },
+    /**
+     * 清除
+     */
+    clear() {
+      this.selectPipeLines = []
+      this.vectorLayer.getSource().clear()
+      this.result = ''
+      this.standard = ''
     }
   }
 }

+ 181 - 273
src/views/kxcSystem/pipelineSystem/specialtyAnalysis/parallelSectionAnalysis/widget.vue

@@ -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);
-    },
     /**
      * 二三维场景转换
      */