From 0ab2ce814a49f5805b363418b7139c860a94162f Mon Sep 17 00:00:00 2001 From: wangyifeng <812766448@qq.com> Date: Wed, 21 May 2025 11:41:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=90=9C=E7=B4=A2=E8=81=8A?= =?UTF-8?q?=E5=A4=A9=E8=AE=B0=E5=BD=95=E7=BB=84=E4=BB=B6=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=94=B9=E5=8F=98=E6=90=9C=E7=B4=A2=E5=85=B3?= =?UTF-8?q?=E9=94=AE=E5=AD=97=E6=B2=A1=E6=9C=89=E6=AD=A3=E7=A1=AE=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E6=8E=A5=E5=8F=A3=E3=80=81=E5=A4=84=E7=90=86=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E7=BB=93=E6=9E=9C=E6=98=BE=E7=A4=BA=E7=AD=89=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/customModal.vue | 4 +- src/components/group/GroupPanel.vue | 3 +- src/components/search/searchItem.vue | 59 +++++--- src/components/search/searchList.vue | 49 ++++--- src/utils/auth.js | 2 +- src/views/message/inner/IndexContent.vue | 2 +- src/views/message/inner/IndexSider.vue | 163 ++++++++++++++++++----- 7 files changed, 207 insertions(+), 75 deletions(-) diff --git a/src/components/common/customModal.vue b/src/components/common/customModal.vue index bfee602..1191784 100644 --- a/src/components/common/customModal.vue +++ b/src/components/common/customModal.vue @@ -80,7 +80,7 @@ const props = defineProps({ } }) -const emit = defineEmits(['update:show', 'cancel', 'confirm']) +const emit = defineEmits(['update:show', 'cancel', 'confirm', 'customCloseModal']) const show = computed({ get: () => props.show, @@ -111,7 +111,7 @@ const state = reactive({ const handleCloseModal = () => { if (props.customCloseEvent) { - emit('closeModal') + emit('customCloseModal') } else { show.value = false } diff --git a/src/components/group/GroupPanel.vue b/src/components/group/GroupPanel.vue index 2416885..2c11bed 100644 --- a/src/components/group/GroupPanel.vue +++ b/src/components/group/GroupPanel.vue @@ -740,7 +740,8 @@ const handleEditGroupNameConfirm = () => { diff --git a/src/components/search/searchList.vue b/src/components/search/searchList.vue index cd9e97e..539e26a 100644 --- a/src/components/search/searchList.vue +++ b/src/components/search/searchList.vue @@ -2,6 +2,7 @@
@@ -19,12 +20,19 @@ searchResultKey !== 'group_infos' && searchResultKey !== 'group_member_infos' " + :style="{ margin: props.useCustomTitle ? '0' : '' }" > -
+ +
{ @@ -223,6 +236,12 @@ watch( watch( () => props.searchText, (newVal, oldVal) => { + // 同步更新 state.searchText + state.searchText = newVal + // 清空搜索结果 + state.searchResult = null + // 重置页码 + state.pageNum = 1 //重置点击停留列表项 state.clickStayItem = '' emits('clickStayItemChange', state.clickStayItem) @@ -232,18 +251,6 @@ watch( } ) -//输入搜索文本 -const inputSearchText = (e) => { - if (e.trim() != state.searchText.trim()) { - state.pageNum = 1 - state.searchResult = null // 清空搜索结果 - } - state.searchText = e.trim() - if (!e.trim()) { - state.searchResult = null // 清空搜索结果 - } -} - // ES搜索聊天记录-主页搜索什么都有、指定用户、指定群、群与用户概览 const queryAllSearch = (doClearSearchResult) => { if (doClearSearchResult) { @@ -369,6 +376,7 @@ const queryAllSearch = (doClearSearchResult) => { } else { state.hasMore = true } + emits('resultTotalCount', total) // zPaging.value?.completeByTotal([data], total) } else { state.searchResult = data @@ -534,10 +542,9 @@ const doLoadMore = (doClearSearchResult) => { return } state.loading = true - queryAllSearch(doClearSearchResult) - .finally(() => { - state.loading = false - }) + queryAllSearch(doClearSearchResult).finally(() => { + state.loading = false + }) }