From d4e9bfedd3a5d4e849395f3391025756f059c0f5 Mon Sep 17 00:00:00 2001 From: teukkk Date: Fri, 16 Aug 2024 17:21:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B&?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E8=AF=A6=E6=83=85-=E7=8A=B6=E6=80=81=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1045020 --user=吕梦园 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001045020 --- .../pure/ms-checkbox-dropdown/index.vue | 53 +++++++++++++++++++ .../case-management/caseReview/caseDetail.vue | 48 ++++++++++------- .../detail/featureCase/detail/index.vue | 39 +++++++++----- 3 files changed, 106 insertions(+), 34 deletions(-) create mode 100644 frontend/src/components/pure/ms-checkbox-dropdown/index.vue diff --git a/frontend/src/components/pure/ms-checkbox-dropdown/index.vue b/frontend/src/components/pure/ms-checkbox-dropdown/index.vue new file mode 100644 index 0000000000..2698f214a0 --- /dev/null +++ b/frontend/src/components/pure/ms-checkbox-dropdown/index.vue @@ -0,0 +1,53 @@ + + + diff --git a/frontend/src/views/case-management/caseReview/caseDetail.vue b/frontend/src/views/case-management/caseReview/caseDetail.vue index 9744cf79ea..44516d1103 100644 --- a/frontend/src/views/case-management/caseReview/caseDetail.vue +++ b/frontend/src/views/case-management/caseReview/caseDetail.vue @@ -28,19 +28,19 @@ v-model:model-value="keyword" :placeholder="t('caseManagement.caseReview.searchPlaceholder')" allow-clear - class="mr-[8px] w-[240px]" + class="mr-[8px] flex-1" @search="loadCaseList" @press-enter="loadCaseList" @clear="loadCaseList" /> - - +
@@ -290,6 +290,7 @@ import MSAvatar from '@/components/pure/ms-avatar/index.vue'; import MsCard from '@/components/pure/ms-card/index.vue'; + import MsCheckboxDropdown from '@/components/pure/ms-checkbox-dropdown/index.vue'; import MsDescription, { Description } from '@/components/pure/ms-description/index.vue'; import MsEmpty from '@/components/pure/ms-empty/index.vue'; import MsIcon from '@/components/pure/ms-icon-font/index.vue'; @@ -341,9 +342,9 @@ } } - const type = ref(''); + const type = ref([]); + const tableFilter = ref(); const typeOptions = ref([ - { label: t('common.all'), value: '' }, { label: t(reviewResultMap.UN_REVIEWED.label), value: 'UN_REVIEWED' }, { label: t(reviewResultMap.PASS.label), value: 'PASS' }, { label: t(reviewResultMap.UN_PASS.label), value: 'UN_PASS' }, @@ -374,11 +375,10 @@ keyword: keyword.value, current: pageNation.value.current || 1, pageSize: pageNation.value.pageSize, - filter: type.value - ? { - status: [type.value], - } - : undefined, + filter: { + ...tableFilter.value, + status: type.value, + }, ...otherListQueryParams.value, }); caseList.value = res.list; @@ -391,6 +391,11 @@ } } + function handleExecResultChange(val: string[]) { + type.value = val; + loadCaseList(); + } + watch( () => onlyMineStatus.value, () => { @@ -526,8 +531,8 @@ watch( () => activeCaseId.value, - () => { - loadCaseDetail(); + async () => { + await loadCaseDetail(); initReviewerAndStatus(); initReviewHistoryList(); } @@ -555,7 +560,7 @@ const index = caseList.value.findIndex((e) => e.caseId === activeCaseId.value); // 如果过滤的状态和评审状态不一样,则这条将从当前列表排除 - const oneMissingCase = type.value !== '' && status !== type.value; + const oneMissingCase = type.value.length && !type.value.includes(status); if (oneMissingCase) { if ((pageNation.value.current - 1) * pageNation.value.pageSize + index + 1 < pageNation.value.total) { // 不是最后一个 @@ -583,14 +588,14 @@ // 当前是最后一个,刷新数据 loadCaseDetail(); initReviewHistoryList(); - loadCaseList(); + await loadCaseList(); initReviewerAndStatus(); } } else { // 不自动下一个才请求详情 loadCaseDetail(); initReviewHistoryList(); - loadCaseList(); + await loadCaseList(); initReviewerAndStatus(); } } @@ -611,6 +616,7 @@ current, viewFlag: _onlyMine, keyword: _keyword, + filter, combine, sort, searchMode, @@ -623,6 +629,8 @@ }; viewFlag.value = !!_onlyMine; keyword.value = _keyword; + tableFilter.value = filter; + type.value = filter.status; otherListQueryParams.value = { combine, sort, @@ -633,7 +641,7 @@ keyword.value = route.query.reviewId as string; } await initDetail(); - loadCase(); + await loadCase(); initReviewerAndStatus(); if (showTab.value === 'detail') { initReviewHistoryList(); diff --git a/frontend/src/views/test-plan/testPlan/detail/featureCase/detail/index.vue b/frontend/src/views/test-plan/testPlan/detail/featureCase/detail/index.vue index 036208c4ef..0a66501c8a 100644 --- a/frontend/src/views/test-plan/testPlan/detail/featureCase/detail/index.vue +++ b/frontend/src/views/test-plan/testPlan/detail/featureCase/detail/index.vue @@ -14,18 +14,21 @@ v-model:model-value="keyword" :placeholder="t('caseManagement.caseReview.searchPlaceholder')" allow-clear - class="mr-[8px] w-[176px]" + class="mr-[8px] flex-1" @search="loadCaseList" @press-enter="loadCaseList" @clear="loadCaseList" /> - - + +
@@ -241,6 +244,7 @@ import MsButton from '@/components/pure/ms-button/index.vue'; import MsCard from '@/components/pure/ms-card/index.vue'; + import MsCheckboxDropdown from '@/components/pure/ms-checkbox-dropdown/index.vue'; import MsDescription, { Description } from '@/components/pure/ms-description/index.vue'; import MsEmpty from '@/components/pure/ms-empty/index.vue'; import MsPagination from '@/components/pure/ms-pagination/index'; @@ -302,10 +306,10 @@ const activeId = ref(route.query.testPlanCaseId as string); const canEdit = ref(route.query.canEdit === 'true'); const keyword = ref(''); - const lastExecResult = ref(''); + const lastExecResult = ref([]); + const tableFilter = ref(); const executeResultOptions = computed(() => { return [ - { label: t('common.all'), value: '' }, ...Object.keys(executionResultMap).map((key) => { return { value: key, @@ -331,11 +335,10 @@ keyword: keyword.value, current: pageNation.value.current || 1, pageSize: pageNation.value.pageSize, - filter: lastExecResult.value - ? { - lastExecResult: [lastExecResult.value], - } - : undefined, + filter: { + ...tableFilter.value, + lastExecResult: lastExecResult.value, + }, ...otherListQueryParams.value, }); caseList.value = res.list; @@ -348,6 +351,11 @@ } } + function handleExecResultChange(val: string[]) { + lastExecResult.value = val; + loadCaseList(); + } + function goCaseDetail() { openNewPage(CaseManagementRouteEnum.CASE_MANAGEMENT_CASE, { id: activeCaseId.value, @@ -464,7 +472,7 @@ const index = caseList.value.findIndex((e) => e.id === activeId.value); // 如果过滤的状态和执行状态不一样,则这条将从当前列表排除 - const oneMissingCase = lastExecResult.value !== '' && status !== lastExecResult.value; + const oneMissingCase = lastExecResult.value.length && !lastExecResult.value.includes(status); if (oneMissingCase) { if ((pageNation.value.current - 1) * pageNation.value.pageSize + index + 1 < pageNation.value.total) { // 不是最后一个 @@ -594,6 +602,7 @@ total, pageSize, current, + filter, keyword: _keyword, sort, moduleIds, @@ -607,6 +616,8 @@ current, }; keyword.value = _keyword; + tableFilter.value = filter; + lastExecResult.value = filter.lastExecResult; otherListQueryParams.value = { sort, moduleIds,