From 0028f296f43ea66a14ab262fd555089555c5bd5f Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Tue, 14 Jun 2022 11:23:36 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E4=BB=BB=E5=8A=A1=E4=B8=AD=E5=BF=83=E5=92=8C=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E5=88=97=E8=A1=A8=E7=8A=B6=E6=80=81=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1013989 --user=赵勇 [通用设置]任务中心-状态列表中应按照报告结果情况列出所有状态并保持中英文一致 https://www.tapd.cn/55049933/s/1180637 --- .../api/automation/report/ApiReportStatus.vue | 4 +- .../business/components/task/TaskCenter.vue | 60 +++++++++---------- 2 files changed, 29 insertions(+), 35 deletions(-) diff --git a/frontend/src/business/components/api/automation/report/ApiReportStatus.vue b/frontend/src/business/components/api/automation/report/ApiReportStatus.vue index bec150ae33..b2a5d64969 100644 --- a/frontend/src/business/components/api/automation/report/ApiReportStatus.vue +++ b/frontend/src/business/components/api/automation/report/ApiReportStatus.vue @@ -36,9 +36,9 @@ return status.toLowerCase(); }, showStatus(status) { - return status.toLowerCase()[0].toUpperCase() + status.toLowerCase().substr(1); + return status === "unexecute"? "NotExecute": + status.toLowerCase()[0].toUpperCase() + status.toLowerCase().substr(1); } - } } diff --git a/frontend/src/business/components/task/TaskCenter.vue b/frontend/src/business/components/task/TaskCenter.vue index 6b5e2d5ab0..c6e7f479e5 100644 --- a/frontend/src/business/components/task/TaskCenter.vue +++ b/frontend/src/business/components/task/TaskCenter.vue @@ -111,34 +111,8 @@ - - Error - - - Success - - - Stopped - - - Unexecuted - - - FakeError - - - Running - - - {{ - item.executionStatus ? item.executionStatus.toLowerCase()[0].toUpperCase() + item.executionStatus.toLowerCase().substr(1) : item.executionStatus - }} + + {{ showStatus(item.executionStatus.toLowerCase()) }} @@ -244,6 +218,22 @@ export default { } }, methods: { + showStatus(status) { + status = status.toLowerCase(); + switch (status) { + case "unexecute": + return "NotExecute"; + case "errorreportresult": + return "FakeError"; + case "stop": + return "Stopped"; + default: + return status.toLowerCase()[0].toUpperCase() + status.toLowerCase().substr(1); + } + }, + showClass(status) { + return "ms-task-" + status; + }, nextData() { this.loading = true; this.init(); @@ -260,9 +250,9 @@ export default { let request = {type: row.executionModule, reportId: row.id}; array = [request]; } else { - array.push({type: 'API', projectId: getCurrentProjectID(),userId:getCurrentUser().id}); - array.push({type: 'SCENARIO', projectId: getCurrentProjectID(),userId:getCurrentUser().id}); - array.push({type: 'PERFORMANCE', projectId: getCurrentProjectID(),userId:getCurrentUser().id}); + array.push({type: 'API', projectId: getCurrentProjectID(), userId: getCurrentUser().id}); + array.push({type: 'SCENARIO', projectId: getCurrentProjectID(), userId: getCurrentUser().id}); + array.push({type: 'PERFORMANCE', projectId: getCurrentProjectID(), userId: getCurrentUser().id}); } this.$post('/api/automation/stop/batch', array, response => { this.$success(this.$t('report.test_stop_success')); @@ -554,7 +544,7 @@ export default { color: #F56C6C; } -.ms-task-error-report-status { +.ms-task-errorreportresult { color: #F6972A; } @@ -564,11 +554,15 @@ export default { margin-right: 20px; } +.ms-task-unexecute { + color: #909399; +} + .ms-task-success { color: #67C23A; } -.ms-task-stopped { +.ms-task-stop { color: #909399; }