From a4a4db4d04174541e4b44b83583be515f77b10b4 Mon Sep 17 00:00:00 2001
From: 陈泽平 <chenzeping>
Date: 星期二, 18 五月 2021 16:30:10 +0800
Subject: [PATCH] 应急问题修改

---
 src/components/panel/topicSearch/SewersSearch.vue |  108 ++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 77 insertions(+), 31 deletions(-)

diff --git a/src/components/panel/topicSearch/SewersSearch.vue b/src/components/panel/topicSearch/SewersSearch.vue
index 712dc17..bc9772d 100644
--- a/src/components/panel/topicSearch/SewersSearch.vue
+++ b/src/components/panel/topicSearch/SewersSearch.vue
@@ -17,32 +17,33 @@
               </el-select>
             </el-form-item>
             <el-form-item :label="form.pipelineType+'锛�'" size="mini">
-              <el-select style="width: 100%" v-model="form.dataType" value-key="code" :popper-class="'select-down'">
-                <!--  @change="handleDataType"-->
+              <el-select style="width: 100%" v-model="form.dataType" value-key="code" :popper-class="'select-down'" @change="handleDataType" >
                 <el-option
-                    v-for="item in subItems"
-                    :key="item.code"
-                    :label="item.name"
-                    :value="item">
-                </el-option>
+                      v-for="item in subItems"
+                      :key="item.code"
+                      :label="item.name"
+                      :value="item">
+              </el-option>
               </el-select>
             </el-form-item>
             <div class="rightButtonSearch">
-              <el-input v-model="form.keyword" size="mini" placeholder="鍦ㄦ杈撳叆鍏抽敭瀛楁悳绱�">
-              </el-input>
+              <el-input v-model="form.keyword" size="mini" placeholder="鍦ㄦ杈撳叆鍏抽敭瀛楁悳绱�"></el-input>
               <el-button class="el-icon-search" @click="handleSearch"></el-button>
             </div>
           </el-form>
         </div>
-        <el-scrollbar style="height:380.44px;">
-          <div class="environmental-risk-list" v-for="(item,index) in list" :key="index">
-            <div @click="handleLocation(item)">
-              <h3 class="B-TMD-table-list-title-y">
-                {{ item.properties.pipename }}</h3>
-              <!--<p v-for="itm in labelList" :key="itm.label">
-                <span>{{ itm.label }}锛�</span>
-                <span :title="item.properties[itm.key] ">{{ item.properties[itm.key] }}</span>
-              </p>-->
+        <el-scrollbar style="height:413px;">
+          <div class="environmental-risk-list" v-for="(item,index) in list" :key="index" :class="activeNum===index?'hover':''">
+            <img class="state" :src="getImgSrc()" style="background: none" />
+            <div>
+              <h3 @click="handleLocation(item,index)">{{ item.properties.pipename }}</h3>
+              <p>鎵�灞炰紒涓氾細<span>{{ item.properties.orgname }}</span>
+              <p>璁炬柦绫诲瀷锛�<span>{{ item.properties.linenumtype }}{{ item.properties.fourtype }}{{ item.properties.teetype }}</span>
+               <el-button v-if="fuShuSheShiShow" class="rt btn00fff6" size="mini" style="margin-right: 0.04rem;"
+                          @click="btnAffiliatedFacilities(item,index)" >
+                 闄勫睘璁炬柦
+               </el-button>
+              </p>
             </div>
           </div>
         </el-scrollbar>
@@ -53,7 +54,6 @@
               :page-size=pageSize
               layout="prev, pager, next"
               :total=total
-              :current-page=current
               class="warnPagination"
           >
           </el-pagination>
@@ -66,6 +66,8 @@
         <SewersHistory></SewersHistory>
       </el-tab-pane>
     </el-tabs>
+    <!-- 闄勫睘璁炬柦闈㈡澘 -->
+    <affiliated-facilities :facilitiesParameter="facilitiesParameter"  v-if="fuShuSheShiShow" ></affiliated-facilities>
   </div>
 </template>
 
@@ -79,15 +81,19 @@
 import WfsHelper from '@components/helpers/WfsHelper'
 import AjaxUtils from '@utils/AjaxUtils'
 
