From b56f9820920e7d32919bae9b00d3992603ddf8ba Mon Sep 17 00:00:00 2001 From: lizijiee <562949697@qq.com> Date: Sun, 24 Mar 2024 14:35:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=202598=20=E3=80=90AI=E4=B8=80=E9=94=AE?= =?UTF-8?q?=E6=9F=A5=E9=87=8D--=E9=AB=98=E7=BA=A7=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E3=80=91=E7=82=B9=E5=87=BB=E9=AB=98=E7=BA=A7=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E5=BC=B9=E5=87=BA=E4=B8=8B=E6=8B=89=E6=A1=86=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E5=9C=A8=E6=90=9C=E7=B4=A2=E6=A8=A1=E5=9D=97=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E6=A8=A1=E7=B3=8A=E6=95=B0=E6=8D=AE=E5=AE=9E?= =?UTF-8?q?=E6=97=B6=E6=90=9C=E7=B4=A2=E5=B9=B6=E4=BA=8E=E4=B8=8B=E6=96=B9?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=9B=B8=E5=85=B3=E6=95=B0=E6=8D=AE=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E5=85=B3=E9=97=AD=E5=BC=B9=E7=AA=97=E5=86=8D=E6=AC=A1?= =?UTF-8?q?=E6=89=93=E5=BC=80=E5=90=8E=E4=B8=8A=E6=AC=A1=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E8=BF=98=E4=BC=9A=E5=AD=98=E5=9C=A8=E4=B8=80?= =?UTF-8?q?=E7=A7=92=E9=92=9F=E6=89=8D=E4=BC=9A=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/aside/comp/AdvanceFilter.vue | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/views/home/aside/comp/AdvanceFilter.vue b/src/views/home/aside/comp/AdvanceFilter.vue index 74f5f4f..5308db4 100644 --- a/src/views/home/aside/comp/AdvanceFilter.vue +++ b/src/views/home/aside/comp/AdvanceFilter.vue @@ -27,7 +27,7 @@ const emit = defineEmits<{ const data = ref([]); const unData = ref([]); -let loading = false; +const loading = ref(false); const canloadMore = true; const el = ref(null); const popover = ref(null); @@ -74,12 +74,12 @@ useInfiniteScroll( }, { distance: 10, interval: 300, canLoadMore: () => false } ); -const showClick = () => { - inputHandler(""); +const showClick =async () => { + getSearchedList('') }; async function loadMore() { - if (loading || el.value == null) return; + if (loading.value || el.value == null) return; const more = await featchList(); @@ -89,7 +89,7 @@ async function loadMore() { } async function featchList() { - loading = true; + loading.value = true; try { const searchParam: FilterSearchParam = { search_searchname: { value: keyword.value, op: "like", type: "string" }, @@ -103,7 +103,7 @@ async function featchList() { } catch (error) { return []; } finally { - loading = false; + loading.value = false; } } @@ -148,6 +148,10 @@ function selectHandler(item: FilterEntity) { } const inputHandler = debounce((word) => { + getSearchedList(word) +}, 300); + +function getSearchedList(word) { if (word) { pagination.pageSize = 300; } else { @@ -172,7 +176,7 @@ const inputHandler = debounce((word) => { (a, b) => Number((a as any).reorder) - Number((b as any).reorder) ); }); -}, 300); +} function favoriteHandler(event: MouseEvent, item: any) { event.stopImmediatePropagation();