From 2a7eda5ee3ab1709638e8bc02eac1356703a9c38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E5=A4=A7=E8=83=86?= <1101282782@qq.com> Date: Mon, 20 Oct 2025 13:56:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E6=90=9C=E7=B4=A2=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/components/tree/index.vue | 45 ++++++++----------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/src/renderer/src/views/components/tree/index.vue b/src/renderer/src/views/components/tree/index.vue index 12ce541..01bebaf 100644 --- a/src/renderer/src/views/components/tree/index.vue +++ b/src/renderer/src/views/components/tree/index.vue @@ -124,8 +124,8 @@ const treeMouseOver = () => { } const selectChange = (val) => { - let input = document.getElementById('keyword'); - (window as any).treeSearchCb('') + let input = document.getElementById('keyword') + ;(window as any).treeSearchCb('') if (val == 'poi') { searchKey.value = '' // input.value = '' @@ -136,39 +136,27 @@ const selectChange = (val) => { // input.value = '' } if ((window as any).searchPlaceEntity) { - (window as any).searchPlaceEntity.remove() + ;(window as any).searchPlaceEntity.remove() } } const clearResult = () => { - // if (select.value == 'tree') { - // let string = searchKey.value.trim() - // if (string == '') { - // let arr = [] - // if (window.searchPlaceMap) { - // arr = Array.from(window.searchPlaceMap) - // } - // if (arr.length) { - // window.searchPlaceMap.get(arr[0][0]).remove() - // window.searchPlaceMap.clear() - // } - // poiOptions.value = [] - // value.value = '' - // window.treeSearchCb('') - // } - // } let string = searchKey.value.trim() + if (string == '') { let arr = [] if ((window as any).searchPlaceMap) { arr = Array.from((window as any).searchPlaceMap) } if (arr.length) { - (window as any).searchPlaceMap.get(arr[0][0]).remove() - (window as any).searchPlaceMap.clear() + const target = (window as any).searchPlaceMap.get(arr[0][0]) + if (target && typeof target.remove === 'function') { + target.remove() + ;(window as any).searchPlaceMap.clear() + } } poiOptions.value = [] - value.value = ''; - (window as any).treeSearchCb('') + value.value = '' + ;(window as any) && (window as any).treeSearchCb('') } } const cancel = () => { @@ -177,7 +165,7 @@ const cancel = () => { var mapModule var key = -// @ts-ignore + // @ts-ignore (localStorage.getItem('AMapKey') && localStorage.getItem('AMapKey').split('|')[0]) || 'd88fcc689d1aa99866b2d0d83fd36677' var isOnline = false @@ -210,7 +198,7 @@ const searchPlace = debounce(function () { value.value = '' let way = localStorage.getItem('searchWay') if (way == 'net') { - (window as any).treeSearchCb() + ;(window as any).treeSearchCb() loading.value = true const doSearch = () => { mapModule.plugin(['AMap.PlaceSearch', 'AMap.AutoComplete'], () => { @@ -295,8 +283,8 @@ const searchPlace = debounce(function () { } } else { poiOptions.value = [] - value.value = ''; - (window as any).treeSearchCb(searchKey.value) + value.value = '' + ;(window as any).treeSearchCb(searchKey.value) } }, 500) @@ -575,4 +563,7 @@ defineExpose({ .el-dialog__footer { padding: 10px !important; } +.el-select-dropdown__wrap { + max-height: 260px !important; +}