From de7390c66ef3e3fe316e804495a78d05a01f0160 Mon Sep 17 00:00:00 2001
From: yangdelong <828900aaa>
Date: 星期六, 29 五月 2021 18:39:00 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/develop' into develop

---
 src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue |  184 ++++++++++++++++-----------------------------
 1 files changed, 66 insertions(+), 118 deletions(-)

diff --git a/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue b/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue
index 3d6c07b..b7e9d69 100644
--- a/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue
+++ b/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue
@@ -118,7 +118,7 @@
                             show-overflow-tooltip
                             width="150"
                             prop="properties.pipecode"
-                            label="缂栧彿">
+                            label="绠$嚎缂栧彿">
                     </el-table-column>
                     <el-table-column
                             show-overflow-tooltip
@@ -130,7 +130,7 @@
                             width="150"
                             show-overflow-tooltip
                             prop="properties.type"
-                            label="绫诲瀷">
+                            label="璁炬柦绫诲瀷">
                     </el-table-column>
                     <el-table-column width="90" fixed="right" label="鎿嶄綔">
                         <template slot-scope="scope">
@@ -176,6 +176,30 @@
     this.wfsHelper = new WfsHelper()
   },
   methods: {
+    // 绠$嚎鎼滅储
+    async pipelineSearch () {
+      this.SectionAndAffFacTableJudge = true
+      this.tableList = []
+      this.tableListSection = []
+      this.tableDataAffFac = []
+      this.wfsHelper.clearFilter()
+      this.wfsHelper.setTypeName(['sewer:pipeline'])
+      if (this.form.pipeName) {
+        this.wfsHelper.addLike('subchaname', this.form.pipeName)
+      }
+      // this.wfsHelper.addEquals('pipename', '\'' + this.form.pipeName + '\'')
+      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
+        // console.log(res.features)
+        this.tableList = res.features
+      }
+      this.wfsHelper = new WfsHelper()
+      this.form.pipeName = ''
+      this.form.sectionName = ''
+      this.form.affiliatedFacilities = ''
+    },
     // 鐐瑰嚮绠$嚎鍒楄〃 灞曠ず绠℃鍐呭 鍜岄檮灞炶鏂藉唴瀹�
     async sectionShowClick (val) {
       console.log(val)
@@ -205,6 +229,10 @@
         const resAffFac = await AjaxUtils.GetDataAsynByUrl(this.wfsHelper.getUrl(), {})
         console.log(resAffFac)
         if (resAffFac instanceof Object && Object.prototype.hasOwnProperty.call(resAffFac, 'features')) {
+          // for (let i = 0; i < resAffFac.features.length; i++) {
+          //   // console.log(resAffFac.features[i])
+          //   this.tableDataAffFac.push(resAffFac.features[i].properties)
+          // }
           this.tableDataAffFac = resAffFac.features
         }
         this.wfsHelper = new WfsHelper()
@@ -230,150 +258,70 @@
     pipeClickLocation () {
       // 璁炬柦涓嶈繘琛� 绠$嚎琛ㄦ牸鏁版嵁鐨勭偣鍑讳氦浜�
       this.SectionAndAffFacTableJudge = false
-      window.mapManager.clickDialogSwitch = false
-      // this.tableList = []
       // 鐐瑰嚮鑾峰彇鏁版嵁
       window.map.on('click', (e) => {
-        // window.mapManager.loadWfsDatas(e.latlng).then((res) => {
-        //   console.log(res)
-        //   for (let i = 0; i < res.features.length; i++) {
-        //     this.tableList.push(res.features[i])
-        //     this.tableListSection.push(res.features[i])
-        //     this.tableDataAffFac.push(res.features[i])
-        //   }
-        // })
-        // return new Promise((resolve, reject) => {
-        const size = window.map.getSize()
-        var point = window.map.latLngToContainerPoint(e.latlng, window.map.getZoom())
-        const wmsParams = Object.assign({
-          LAYERS: 'pipeline_group',
-          QUERY_LAYERS: 'pipeline_group',
-          WIDTH: size.x,
-          HEIGHT: size.y,
-          X: Math.round(point.x),
-          Y: Math.round(point.y),
-          BBOX: window.map.getBounds().toBBoxString()
-        }, {
-          VERSION: '1.1.1',
-          SERVICE: 'WMS',
-          REQUEST: 'GetFeatureInfo',
-          // bbox: bbox,
-          FORMAT: 'image/png',
-          INFO_FORMAT: 'application/json',
-          TRANSPARENT: true,
-          FEATURE_COUNT: 50,
-          SRS: 'EPSG:4326',
-          EXCEPTIONS: 'application/vnd.ogc.se_inimage'
-        })
-        AjaxUtils.get4JsonDataByUrl(WMS_URL, wmsParams, (res) => {
-          // console.log(res)
-          for (let i = 0; i < res.data.features.length; i++) {
-            // console.log(res.data.features[i])
-            this.tableList.push(res.data.features[i])
-          }
-        })
-        // 绠℃
+        // 鐐瑰嚮鍦板浘鍏抽棴寮规
+        window.mapManager.clickDialogSwitch = false
+        // 绠$嚎鐐瑰嚮鏁版嵁
+        this.pipeData(e)
+        // 绠℃鐐瑰嚮鏁版嵁
         this.sectionData(e)
-        // 闄勫睘璁炬柦
+        // 闄勫睘璁炬柦鏁版嵁
         this.affFacData(e)
-        // })
+        // 鍏抽棴鐐瑰嚮浜嬩欢
         window.map.off('click')
       })
       // 鏁版嵁 閲嶆柊鑾峰彇 杩涜缃┖
-      this.tableList = []
-      this.tableListSection = []
-      this.tableDataAffFac = []
       this.form.pipeName = ''
       this.form.sectionName = ''
       this.form.affiliatedFacilities = ''
+      this.tableList = []
+      this.tableListSection = []
+      this.tableDataAffFac = []
     },
-    // 鐐瑰嚮瀹氫綅 鎿﹀绠℃
+    // 鐐瑰嚮瀹氫綅鍖哄煙 鎼滃绠$嚎鏁版嵁
+    pipeData (e) {
+      this.publicWay(e, 'sewer:pipeline', 'sewer:pipeline', this.tableList)
+    },
+    // 鐐瑰嚮瀹氫綅鍖哄煙 鎼滃绠℃鏁版嵁
     sectionData (e) {
-      const size = window.map.getSize()
-      var point = window.map.latLngToContainerPoint(e.latlng, window.map.getZoom())
-      const wmsParams = Object.assign({
-        LAYERS: 'sewer:pipesegment',
-        QUERY_LAYERS: 'sewer:pipesegment',
-        WIDTH: size.x,
-        HEIGHT: size.y,
-        X: Math.round(point.x),
-        Y: Math.round(point.y),
-        BBOX: window.map.getBounds().toBBoxString()
-      }, {
-        VERSION: '1.1.1',
-        SERVICE: 'WMS',
-        REQUEST: 'GetFeatureInfo',
-        // bbox: bbox,
-        FORMAT: 'image/png',
-        INFO_FORMAT: 'application/json',
-        TRANSPARENT: true,
-        FEATURE_COUNT: 50,
-        SRS: 'EPSG:4326',
-        EXCEPTIONS: 'application/vnd.ogc.se_inimage'
-      })
-      AjaxUtils.get4JsonDataByUrl(WMS_URL, wmsParams, (res) => {
-        // console.log(res)
-        for (let i = 0; i < res.data.features.length; i++) {
-          this.tableListSection.push(res.data.features[i])
-        }
-      })
+      this.publicWay(e, 'sewer:pipesegment', 'sewer:pipesegment', this.tableListSection)
     },
-    // 闄勫睘璁炬柦
+    // 鐐瑰嚮瀹氫綅鍖哄煙 鎼滃闄勫睘璁炬柦鏁版嵁
     affFacData (e) {
-      const size = window.map.getSize()
-      var point = window.map.latLngToContainerPoint(e.latlng, window.map.getZoom())
-      const wmsParams = Object.assign({
-        LAYERS: 'sewer:view_pipeline',
-        QUERY_LAYERS: 'sewer:view_pipeline',
-        // LAYERS: 'sewer:pipeline_fs',
-        // QUERY_LAYERS: 'sewer:pipeline_fs',
-        WIDTH: size.x,
-        HEIGHT: size.y,
-        X: Math.round(point.x),
-        Y: Math.round(point.y),
-        BBOX: window.map.getBounds().toBBoxString()
-      }, {
+      this.publicWay(e, 'sewer:view_pipeline', 'sewer:view_pipeline', this.tableDataAffFac, 'pipecode <> \'\'')
+    },
+    // 鐐瑰嚮鎸夐挳瀹氫綅 鐨勫叕鍏变簨浠�
+    publicWay (e, layer, queryLayer, dataList, cqlfilter) {
+      const defaultWmsParams = {
         VERSION: '1.1.1',
         SERVICE: 'WMS',
         REQUEST: 'GetFeatureInfo',
-        // bbox: bbox,
         FORMAT: 'image/png',
         INFO_FORMAT: 'application/json',
         TRANSPARENT: true,
         FEATURE_COUNT: 50,
         SRS: 'EPSG:4326',
+        cql_filter: cqlfilter,
         EXCEPTIONS: 'application/vnd.ogc.se_inimage'
-      })
+      }
+      const size = window.map.getSize()
+      const point = window.map.latLngToContainerPoint(e.latlng, window.map.getZoom())
+      const wmsParams = Object.assign({
+        LAYERS: layer,
+        QUERY_LAYERS: queryLayer,
+        WIDTH: size.x,
+        HEIGHT: size.y,
+        X: Math.round(point.x),
+        Y: Math.round(point.y),
+        BBOX: window.map.getBounds().toBBoxString()
+      }, defaultWmsParams)
       AjaxUtils.get4JsonDataByUrl(WMS_URL, wmsParams, (res) => {
         console.log(res)
         for (let i = 0; i < res.data.features.length; i++) {
-          this.tableDataAffFac.push(res.data.features[i])
+          dataList.push(res.data.features[i])
         }
       })
-    },
-    // 绠$嚎鎼滅储
-    async pipelineSearch () {
-      this.SectionAndAffFacTableJudge = true
-      this.tableList = []
-      this.tableListSection = []
-      this.tableDataAffFac = []
-      this.wfsHelper.clearFilter()
-      this.wfsHelper.setTypeName(['sewer:pipeline'])
-      if (this.form.pipeName) {
-        this.wfsHelper.addLike('subchaname', this.form.pipeName)
-      }
-      // this.wfsHelper.addEquals('pipename', '\'' + this.form.pipeName + '\'')
-      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
-        // console.log(res.features)
-        this.tableList = res.features
-      }
-      this.wfsHelper = new WfsHelper()
-      this.form.pipeName = ''
-      this.form.sectionName = ''
-      this.form.affiliatedFacilities = ''
     },
     // 鐐瑰嚮纭
     confirm () {

--
Gitblit v1.8.0