From ed3fd8e2766b90a88939771ce7e2a176d8dde839 Mon Sep 17 00:00:00 2001 From: KDZhu Date: Thu, 26 Sep 2024 17:22:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=AF=B9=E6=AF=94=E6=98=BE=E7=A4=BA=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98=20#=20Reviewed,=20transact?= =?UTF-8?q?ion=20id:=2019528?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/version-diff/index.vue | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/dashboard-front/src/components/version-diff/index.vue b/src/dashboard-front/src/components/version-diff/index.vue index 200315efc..564e0e7ff 100644 --- a/src/dashboard-front/src/components/version-diff/index.vue +++ b/src/dashboard-front/src/components/version-diff/index.vue @@ -529,12 +529,12 @@ const handleClear = () => { searchKeyword.value = ''; }; -const handleSwitch = () => { +const handleSwitch = async () => { [localSourceId.value, localTargetId.value] = [ localTargetId.value, localSourceId.value, ]; - getDiffData(); + await getDiffData(); }; const checkMatch = (item: any, type: any) => { @@ -606,31 +606,27 @@ const updateTableEmptyConfig = () => { tableEmptyConf.value.keyword = ''; }; -const handleClearFilterKey = () => { +const handleClearFilterKey = async () => { searchParams.keyword = ''; searchParams.diffType = ''; searchKeyword.value = ''; - getDiffData(); + await getDiffData(); updateTableEmptyConfig(); }; -const handleVersionChange = () => { +const handleVersionChange = async () => { searchParams.keyword = ''; searchParams.diffType = ''; searchParams.onlyUpdated = false; - searchKeyword.value = ''; - getDiffData(); + await getDiffData(); }; const getDiffData = async () => { - // if (!localSourceId.value) { - // return false; - // } - - if (isDataLoading.value) { + if (isDataLoading.value || !localSourceId.value) { return false; } + isDataLoading.value = true; diffData.add = []; @@ -763,12 +759,12 @@ const localTargetTriggerLabel = computed(() => { watch( () => [props.sourceId, props.targetId], - (newArr) => { + async (newArr) => { const [sourceId, targetId] = newArr; localSourceId.value = sourceId; localTargetId.value = targetId || 'current'; isDataLoading.value = false; - getDiffData(); + await getDiffData(); }, );