fix(测试计划): 修复测试计划一键快创缺陷拼接缺陷名称&用例状态

This commit is contained in:
xinxin.wu 2024-10-21 18:08:07 +08:00 committed by Craftsman
parent 91bf2b4053
commit e5ff245aa5
5 changed files with 20 additions and 12 deletions

View File

@ -26,8 +26,8 @@ function getStepsTable(steps: string) {
const formatContent = (rows: StepList, key: keyof StepList) => {
const valueKey = key as keyof StepList;
return alertStatus.includes(rows.status as string)
? `<span style="color:#f00"> ${rows[valueKey]} </span>`
: `<span> ${rows[valueKey]} </span>`;
? `<span style="color:#f00"> ${rows[valueKey] || '-'} </span>`
: `<span> ${rows[valueKey] || '-'} </span>`;
};
const templateFieldColumns = [
{

View File

@ -190,7 +190,7 @@
import { AssociatedBugApiTypeEnum } from '@/enums/associateBugEnum';
import { CaseLinkEnum } from '@/enums/caseEnum';
import { GlobalEventNameEnum } from '@/enums/commonEnum';
import { ReportEnum } from '@/enums/reportEnum';
import { ReportEnum, ReportStatus } from '@/enums/reportEnum';
import { ApiTestRouteEnum } from '@/enums/routeEnum';
import { TableKeyEnum } from '@/enums/tableEnum';
import { FilterRemoteMethodsEnum, FilterSlotNameEnum } from '@/enums/tableFilterEnum';
@ -965,11 +965,12 @@
function associateAndCreateDefect(isAssociate: boolean, isBatch: boolean, record?: PlanDetailApiCaseItem) {
isBatchAssociateOrCreate.value = isBatch;
if (record) {
const { id, apiTestCaseId, lastExecReportId, name } = record;
const { id, apiTestCaseId, lastExecReportId, name, lastExecResult } = record;
associatedCaseId.value = apiTestCaseId;
lastExecuteReportId.value = lastExecReportId;
testPlanCaseId.value = id;
caseTitle.value = name;
const lastStatusName = `_${t(ReportStatus[lastExecResult]?.label ?? '')}`;
caseTitle.value = `${name}${lastStatusName}`;
}
if (isAssociate) {
showLinkBugDrawer.value = true;

View File

@ -189,7 +189,7 @@
import { AssociatedBugApiTypeEnum } from '@/enums/associateBugEnum';
import { CaseLinkEnum } from '@/enums/caseEnum';
import { GlobalEventNameEnum } from '@/enums/commonEnum';
import { ReportEnum } from '@/enums/reportEnum';
import { ReportEnum, ReportStatus } from '@/enums/reportEnum';
import { ApiTestRouteEnum } from '@/enums/routeEnum';
import { TableKeyEnum } from '@/enums/tableEnum';
import { FilterRemoteMethodsEnum, FilterSlotNameEnum } from '@/enums/tableFilterEnum';
@ -941,11 +941,12 @@
function associateAndCreateDefect(isAssociate: boolean, isBatch: boolean, record?: PlanDetailApiScenarioItem) {
isBatchAssociateOrCreate.value = isBatch;
if (record) {
const { id, apiScenarioId, lastExecReportId, name } = record;
const { id, apiScenarioId, lastExecReportId, name, lastExecResult } = record;
associatedCaseId.value = apiScenarioId;
testPlanCaseId.value = id;
lastExecuteReportId.value = lastExecReportId;
caseTitle.value = name;
const lastStatusName = `_${t(ReportStatus[lastExecResult]?.label ?? '')}`;
caseTitle.value = `${name}${lastStatusName}`;
}
if (isAssociate) {
showLinkBugDrawer.value = true;

View File

@ -1070,10 +1070,11 @@
function associateAndCreateDefect(isAssociate: boolean, isBatch: boolean, record?: PlanDetailFeatureCaseItem) {
isBatchAssociateOrCreate.value = isBatch;
if (record) {
const { id, caseId, name } = record;
const { id, caseId, name, lastExecResult } = record;
associatedCaseId.value = caseId;
testPlanCaseId.value = id;
caseTitle.value = name;
const lastStatusName = `_${t(executionResultMap[lastExecResult]?.statusText ?? '')}`;
caseTitle.value = `${name}${lastStatusName}`;
}
if (isAssociate) {
showLinkBugDrawer.value = true;

View File

@ -236,7 +236,7 @@
:fill-config="{
isQuickFillContent: true,
detailId: activeId,
name: caseDetail.name,
name: caseTitle,
}"
:case-type="CaseLinkEnum.FUNCTIONAL"
@success="loadBugListAndCaseDetail"
@ -255,7 +255,6 @@
import MsEmpty from '@/components/pure/ms-empty/index.vue';
import MsPagination from '@/components/pure/ms-pagination/index';
import MsTab from '@/components/pure/ms-tab/index.vue';
import MsTag from '@/components/pure/ms-tag/ms-tag.vue';
import ExecuteResult from '@/components/business/ms-case-associate/executeResult.vue';
import MsStatusTag from '@/components/business/ms-status-tag/index.vue';
import BugList from './bug/index.vue';
@ -393,6 +392,12 @@
]);
const descriptions = ref<Description[]>([]);
const caseTitle = computed(() => {
const { lastExecuteResult, name } = caseDetail.value;
const lastStatusName = `_${t(executionResultMap[lastExecuteResult]?.statusText ?? '')}`;
return `${name}${lastStatusName}`;
});
//
async function loadCaseDetail() {
try {