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);