| | |
| | | @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> |
| | |
| | | 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() |
| | | } |
| | |
| | | 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 = '暂无数据' |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | 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 = {} |
| | | } |
| | |
| | | } |
| | | |
| | | 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 |
| | | } |