+import AffiliatedFacilities from '@components/BaseNav/pipeline/AffiliatedFacilities'
+
 // 寮曞叆缁勪欢鍐呭
 import SewersAnalysis from '@components/panel/topicSearch/SewersSelect/SewersAnalysis'
 import SewersHistory from '@components/panel/topicSearch/SewersSelect/SewersHistory'
+import { fitBounds, highlight, locate } from '../../helpers/LocateHelper'
 
 export default {
   name: 'SewersSearch',
   components: {
     SewersAnalysis,
-    SewersHistory
+    SewersHistory,
+    AffiliatedFacilities
   },
   data () {
     return {
@@ -96,25 +102,41 @@
       list: [],
       items: [LayerPipeLines, LayerFsss, LayerHbss, LayerPk, LayerArea],
       subItems: LayerPipeLines.layers,
+      pageSize: 10,
       total: 0,
       form: {
-        pipelineType: '绠$綉',
+        pipelineType: '绠$嚎',
         dataType: '',
         keyword: ''
       },
       // pageSize: 10,
       // current: 1,
       isWaybillHover: true,
-      isRouteHover: false
+      isRouteHover: false,
+      facilitiesParameter: null,
+      fuShuSheShiShow: true,
+      fuShuSheShiPanelShow: true,
+      activeNum: -1,
+      wfsHelper: null
     }
   },
   props: ['title'],
   methods: {
+    getImgSrc () {
+      const icon = this.form.dataType.icon
+      return icon ? 'assets/images/map/' + icon : ''
+    },
     handleClick (tab, event) {
       console.log(tab, event)
     },
+    handlePage (page) {
+      this.wfsHelper.setPage(page)
+      this.handleSearch()
+    },
+    // 璁炬柦绫诲瀷绛涢��
     handlePipelineType (val) {
-      for (var i = 0; i < this.items.length; i++) {
+      this.list = []
+      for (let i = 0; i < this.items.length; i++) {
         const item = this.items[i]
         if (val === item.name) {
           this.subItems = item.layers
@@ -122,24 +144,48 @@
         }
       }
     },
+    handleDataType () {
+      this.list = []
+    },
     async handleSearch () {
-      var wfsHelper = new WfsHelper()
+      // console.log(this.form.dataType.sname, this.form.keyword)
+      this.list = []
+      this.wfsHelper.clearFilter()
       // todo 鐜板湪绠$綉杩樻病鍖哄垎寮�绫诲瀷锛屽悗闈㈡敼
-      wfsHelper.addTypeName(this.form.dataType.name)
-      wfsHelper.addLike('name', this.form.keyword)
+      this.wfsHelper.setTypeName([this.form.dataType.typeName])
+      if (this.form.keyword) {
+        this.wfsHelper.addLike('name', this.form.keyword)
+      }
       // const _this = this
-      const res = await AjaxUtils.GetDataAsynByUrl(wfsHelper.getUrl(), {})
+      const res = await AjaxUtils.GetDataAsynByUrl(this.wfsHelper.getUrl(), {})
       console.log(res)
       if (res instanceof Object && Object.prototype.hasOwnProperty.call(res, 'features')) {
+        this.total = res.totalFeatures
         this.list = res.features
       }
     },
-    handleLocation (val) {
-      const bound = this.L.geoJSON([val], {}).getBounds()
-      window.map.flyToBounds(bound)
-      window.layerFactory.flyByLayerId(this.form.dataType.code, val.id)
+    handleLocation (val, index) {
+      // console.log(val)
+      this.activeNum = index
       // layer && layer.openPopup()
+      const config = this.form.dataType
+      locate(val, config)
+    },
+    btnAffiliatedFacilities (val, index) {
+      this.activeNum = index
+      this.facilitiesParameter = val
+      // 鍒ゆ柇閫夋嫨鏄惁鏄绾匡紝濡傛灉鏄垯鏄剧ず銆婇檮灞炶鏂姐�嬪脊妗�
+      if (this.form.pipelineType === '绠$嚎') {
+        this.fuShuSheShiShow = true
+      } else {
+        this.fuShuSheShiShow = false
+      }
+      fitBounds(val, this.form.dataType.code)
+      highlight(val)
     }
+  },
+  mounted () {
+    this.wfsHelper = new WfsHelper()
   }
 }
 </script>

--
Gitblit v1.8.0