fix(测试计划): 修改cr提到的问题

This commit is contained in:
xinxin.wu 2024-05-14 18:00:11 +08:00 committed by Craftsman
parent 22e9354a51
commit e5cb2be8bd
10 changed files with 35 additions and 31 deletions

View File

@ -30,7 +30,7 @@ export const archivedPlanUrl = '/test-plan/archived';
export const batchCopyPlanUrl = '/test-plan/batch-copy'; export const batchCopyPlanUrl = '/test-plan/batch-copy';
// 批量移动 // 批量移动
export const batchMovePlanUrl = '/test-plan/batch/move'; export const batchMovePlanUrl = '/test-plan/batch/move';
// 批量移动 // 批量归档
export const batchArchivedPlanUrl = '/test-plan/batch-archived'; export const batchArchivedPlanUrl = '/test-plan/batch-archived';
// 计划详情缺陷管理列表 // 计划详情缺陷管理列表
export const planDetailBugPageUrl = '/test-plan/bug/page'; export const planDetailBugPageUrl = '/test-plan/bug/page';

View File

@ -23,7 +23,7 @@ export const testPlanDefaultDetail: TestPlanDetail = {
underReviewedCount: 0, underReviewedCount: 0,
}; };
export const initDetailCount: PassRateCountDetail = { export const defaultDetailCount: PassRateCountDetail = {
id: '', id: '',
passThreshold: 0, passThreshold: 0,
passRate: 0, passRate: 0,

View File

@ -56,7 +56,6 @@ export interface AddTestPlanParams {
functionalCaseCount?: number; functionalCaseCount?: number;
} }
// TODO: 对照后端字段
export interface TestPlanDetail extends AddTestPlanParams { export interface TestPlanDetail extends AddTestPlanParams {
num: number; num: number;
groupName?: string; groupName?: string;

View File

@ -116,7 +116,7 @@
// status: statusFilterValue.value, // status: statusFilterValue.value,
// handleUser: handleUserFilterValue.value, // handleUser: handleUserFilterValue.value,
}; };
// TODO // TODO
filterParams[severityColumnId.value] = severityFilterValue.value; filterParams[severityColumnId.value] = severityFilterValue.value;
return { return {
keyword: props.keyword, keyword: props.keyword,
@ -149,9 +149,17 @@
searchData(); searchData();
}); });
watch(
() => props.bugColumns,
(val) => {
if (val) {
bugTableRef.value.initColumn(val);
}
}
);
defineExpose({ defineExpose({
searchData, searchData,
bugTableRef,
}); });
</script> </script>

View File

