派生自 wuyushui/SewerAndRainNetwork

ChenZeping
2021-05-11 a6135ffcbf7dca73c3ff39ad6f7718880c3abe9a
src/components/panel/topicSearch/SewersSelect/SewersAnalysis.vue
@@ -13,7 +13,7 @@
                <!--        <el-scrollbar style="height:450px">-->
                <!--          <el-card shadow="hover">-->
                <span class="fixed-style">起始管段</span>
                <el-table class="tableBox" height="100" max-height="200" :data="tableDataLinkStart" @row-click="linkSelectStart" highlight-current-row style="width: 100%" size="mini">
                <el-table class="tableBox" height="100" max-height="200" :data="tableDataLinkStart" highlight-current-row style="width: 100%" size="mini">
                    <el-table-column prop="datasource" label="管段类型"></el-table-column>
                    <el-table-column :show-overflow-tooltip="true" sortable width="100" prop="pipecode" label="管段名称"></el-table-column>
                    <el-table-column sortable width="100" prop="material" label="起点编号"></el-table-column>
@@ -55,8 +55,8 @@
            <el-tab-pane label="爆管" style="color: #cccccc" name="second">
                <el-row>
                    <span>爆管(相关开关)</span>
                    <el-button type="primary" @click="bgClick" size="mini" style="margin-bottom: 5px;" title="地图上点击选择发生爆管的管段">选择管段</el-button>
                    <el-button type="primary" @click="handleClick" size="mini" style="margin-bottom: 5px;" title="清除绘制">清除</el-button>
                    <el-button type="primary" @click="bgClick" size="mini"  title="地图上点击选择发生爆管的管段">选择管段</el-button>
                    <el-button type="primary" @click="handleClick" size="mini"  title="清除绘制">清除</el-button>
                </el-row>
                <!--        <el-card shadow="hover">-->
                <span class="fixed-style">发生爆裂的管段</span>
@@ -86,8 +86,8 @@
                <!--        </el-card>-->
            </el-tab-pane>
            <el-tab-pane label="流向" name="third">
                <el-button type="primary" @click="selectPipeLine" size="mini" style="margin-bottom: 5px;" title="地图上点击要显示流向的管段">选择管段</el-button>
                <el-table max-height="200" class="tableBox" :data="tableDataLiuxiang" size="mini">
                <el-button type="primary" @click="selectPipeLine" size="mini" highlight-current-row title="地图上点击要显示流向的管段">选择管段</el-button>
                <el-table max-height="200" class="tableBox" highlight-current-row :data="tableDataLiuxiang" size="mini">
                    <el-table-column :show-overflow-tooltip="true" prop="pipecode" label="管段类型"></el-table-column>
                    <el-table-column :show-overflow-tooltip="true" sortable width="100" prop="pipecode" label="管段名称"></el-table-column>
                    <el-table-column :show-overflow-tooltip="true" sortable width="100" prop="pipecode" label="起点编号"></el-table-column>
@@ -112,16 +112,16 @@
                </el-table>
            </el-tab-pane>
            <el-tab-pane label="横断面" name="fourth">
                <div>
                    <el-button type="primary" @click="drawLine" size="mini" style="margin-bottom: 5px;" title="地图上绘制要进行分析截断面的线">绘制线段</el-button>
                    <el-button type="primary" @click="jdmQuery" size="mini" style="margin-bottom: 5px;" title="截断面分析">截断面分析</el-button>
                    <el-button type="primary" @click="jdmClear" size="mini" style="margin-bottom: 5px;" title="清除截断面分析结果">清除</el-button>
                </div>
                <!--        <el-card class="box-card">-->
                <el-row>
                    <el-button type="primary" @click="drawLine" size="mini"  title="地图上绘制要进行分析截断面的线">绘制线段</el-button>
                    <el-button type="primary" @click="jdmQuery" size="mini"  title="截断面分析">截断面分析</el-button>
                    <el-button type="primary" @click="jdmClear" size="mini"  title="清除截断面分析结果">清除</el-button>
                </el-row>
                <!-- <el-card class="box-card">-->
                <div slot="header" class="fixed-style">
                    <span>管段查询结果</span>
                </div>
                <el-table class="tableBox" :data="tableData" max-height="200" style="width: 100%" @row-click="selectRow" size="mini">
                <el-table class="tableBox" :data="tableData" height="150" max-height="200" highlight-current-row style="width: 100%" @row-click="selectRow" size="mini">
                    <el-table-column prop="pipename" label="管段名称"></el-table-column>
                    <el-table-column prop="mediumtype" label="管段类型" width="80"></el-table-column>
                    <el-table-column class-name="fixed-table" fixed="right" label="图表"  width="40">
