From fca7ed4fff667892d94c3e86d1c4ac83292e3aef Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 27 Dec 2024 19:51:53 +0800
Subject: [PATCH] 全局搜索,结果框不清空处理
---
src/components/mapSearchBox/index.vue | 22 ++--------------------
1 files changed, 2 insertions(+), 20 deletions(-)
diff --git a/src/components/mapSearchBox/index.vue b/src/components/mapSearchBox/index.vue
index 83368e0..793f1db 100644
--- a/src/components/mapSearchBox/index.vue
+++ b/src/components/mapSearchBox/index.vue
@@ -3,7 +3,6 @@
<div class="search-content">
<el-input size="small" ref="searchTreeInput" clearable v-model="searchExtensivelyValue" @input="searchInputTree"
placeholder="请输入搜索条件" style="cursor: pointer;"></el-input>
- <!-- <button @click="searchExtensivelyClick" class="el-icon-search"></button> -->
</div>
<div v-show="searchExtensivelyValBoxShow" class="searchExtensively-val-box">
<div class="dropdown-menu" @scroll="handleScroll">
@@ -17,7 +16,6 @@
<script>
import { getSearchExtensivelyPage } from "@/api/dept/index.js"
-// import { getNinePage } from "@/api/site/index.js";
export default {
name: "mapSearchBox",
@@ -109,29 +107,12 @@
getSearchExtensively (ak, region, query) {
getSearchExtensivelyPage(ak, region, query, this.pageIndex, this.pageSize).then(res => {
const data = res.data.result
-
- console.log(data, 12112321)
-
if (data) {
data.forEach(element => {
this.searchExtensivelyArray.push(element)
})
}
})
-
- // getNinePage({
- // current: this.pageIndex,
- // size: this.pageSize,
- // placeName: query,
- // }).then((res) => {
- // const data = res.data.data.records;
- // if(data){
- // data.forEach(element => {
- // this.searchExtensivelyArray.push(element)
- // });
- // }
- // this.pages = res.data.data.pages
- // });
},
searchExtensivelyVlaClick (item) {
@@ -182,10 +163,11 @@
},
searchInputTree (newText) {
+ this.searchExtensivelyArray = []
+
if (newText == "") {
this.searchExtensivelyValBoxShow = false
this.isShowClearBtn = false
- this.searchExtensivelyArray = []
} else {
this.searchExtensivelyValBoxShow = true
--
Gitblit v1.9.3