From dc2421508ec5cc18dc5ff2b2df6b39aba59188c8 Mon Sep 17 00:00:00 2001 From: seatonwan9 <seatonwan9@163.com> Date: 星期日, 30 五月 2021 20:24:25 +0800 Subject: [PATCH] Merge branch 'develop' of http://xearth.cn:6600/r/wuyushui/SewerAndRainNetwork into develop --- src/components/base-page/enterprise-emergency/events-reported/ReportLocationSearch.vue | 74 +++++++++++++++++++++++++++--------- 1 files changed, 55 insertions(+), 19 deletions(-) diff --git a/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSearch.vue b/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSearch.vue index f160110..63fa1f4 100644 --- a/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSearch.vue +++ b/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSearch.vue @@ -12,6 +12,30 @@ <el-row v-for="(item,index) in searchList.slice((currentPage-1)*pageSize,currentPage*pageSize)" :key="index" style="display: flex;align-items: center;margin: 0.1343rem 15px;text-align: left" class="environmental-risk-list"> +<!-- <div v-if="item.resultType === 1">--> + <el-col :span="4"> + <img src="../../../../../public/assets/images/map/marker-icon.png" alt="" class="state" + style="background: none;margin: 0 15px"> + </el-col> + <el-col :span="12"> + <div class=search-list> + <!-- <h4 :class="activeNum===index?'hover':''" @click="handleLocation(index)">鍚嶇О锛�<h3 style="display: inline-block">{{ item.name }}</h3></h4>--> + <h3 style="text-overflow: ellipsis;white-space: nowrap;overflow: hidden" :class="activeNum===index?'hover':''" @click="handleLocation(index)">鍚嶇О锛歿{ item.name }}</h3> + <p style="text-overflow: ellipsis;white-space: nowrap;overflow: hidden">鍦板潃锛�<span>{{ item.address }}</span> + <p style="text-overflow: ellipsis;white-space: nowrap;overflow: hidden">鐢佃瘽锛�<span>{{ item.phone }}</span></p> + </div> + </el-col> + <el-col :span="8" style="text-align: right"> + <el-button type="primary" size="mini" icon="el-icon-position" @click="locationMapClick(item,index)"> + 瀹氫綅 + </el-button> + </el-col> +<!-- </div>--> + </el-row> + <el-row v-for="(item,index) in searchListStatistics.slice((currentPage-1)*pageSize,currentPage*pageSize)" :key="index" + style="display: flex;align-items: center;margin: 0.1343rem 15px;text-align: left" + class="environmental-risk-list"> + <!-- <div v-if="item.resultType === 1">--> <el-col :span="4"> <img src="../../../../../public/assets/images/map/marker-icon.png" alt="" class="state" style="background: none;margin: 0 15px"> @@ -19,7 +43,7 @@ <el-col :span="12"> <div class=search-list> <!-- <h4 :class="activeNum===index?'hover':''" @click="handleLocation(index)">鍚嶇О锛�<h3 style="display: inline-block">{{ item.name }}</h3></h4>--> - <h3 :class="activeNum===index?'hover':''" @click="handleLocation(index)">鍚嶇О锛歿{ item.name }}</h3> + <h3 :class="activeNum===index?'hover':''" @click="handleLocation(index)" >鍚嶇О锛歿{ item.name }}</h3> <p style="text-overflow: ellipsis;white-space: nowrap;overflow: hidden">鍦板潃锛�<span>{{ item.address }}</span> <p>鐢佃瘽锛�<span>{{ item.phone }}</span></p> </div> @@ -29,10 +53,9 @@ 瀹氫綅 </el-button> </el-col> + <!-- </div>--> </el-row> - <!-- </el-scrollbar>--> - <!-- <el-card class="footer-page" >--> - <div v-if="total > 10"> + <div v-if="total > 5"> <el-pagination small @current-change="handlePage" @@ -44,7 +67,6 @@ > </el-pagination> </div> - <!-- </el-card>--> <el-row style="text-align: right"> <el-button type="primary" size="small" @click="confirm">纭</el-button> </el-row> @@ -63,17 +85,21 @@ data () { return { activeNum: -1, - // 鐐瑰嚮瀹氫綅缁戝畾鏁版嵁 - clickLocation: '', - searchList: [], - marker: window.L.layerGroup().addTo(window.map), - layer: window.L.layerGroup().addTo(window.map), - layersGroupArrList: [], + // 鍒嗛〉 total: 0, // 鍒嗛〉 榛樿灞曠ず currentPage: 1, // 鍒嗛〉 姣忛〉澶氬皯鏁版嵁 - pageSize: 3 + pageSize: 3, + // 瀹氫綅鐐瑰睍绀� + marker: window.L.layerGroup().addTo(window.map), + layersGroupArrList: [], + // 鐐瑰嚮瀹氫綅缁戝畾鏁版嵁 + clickLocation: '', + // 鎼滅储鏁版嵁灞曠ず鍒楄〃 1 + searchList: [], + // 鎼滅储鏁版嵁灞曠ず鍒楄〃 2 + searchListStatistics: [] } }, methods: { @@ -86,14 +112,19 @@ }, // 鎼滅储瀹氫綅 focusLocation () { - const getBoundsData = '' + window.map.getBounds()._southWest.lng + ',' + window.map.getBounds()._southWest.lat + ',' + window.map.getBounds()._northEast.lng + ',' + window.map.getBounds()._northEast.lat + // 姣忔杩涜鎼滅储 閮藉涔嬪墠鏁扮粍鍒楄〃杩涜缃┖ + this.searchList = [] + this.total = '' + this.searchListStatistics = [] + // 鎼滅储鏁版嵁data鍙傛暟 + const getBoundsData = '' + window.map.getBounds().getSouthWest().lng + ',' + window.map.getBounds().getSouthWest().lat + ',' + window.map.getBounds().getNorthEast().lng + ',' + window.map.getBounds().getNorthEast().lat const data = { postStr: { keyWord: this.clickLocation, level: window.map.getZoom(), mapBound: getBoundsData, queryType: 7, - count: 14, + count: 50, start: 0, queryTerminal: 10000 }, @@ -101,11 +132,16 @@ } // $http.get('http://10.246.133.164//api/search?', data) reportLocationSearch(data).then(res => { - // console.log(res) - this.searchList = res.pois - this.total = res.pois.length - // this.searchList = res.statistics.priorityCitys - // this.total = res.statistics.priorityCitys.length + console.log(res) + // 杩斿洖鏁版嵁绫诲瀷 1锛堟櫘閫歅OI锛� + if (res.resultType === 1) { + this.searchList = res.pois + this.total = res.pois.length + } else if (res.resultType === 2) { + // 杩斿洖鏁版嵁绫诲瀷 2锛堢粺璁� + this.searchListStatistics = res.statistics.priorityCitys + this.total = res.statistics.priorityCitys.length + } }) }, // 鐐瑰嚮瀹氫綅 -- Gitblit v1.8.0