From 3d69aca217ca66daa01a80c26570441e0b03875f Mon Sep 17 00:00:00 2001 From: lixuliang <lixuliang_hd@126.com> Date: 星期一, 12 五月 2025 16:47:41 +0800 Subject: [PATCH] 1 --- src/components/right/tools/search.vue | 75 +++++++++++-------------------------- 1 files changed, 23 insertions(+), 52 deletions(-) diff --git a/src/components/right/tools/search.vue b/src/components/right/tools/search.vue index 9b6d2cf..5c83941 100644 --- a/src/components/right/tools/search.vue +++ b/src/components/right/tools/search.vue @@ -1,15 +1,8 @@ <template> <div class="search" id="search"> <div class="searchInput"> - <el-input - v-loading="loading" - :disabled="loading" - placeholder="璇疯緭鍏ュ湴鍚嶅湴鍧�" - prefix-icon="el-icon-search" - :clearable="clearable" - v-model="poi_text" - @input="changeInput" - ></el-input> + <el-input v-loading="loading" :disabled="loading" placeholder="璇疯緭鍏ュ湴鍚嶅湴鍧�" prefix-icon="el-icon-search" + :clearable="clearable" v-model="poi_text" @input="changeInput"></el-input> <!-- <el-autocomplete v-model="state" :fetch-suggestions="querySearchAsync" placeholder="璇疯緭鍏ュ湴鍚嶅湴鍧�" @select="handleSelect"></el-autocomplete> --> @@ -24,12 +17,7 @@ <div>鍏辨壘鍒皗{ total }}鏉$粨鏋�</div> <hr /> <div class="searchList"> - <div - class="searchItem" - v-for="(item, index) in poiList" - :key="index" - @click="flyTo(item)" - > + <div class="searchItem" v-for="(item, index) in poiList" :key="index" @click="flyTo(item)"> <el-button> <div class="itemName"> <i class="el-icon-map-location"></i> @@ -202,7 +190,7 @@ // this.address = response.data; // }); }, - mounted() {}, + mounted() { }, methods: { changeInput(e) { this.poi_text = this.isNull(e); @@ -279,65 +267,46 @@ this.searching = true; axios .all([ - // http://172.26.64.84/service/ImageEngine/picdis/abc?user=jjjskfq&password=Jjjskfq@2022 - axios.get("http://10.10.4.116:8085/yzAdapter/Navigation", { - params: { - request: "bdPoi", - query: this.poi_text, - output: "json", - coord: "cgcs2000", - page_num: 0, - page_size: 20, - }, - }), - axios.post("http://10.10.4.115:8022/poisearch/qgpoi/POIQuery", { - adcode: "110115", - address: { - name: "", - type: "", - }, - adname: "澶у叴鍖�", - cityname: "鍖椾含甯�", - name: { - name: this.poi_text, - type: "", - }, - page: 1, - perPageCount: 20, - pcode: "110000", - pname: "", - resType: "", - }), + axios.get(`http://10.10.4.116:8086/gadapter/poi/text?keyword=${this.poi_text}&output=json&coord=cgcs2000`), + axios.get(`http://10.10.4.116:8086/cs/selectIndustrialPark?pageIndex=1&pageSize=20&yqmc=${this.poi_text}`), ]) .then((data) => { this.searching = false; let Allresults = []; - // 甯傜骇骞冲彴 if (data[0].data.status == 0) { data[0].data.results.forEach((val) => { let obj = { address: val.address, adname: val.area, cityname: val.city, - id: val.uid, - lat: val.location.lat, - lng: val.location.lng, + id: val.id, + lng: Number(val.location.split(',')[0]), + lat: Number(val.location.split(',')[1]), name: val.name, pname: val.province, + street: val.street, + tag: val.tag, }; Allresults.push(obj); }); } //115鎺ュ彛 if (data[1].status == 200) { - data[1].data.data.res + data[1].data.data .filter((item) => { - return item.name.includes(this.poi_text); + return item.yqmc.includes(this.poi_text); }) .forEach((val) => { - Allresults.push(val); + let obj = { + address: val.dz, + lng: val.x, + lat: val.y, + name: val.yqmc, + }; + Allresults.push(obj); }); } + console.log(Allresults); this.total = Allresults.length; this.poiList = Allresults; this.loading = false; @@ -449,6 +418,8 @@ }, flyTo(item) { flyPoint && Viewer.entities.remove(flyPoint); + console.log(item); + sgworld.Navigate.flyToPointsInterest({ destination: Cesium.Cartesian3.fromDegrees( // item.LABELX, -- Gitblit v1.9.3