shuishen
2024-12-27 fca7ed4fff667892d94c3e86d1c4ac83292e3aef
全局搜索,结果框不清空处理
1 files modified
22 ■■■■■ changed files
src/components/mapSearchBox/index.vue 22 ●●●●● patch | view | raw | blame | history
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