@@ -130,7 +130,7 @@
                        </template>
                    </el-table-column>
                </el-table>
                <!--        </el-card>-->
                <!--  </el-card>-->
                <!-- <el-card class="box-card">
                    <div slot="header" class="fixed-style">
                        <span>断面图</span>
@@ -247,27 +247,21 @@
    },
    // 地图上点击回调
    selectClick (e) {
      console.log(e)
      // console.log(e)
      window.map.off('click', this.selectClick)
      const point = [e.latlng.lng, e.latlng.lat]
      this.getPipeLine(point)
      // if () {
      //   // 关闭弹窗
      //   window.layerFactory.clickSwitch = false
      // } else {
      //   window.layerFactory.clickSwitch = true
      // }
    },
    // 点击获取判断数据
    async getPipeLine (point) {
      const param = {
        x: point[0],
        y: point[1],
        radius: 5
        radius: 3
      }
      // 根据参数请求接口数据
      const res = await mapApi.findPipelineByClickPoint(param)
      console.log(res)
      console.log(res.pipesegcode)
      if (this.activeName === 'first') {
        if (this.linkType === 1) {
          this.tableDataLinkStart = res.data
@@ -305,6 +299,7 @@
    },
    // 连通性 起始管段 table列表数据 选择数据事件 的点击事件
    linkSelectStart (e) {
      // console.log(e)
      // console.log('选择起始管段')
      // this.$refs.singleTable.setCurrentRow(e)
      this.currentSelectStart = e
@@ -331,7 +326,7 @@
    },
    // 连通性 结束管段 table列表数据 选择数据事件 的点击事件
    linkSelectEnd (e) {
      console.log('选择结束管段')
      // console.log('选择结束管段')
      this.currentSelectEnd = e
      // 做判断remove
@@ -345,15 +340,15 @@
        style: function (feature) {
          return {
            weight: 10,
            color: 'rgba(255, 247, 0, 0.6)'
            color: 'rgba(255, 247, 0, 0.7)'
          }
        }
      }).addTo(window.map)
      window.map.panInsideBounds(this.currentSelectEndLine.getBounds())
    },
    // 连通性查询
    // 连通性查询 结果
    async linkQuery () {
      // 每次查询分析结果为空
      // 每次查询分析结果制空
      this.tableDataLinkResult = []
      if (this.linkPipeline.length > 1) {
        this.linkPipeline.forEach((itm) => {
@@ -380,9 +375,7 @@
      if (res.data.length === 0) {
        this.$message('没有找到连通的管段')
        // 进行判断
        // if (this.tableDataLinkStart === [] && this.tableDataLinkEnd === []) {
        this.currentLinkIsTrue = '不连通'
        // }
        return
      }
      this.tableDataLinkResult = res.data
@@ -671,6 +664,7 @@
    },
    // 横断面数据请求
    async jdmQuery () {
      this.tableData = []
      if (this.hdmParam == null) {
        this.$message('请先在地图上绘制截断线')
        return false
@@ -685,6 +679,7 @@
        }
        this.tableData.push(obj)
      }
      // console.log(this.tableData, 'this.tableData')
      this.dealWithData(res)
    },
    dealWithData (e) {
@@ -846,6 +841,7 @@
    /deep/ .el-table__body .el-table__row.hover-row td {
        background: none !important;
        color:yellow;
    }
    /deep/ .el-table__body tr.current-row > td {