diff --git a/frontend/src/views/case-management/components/addDefectDrawer/utils.ts b/frontend/src/views/case-management/components/addDefectDrawer/utils.ts index 11432c266c..3021592c62 100644 --- a/frontend/src/views/case-management/components/addDefectDrawer/utils.ts +++ b/frontend/src/views/case-management/components/addDefectDrawer/utils.ts @@ -157,17 +157,29 @@ function getAssertTable(assertions: ResponseAssertionTableItem[]) { export async function getCaseQuickContent(id: string) { try { const result = await getCaseDetail(id); - const { prerequisite, steps, expectedResult } = result; + const { prerequisite, steps, expectedResult, caseEditType, textDescription } = result; + const getEmptyString = (value: string) => { + const emptyString = '

'; + return !value || emptyString.includes(value) ? '-' : value; + }; const stepData = getStepsTable(steps); + const stepContent = + caseEditType === 'STEP' + ? `

${t('system.orgTemplate.stepDescription')}

+ ${stepData}` + : ` +

${t('system.orgTemplate.textDescription')}

+

${getEmptyString(textDescription)}

+

${t('system.orgTemplate.expectedResult')}

+

${getEmptyString(expectedResult)}

+ `; + // 处理步骤 const caseContent = `

${t('system.orgTemplate.precondition')}

-

${prerequisite || '-'}

-

${t('system.orgTemplate.stepDescription')}

- ${stepData} -

${t('system.orgTemplate.expectedResult')}

-

${expectedResult || '-'}

+

${getEmptyString(prerequisite)}

+ ${stepContent}

${t('system.orgTemplate.actualResult')}

-

`; detailContentMap[CaseLinkEnum.FUNCTIONAL] = caseContent;