From 8e00b7b7f1555946566110bb419ce02350c58c0f Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Mon, 29 Aug 2022 16:36:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B=E5=88=97=E8=A1=A8=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E7=8A=B6=E6=80=81=E7=9A=84=E7=AD=9B=E9=80=89=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1016347 --user=宋昌昌 【测试跟踪】github #17449,测试跟踪>>功能测试>>用例列表:列表头中【用例状态=“已完成”】,查找的结果信息不正确 https://www.tapd.cn/55049933/s/1235172 --- .../metersphere/track/service/TestCaseService.java | 2 -- .../track/case/components/TestCaseList.vue | 3 +++ frontend/src/common/js/tableUtils.js | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java index b597433159..641fc10bff 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java @@ -197,7 +197,6 @@ public class TestCaseService { request.setCustomNum(request.getNum().toString()); } request.setReviewStatus(TestCaseReviewStatus.Prepare.name()); - request.setStatus(TestCaseReviewStatus.Prepare.name()); request.setDemandId(request.getDemandId()); request.setDemandName(request.getDemandName()); request.setCreateUser(SessionUtils.getUserId()); @@ -759,7 +758,6 @@ public class TestCaseService { LogUtil.error("Parse case exec status error:" + e.getMessage()); } } - data.setStatus(dataStatus); } } return returnList; diff --git a/frontend/src/business/components/track/case/components/TestCaseList.vue b/frontend/src/business/components/track/case/components/TestCaseList.vue index dd2ffa76f8..86c73cf93e 100644 --- a/frontend/src/business/components/track/case/components/TestCaseList.vue +++ b/frontend/src/business/components/track/case/components/TestCaseList.vue @@ -691,6 +691,9 @@ export default { return value; }, getCustomFieldFilter(field) { + if (field.options) { + return field.options; + } if (field.name === '用例等级') { return this.priorityFilters; } else if (field.name === '用例状态') { diff --git a/frontend/src/common/js/tableUtils.js b/frontend/src/common/js/tableUtils.js index 78499221fc..c240c08279 100644 --- a/frontend/src/common/js/tableUtils.js +++ b/frontend/src/common/js/tableUtils.js @@ -430,6 +430,17 @@ export function saveCustomTableWidth(key, fieldKey, colWith) { localStorage.setItem(key + '_WITH', JSON.stringify(fields)); } +function parseStatus(row, options) { + if (options) { + for (let option of options) { + if (option.value === row.status) { + return option.system ? i18n.t(option.text) : option.text; + } + } + } + return row.status; +} + /** * 获取列表的自定义字段的显示值 * @param row @@ -438,6 +449,9 @@ export function saveCustomTableWidth(key, fieldKey, colWith) { * @returns {VueI18n.TranslateResult|*} */ export function getCustomFieldValue(row, field, members) { + if (field.name === '用例状态' && field.system) { + return parseStatus(row, field.options); + } if (row.customFields) { for (let i = 0; i < row.customFields.length; i++) { let item = row.customFields[i];