From dd0c8e22956cf86ededbdc89a949344cb44c8afd Mon Sep 17 00:00:00 2001 From: "xinxin.wu" Date: Wed, 27 Nov 2024 16:42:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=B7=A5=E4=BD=9C=E5=8F=B0):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=B7=A5=E4=BD=9C=E5=8F=B0=E5=8D=A1=E7=89=87=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=88=87=E6=8D=A2=E4=BA=BA=E5=91=98=E5=81=B6=E5=8F=91?= =?UTF-8?q?=E6=80=A7bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../homePage/components/defectMemberBar.vue | 25 +++++++++++------ .../homePage/components/overview.vue | 2 -- .../homePage/components/overviewMember.vue | 27 ++++++++++++------- 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/frontend/src/views/workbench/homePage/components/defectMemberBar.vue b/frontend/src/views/workbench/homePage/components/defectMemberBar.vue index 34fa65035a..4aa4ae44bb 100644 --- a/frontend/src/views/workbench/homePage/components/defectMemberBar.vue +++ b/frontend/src/views/workbench/homePage/components/defectMemberBar.vue @@ -22,7 +22,6 @@ e.value); } - async function handleProjectChange(isRefreshKey: boolean = false) { + async function handleProjectChange(isRefreshKey: boolean = false, setAll = false) { await nextTick(); if (!isRefreshKey) { await getMemberOptions(); + if (setAll) { + innerHandleUsers.value = [...memberOptions.value.map((e) => e.value)]; + } else { + innerHandleUsers.value = innerHandleUsers.value.filter((id: string) => + memberOptions.value.some((member) => member.value === id) + ); + } } - await getDefectMemberDetail(); + await nextTick(); + getDefectMemberDetail(); } async function changeProject() { - await handleProjectChange(false); + await handleProjectChange(false, true); emit('change'); } @@ -234,9 +240,12 @@ } ); - watch([() => props.refreshKey, () => projectId.value], ([refreshKey]) => { - handleProjectChange(!!refreshKey); - }); + watch( + () => props.refreshKey, + (refreshKey) => { + handleProjectChange(!!refreshKey); + } + ); onMounted(() => { handleProjectChange(false); diff --git a/frontend/src/views/workbench/homePage/components/overview.vue b/frontend/src/views/workbench/homePage/components/overview.vue index 782011bf8b..d0a827d3e3 100644 --- a/frontend/src/views/workbench/homePage/components/overview.vue +++ b/frontend/src/views/workbench/homePage/components/overview.vue @@ -10,7 +10,6 @@ { innerSelectAll.value = selectAll.value; initOverViewDetail(); diff --git a/frontend/src/views/workbench/homePage/components/overviewMember.vue b/frontend/src/views/workbench/homePage/components/overviewMember.vue index 47a58ec1f6..32ae63422b 100644 --- a/frontend/src/views/workbench/homePage/components/overviewMember.vue +++ b/frontend/src/views/workbench/homePage/components/overviewMember.vue @@ -19,13 +19,10 @@ @change="changeProject" > - e.value); } - async function handleProjectChange(isRefreshKey: boolean = false) { + async function handleProjectChange(isRefreshKey: boolean = false, setAll = false) { await nextTick(); if (!isRefreshKey) { await getMemberOptions(); + if (setAll) { + innerHandleUsers.value = [...memberOptions.value.map((e) => e.value)]; + } else { + innerHandleUsers.value = innerHandleUsers.value.filter((id: string) => + memberOptions.value.some((member) => member.value === id) + ); + } } - await initOverViewMemberDetail(); + await nextTick(); + initOverViewMemberDetail(); } async function changeProject() { - await handleProjectChange(false); + await handleProjectChange(false, true); emit('change'); } @@ -204,9 +208,12 @@ } ); - watch([() => props.refreshKey, () => projectId.value], ([refreshKey]) => { - handleProjectChange(!!refreshKey); - }); + watch( + () => props.refreshKey, + (refreshKey) => { + handleProjectChange(!!refreshKey); + } + ); onMounted(() => { handleProjectChange(false);