@ -180,7 +180,7 @@
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const columns: MsTableColumn = [ const columns = ref<MsTableColumn>([
{ {
title: 'caseManagement.featureCase.tableColumnID', title: 'caseManagement.featureCase.tableColumnID',
dataIndex: 'num', dataIndex: 'num',
@ -244,7 +244,7 @@
showInTable: true, showInTable: true,
showDrag: false, showDrag: false,
}, },
]; ]);
const testPlanColumns: MsTableColumn = [ const testPlanColumns: MsTableColumn = [
{ {
@ -342,8 +342,7 @@
handleUser: handleUserFilterOptions.value, handleUser: handleUserFilterOptions.value,
}; };
if (showType.value === 'link') { if (showType.value === 'link') {
const columnList = makeColumns(optionsMap, columns); columns.value = makeColumns(optionsMap, columns.value);
bugTableListRef.value.bugTableRef.initColumn(columnList);
} else { } else {
const planColumnList = makeColumns(optionsMap, testPlanColumns); const planColumnList = makeColumns(optionsMap, testPlanColumns);
planTableRef.value.initColumn(planColumnList); planTableRef.value.initColumn(planColumnList);

View File

@ -112,7 +112,7 @@
<template #passRate="{ record }"> <template #passRate="{ record }">
<div class="mr-[8px] w-[100px]"> <div class="mr-[8px] w-[100px]">
<StatusProgress :status-detail="initDefaultCountDetailMap[record.id]" height="5px" /> <StatusProgress :status-detail="defaultCountDetailMap[record.id]" height="5px" />
</div> </div>
<div class="text-[var(--color-text-1)]"> <div class="text-[var(--color-text-1)]">
{{ `${record.passRate || 0}%` }} {{ `${record.passRate || 0}%` }}
@ -645,13 +645,13 @@
}); });
} }
const initDefaultCountDetailMap = ref<Record<string, PassRateCountDetail>>({}); const defaultCountDetailMap = ref<Record<string, PassRateCountDetail>>({});
async function getStatistics(selectedPlanIds: (string | undefined)[]) { async function getStatistics(selectedPlanIds: (string | undefined)[]) {
try { try {
const result = await getPlanPassRate(selectedPlanIds); const result = await getPlanPassRate(selectedPlanIds);
result.forEach((item: PassRateCountDetail) => { result.forEach((item: PassRateCountDetail) => {
initDefaultCountDetailMap.value[item.id] = item; defaultCountDetailMap.value[item.id] = item;
}); });
} catch (error) { } catch (error) {
console.log(error); console.log(error);
@ -883,7 +883,7 @@
} }
const showStatusDeleteModal = ref<boolean>(false); const showStatusDeleteModal = ref<boolean>(false);
const activeRecord = ref<TestPlanItem | undefined>(); const activeRecord = ref<TestPlanItem>();
function deleteStatusHandler(record: TestPlanItem) { function deleteStatusHandler(record: TestPlanItem) {
activeRecord.value = cloneDeep(record); activeRecord.value = cloneDeep(record);
showStatusDeleteModal.value = true; showStatusDeleteModal.value = true;

View File

@ -69,7 +69,7 @@
import MsColorLine from '@/components/pure/ms-color-line/index.vue'; import MsColorLine from '@/components/pure/ms-color-line/index.vue';
import { initDetailCount } from '@/config/testPlan'; import { defaultDetailCount } from '@/config/testPlan';
import { useI18n } from '@/hooks/useI18n'; import { useI18n } from '@/hooks/useI18n';
import type { PassRateCountDetail } from '@/models/testPlan/testPlan'; import type { PassRateCountDetail } from '@/models/testPlan/testPlan';
@ -81,10 +81,10 @@
}>(); }>();
const { t } = useI18n(); const { t } = useI18n();
const detailCount = ref({ ...initDetailCount }); const detailCount = ref({ ...defaultDetailCount });
watchEffect(() => { watchEffect(() => {
detailCount.value = { detailCount.value = {
...initDetailCount, ...defaultDetailCount,
...props.statusDetail, ...props.statusDetail,
}; };
}); });

View File

@ -53,7 +53,7 @@
</div> </div>
<BugList <BugList
ref="bugTableListRef" ref="bugTableListRef"
:case-id="props.caseId" :case-id="props.caseId || '653745575542786'"
:keyword="keyword" :keyword="keyword"
:bug-total="total" :bug-total="total"
:bug-columns="columns" :bug-columns="columns"
@ -63,11 +63,11 @@
/> />
<LinkDefectDrawer <LinkDefectDrawer
v-model:visible="showLinkDrawer" v-model:visible="showLinkDrawer"
:case-id="props.caseId" :case-id="props.caseId || '653745575542786'"
:drawer-loading="drawerLoading" :drawer-loading="drawerLoading"
@save="saveHandler" @save="saveHandler"
/> />
<AddDefectDrawer v-model:visible="showDrawer" :case-id="props.caseId" @success="initData()" /> <AddDefectDrawer v-model:visible="showDrawer" :case-id="props.caseId || '653745575542786'" @success="initData()" />
</div> </div>
</template> </template>
@ -100,7 +100,7 @@
const keyword = ref<string>(''); const keyword = ref<string>('');
const columns: MsTableColumn = [ const columns = ref<MsTableColumn>([
{ {
title: 'caseManagement.featureCase.tableColumnID', title: 'caseManagement.featureCase.tableColumnID',
dataIndex: 'num', dataIndex: 'num',
@ -164,7 +164,7 @@
showInTable: true, showInTable: true,
showDrag: false, showDrag: false,
}, },
]; ]);
const bugTableListRef = ref(); const bugTableListRef = ref();
@ -241,8 +241,7 @@
status: statusFilterOptions.value, status: statusFilterOptions.value,
handleUser: handleUserFilterOptions.value, handleUser: handleUserFilterOptions.value,
}; };
const columnList = makeColumns(optionsMap, columns); columns.value = makeColumns(optionsMap, columns.value);
bugTableListRef.value.bugTableRef.initColumn(columnList);
} }
} }

View File

