From ecdffd165cf73c0e3c051c69d1dfdc71ba9331c8 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 26 Nov 2024 01:18:01 +0800
Subject: [PATCH] 突发事件模拟调整
---
src/pages/layout/components/mainSearch.vue | 30 +++++++++++++++++++++++++-----
1 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/src/pages/layout/components/mainSearch.vue b/src/pages/layout/components/mainSearch.vue
index e30b525..25bd885 100644
--- a/src/pages/layout/components/mainSearch.vue
+++ b/src/pages/layout/components/mainSearch.vue
@@ -14,8 +14,11 @@
@focus="onFocus"></el-input>
<div class="page-search-value-box" v-show="isShowSearchSKValBox">
<ul>
- <li v-for="(item, index) in searchSKValList" :key="index" @click="sKValItemClick(item)">{{ item.name }}
+ <li v-if="searchSKValList.length > 0" v-for="(item, index) in searchSKValList" :key="index"
+ @click="sKValItemClick(item)">{{ item.name }}
</li>
+ <!-- <li v-else>暂无数据</li> -->
+ <span v-else>{{ showText }}</span>
</ul>
</div>
</div>
@@ -29,12 +32,16 @@
let searchVal = ref('')
let searchSKValList = ref([])
+let showText = ref('暂无数据')
+
const onSearch = () => {
if (searchVal.value == '') {
isShowSearchSKValBox = false
// 清空
clearPoint()
} else {
+ showText.value = '搜索中...'
+ searchSKValList.value = []
isShowSearchSKValBox = true
getFuzzyQuery()
}
@@ -44,8 +51,11 @@
fuzzyQuery({
name: searchVal.value
}).then(res => {
- // console.log(res.data.data)
- searchSKValList.value = res.data.data
+ if (res.data.data.length > 0) {
+ searchSKValList.value = res.data.data
+ } else {
+ showText.value = '暂无数据'
+ }
})
}
@@ -102,8 +112,9 @@
window.$viewer.flyToPosition(new DC.Position(item.lng, item.lat, 2000, 0, -90, 0))
} else {
- console.log('已存在*******************************')
+ // console.log('已存在*******************************')
window.$viewer.removeLayer(addTileLayers[item.name])
+ addTileLayers = {}
}
}
@@ -170,10 +181,19 @@
}
ul>li:hover {
- background-color: #0e1a35;
+ background-color: #949597;
}
}
+ .page-search-value-box>ul>span {
+ color: #fff;
+ display: flex;
+ justify-content: center;
+ margin-top: 20px;
+ }
+
+
+
.page-search-value-box::-webkit-scrollbar {
display: none
}
--
Gitblit v1.9.3