From 76bcd1450041235a70fb99baf4ffaad4995e7529 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Wed, 3 Feb 2021 18:50:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):=20?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scenario/component/LoopController.vue | 12 ++++++------ frontend/src/i18n/en-US.js | 14 +++++++------- frontend/src/i18n/zh-CN.js | 4 ++-- frontend/src/i18n/zh-TW.js | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/component/LoopController.vue b/frontend/src/business/components/api/automation/scenario/component/LoopController.vue index 427826eb6f..85a6931c48 100644 --- a/frontend/src/business/components/api/automation/scenario/component/LoopController.vue +++ b/frontend/src/business/components/api/automation/scenario/component/LoopController.vue @@ -244,7 +244,7 @@ getFails() { this.error = 0; this.success = 0; - if (this.requestResult.scenarios) { + if (this.requestResult.scenarios && this.requestResult.scenarios != null) { this.requestResult.scenarios.forEach((scenario) => { if (scenario.requestResults) { scenario.requestResults.forEach(item => { @@ -255,7 +255,7 @@ }) } }) - this.success = this.requestResult.scenarios.length - this.error; + this.success = this.requestResult.scenarios && this.requestResult.scenarios != null ? this.requestResult.scenarios.length - this.error : 0; } }, getReport() { @@ -267,6 +267,9 @@ if (this.isNotRunning) { try { this.requestResult = JSON.parse(this.report.content); + if (!this.requestResult) { + this.requestResult = {scenarios: []}; + } this.controller.requestResult = this.requestResult; switch (this.controller.loopType) { case "LOOP_COUNT": @@ -282,14 +285,11 @@ break; } this.getFails(); - if (!this.requestResult) { - this.requestResult = {scenarios: []}; - } } catch (e) { throw e; } this.loading = false; - this.activeName = this.requestResult && this.requestResult.scenarios ? this.requestResult.scenarios[0].name : ""; + this.activeName = this.requestResult && this.requestResult.scenarios && this.requestResult.scenarios != null && this.requestResult.scenarios.length > 0 ? this.requestResult.scenarios[0].name : ""; } else { setTimeout(this.getReport, 2000) } diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index e8a7112cd5..2c15ba0023 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -1,7 +1,7 @@ export default { commons: { - cover:'Cover', - not_cover:'Not Cover', + cover: 'Cover', + not_cover: 'Not Cover', import_mode: 'Import mode', import_module: 'Import module', please_fill_in_the_template: 'Please fill in the template', @@ -537,12 +537,12 @@ export default { }, request: { grade_info: "Filter by rank", - grade_order_asc: "from high to low by use case level", - grade_order_desc: "from low to high by use case level,", + grade_order_asc: "from low to high by use case level", + grade_order_desc: "from high to low by use case level", create_time_order_asc: "by creation time from front to back", - create_time_order_desc: "from back to front by creation time,", + create_time_order_desc: "from back to front by creation time", update_time_order_asc: "by update time from front to back", - update_time_order_desc: "from back to front by update time,", + update_time_order_desc: "from back to front by update time", run_env: "Operating environment", select_case: "Search use cases", case: "Case", @@ -589,7 +589,7 @@ export default { create_info: 'Create', update_info: 'Update', batch_edit: "Batch edit", - batch_move:"Batch move", + batch_move: "Batch move", path_valid_info: "The request path is invalid", other_config: "Other Config", message_template: "Message Template", diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 881f9334ab..2cd9006c89 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -537,8 +537,8 @@ export default { }, request: { grade_info: "按等级筛选", - grade_order_asc: "按用例等级从高到低", - grade_order_desc: "按用例等级从低到高", + grade_order_asc: "按用例等级从低到高", + grade_order_desc: "按用例等级从高到低", create_time_order_asc: "按创建时间从前到后", create_time_order_desc: "按创建时间从后到前", update_time_order_asc: "按更新时间从前到后", diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index cad8bddfef..22574e14ea 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -536,8 +536,8 @@ export default { }, request: { grade_info: "按等級篩選", - grade_order_asc: "按用例等級從高到低", - grade_order_desc: "按用例等級從低到高", + grade_order_asc: "按用例等級從低到高", + grade_order_desc: "按用例等級從高到低", create_time_order_asc: "按創建時間從前到後", create_time_order_desc: "按創建時間從後到前", update_time_order_asc: "按更新時間從前到後",