@ -81,7 +81,8 @@
/> />
<div class="tab-content"> <div class="tab-content">
<BugList v-if="activeTab === 'defectList'" :case-id="caseDetail.id" /> <BugList v-if="activeTab === 'defectList'" :case-id="caseDetail.id" />
<ExecutionHistory v-if="activeTab === 'executionHistory'" :case-id="caseDetail.id" /> <!-- TODO 待写页面 还未提交 -->
<!-- <ExecutionHistory v-if="activeTab === 'executionHistory'" :case-id="caseDetail.id" /> -->
</div> </div>
</a-spin> </a-spin>
</div> </div>
@ -98,8 +99,8 @@
import ExecuteResult from '@/components/business/ms-case-associate/executeResult.vue'; import ExecuteResult from '@/components/business/ms-case-associate/executeResult.vue';
import MsStatusTag from '@/components/business/ms-status-tag/index.vue'; import MsStatusTag from '@/components/business/ms-status-tag/index.vue';
import BugList from './bug/index.vue'; import BugList from './bug/index.vue';
import ExecutionHistory from '@/views/test-plan/testPlan/detail/featureCase/detail/executionHistory/index.vue';
// import ExecutionHistory from '@/views/test-plan/testPlan/detail/featureCase/detail/executionHistory/index.vue';
import { getPlanDetailFeatureCaseList } from '@/api/modules/test-plan/testPlan'; import { getPlanDetailFeatureCaseList } from '@/api/modules/test-plan/testPlan';
import { useI18n } from '@/hooks/useI18n'; import { useI18n } from '@/hooks/useI18n';
import useAppStore from '@/store/modules/app'; import useAppStore from '@/store/modules/app';

View File

@ -65,8 +65,7 @@
<div class="mb-[8px] flex items-center gap-[24px] text-[12px]"> <div class="mb-[8px] flex items-center gap-[24px] text-[12px]">
<div class="text-[var(--color-text-4)]"> <div class="text-[var(--color-text-4)]">
<span class="mr-[8px]">{{ t('testPlan.testPlanDetail.executed') }}</span> <span class="mr-[8px]">{{ t('testPlan.testPlanDetail.executed') }}</span>
<span v-if="detail.status === 'PREPARED'" class="text-[var(--color-text-1)]">-</span> <span>
<span v-else>
<span class="mr-1 font-medium text-[var(--color-text-1)]"> {{ hasExecutedCount }} </span>/<span <span class="mr-1 font-medium text-[var(--color-text-1)]"> {{ hasExecutedCount }} </span>/<span
class="ml-1" class="ml-1"
>{{ countDetail.caseTotal }}</span >{{ countDetail.caseTotal }}</span
@ -75,8 +74,7 @@
</div> </div>
<div class="text-[var(--color-text-4)]"> <div class="text-[var(--color-text-4)]">
<span class="mr-[8px]">{{ t('caseManagement.caseReview.passRate') }}</span> <span class="mr-[8px]">{{ t('caseManagement.caseReview.passRate') }}</span>
<span v-if="detail.status === 'PREPARED'" class="text-[var(--color-text-1)]"></span> <span>
<span v-else>
<span class="font-medium text-[var(--color-text-1)]"> {{ countDetail.passRate }}% </span> <span class="font-medium text-[var(--color-text-1)]"> {{ countDetail.passRate }}% </span>
</span> </span>
</div> </div>
@ -132,7 +130,7 @@
getTestPlanDetail, getTestPlanDetail,
getTestPlanModule, getTestPlanModule,
} from '@/api/modules/test-plan/testPlan'; } from '@/api/modules/test-plan/testPlan';
import { initDetailCount, testPlanDefaultDetail } from '@/config/testPlan'; import { defaultDetailCount, testPlanDefaultDetail } from '@/config/testPlan';
import { useI18n } from '@/hooks/useI18n'; import { useI18n } from '@/hooks/useI18n';
import useModal from '@/hooks/useModal'; import useModal from '@/hooks/useModal';
import useAppStore from '@/store/modules/app'; import useAppStore from '@/store/modules/app';
@ -159,7 +157,7 @@
...testPlanDefaultDetail, ...testPlanDefaultDetail,
}); });
const countDetail = ref<PassRateCountDetail>({ ...initDetailCount }); const countDetail = ref<PassRateCountDetail>({ ...defaultDetailCount });
const hasExecutedCount = computed(() => { const hasExecutedCount = computed(() => {
const { successCount, fakeErrorCount, errorCount, blockCount } = countDetail.value; const { successCount, fakeErrorCount, errorCount, blockCount } = countDetail.value;