From 02177026558e195dfcdbb5175731fe963e70dd88 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 18 Mar 2021 14:43:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/components/MsModuleMinder.vue | 21 +--------------- .../components/track/case/TestCase.vue | 6 ++--- .../track/common/minder/TestCaseMinder.vue | 9 ++++--- .../track/common/minder/TestPlanMinder.vue | 24 +++++++++---------- .../track/common/minder/TestReviewMinder.vue | 16 ++++++------- .../tableItems/planview/StatusTableItem.vue | 2 +- .../functional/TestPlanFunctional.vue | 6 ++--- .../view/components/TestReviewFunction.vue | 6 ++--- frontend/src/i18n/en-US.js | 2 ++ frontend/src/i18n/zh-CN.js | 2 ++ frontend/src/i18n/zh-TW.js | 2 ++ 11 files changed, 41 insertions(+), 55 deletions(-) diff --git a/frontend/src/business/components/common/components/MsModuleMinder.vue b/frontend/src/business/components/common/components/MsModuleMinder.vue index 4838d71d50..9f879a88fc 100644 --- a/frontend/src/business/components/common/components/MsModuleMinder.vue +++ b/frontend/src/business/components/common/components/MsModuleMinder.vue @@ -46,29 +46,10 @@ export default { }, data() { return { - importJsonTest: { - "root": { - "data": { - "text": "test111" - }, - "children": [ - { "data": { "text": "新闻"}}, - { "data": { "text": "网页"} }, - { "data": { "text": "贴吧"} }, - { "data": { "text": "知道"} }, - { "data": { "text": "音乐" } }, - { "data": { "text": "图片"} }, - { "data": { "text": "视频"} }, - { "data": { "text": "地图" } }, - { "data": { "text": "百科","expandState":"collapse"}} - ] - }, - "template":"default" - }, importJson: { root: { data: { - text: "全部用例", + text: this.$t('test_track.review_view.all_case'), disable: true, id: "root", path: "" diff --git a/frontend/src/business/components/track/case/TestCase.vue b/frontend/src/business/components/track/case/TestCase.vue index 9bc3ed09d0..f3bae0ef40 100644 --- a/frontend/src/business/components/track/case/TestCase.vue +++ b/frontend/src/business/components/track/case/TestCase.vue @@ -18,10 +18,10 @@ -1) { + if (data.resource && data.resource.indexOf(this.$t('api_test.definition.request.case')) > -1) { this._buildSaveCase(root, saveCases, parent); } else { if (root.children) { @@ -92,9 +91,9 @@ name: "TestCaseMinder", if (node.children) { node.children.forEach((childNode) => { let childData = childNode.data; - if (childData.resource && childData.resource.indexOf('前置条件') > -1) { + if (childData.resource && childData.resource.indexOf(this.$t('test_track.case.prerequisite')) > -1) { testCase.prerequisite = childData.text; - } else if (childData.resource && childData.resource.indexOf('备注') > -1) { + } else if (childData.resource && childData.resource.indexOf(this.$t('commons.remark')) > -1) { testCase.remark = childData.text; } else { // 测试步骤 diff --git a/frontend/src/business/components/track/common/minder/TestPlanMinder.vue b/frontend/src/business/components/track/common/minder/TestPlanMinder.vue index b9a163da1f..5a8a82e5d1 100644 --- a/frontend/src/business/components/track/common/minder/TestPlanMinder.vue +++ b/frontend/src/business/components/track/common/minder/TestPlanMinder.vue @@ -4,7 +4,7 @@ :tree-nodes="treeNodes" :data-map="dataMap" :tags="tags" - :distinct-tags="[...tags, '未开始']" + :distinct-tags="[...tags, $t('test_track.plan.plan_status_prepare')]" @save="save" /> @@ -19,7 +19,7 @@ name: "TestPlanMinder", return{ dataMap: new Map(), result: {}, - tags: ['通过', '失败', '阻塞', '跳过'], + tags: [this.$t('test_track.plan_view.pass'), this.$t('test_track.plan_view.failure'), this.$t('test_track.plan_view.blocking'), this.$t('test_track.plan_view.skip')], } }, props: { @@ -48,15 +48,15 @@ name: "TestPlanMinder", this.result = this.$get('/test/plan/case/list/minder/' + this.planId, response => { this.dataMap = getTestCaseDataMap(response.data, true, (data, item) => { if (item.stats === 'Pass') { - data.resource.push("通过"); + data.resource.push(this.$t('test_track.plan_view.pass')); } else if (item.reviewStatus === 'Failure') { - data.resource.push("失败"); + data.resource.push(this.$t('test_track.plan_view.failure')); } else if (item.reviewStatus === 'Blocking') { - data.resource.push("阻塞"); + data.resource.push(this.$t('test_track.plan_view.blocking')); } else if (item.reviewStatus === 'Skip') { - data.resource.push("跳过"); + data.resource.push(this.$t('test_track.plan_view.skip')); } else { - data.resource.push("未开始"); + data.resource.push(this.$t('test_track.plan.plan_status_prepare')); } }); }); @@ -71,7 +71,7 @@ name: "TestPlanMinder", }, buildSaveCase(root, saveCases) { let data = root.data; - if (data.resource && data.resource.indexOf("用例") > -1) { + if (data.resource && data.resource.indexOf(this.$t('api_test.definition.request.case')) > -1) { this._buildSaveCase(root, saveCases, parent); } else { if (root.children) { @@ -90,13 +90,13 @@ name: "TestPlanMinder", id: data.id, }; if (data.resource.length > 1) { - if (data.resource.indexOf('失败') > -1) { + if (data.resource.indexOf(this.$t('test_track.plan_view.failure')) > -1) { testCase.status = 'Failure'; - } else if (data.resource.indexOf('通过') > -1) { + } else if (data.resource.indexOf(this.$t('test_track.plan_view.pass')) > -1) { testCase.status = 'Pass'; - } else if (data.resource.indexOf('阻塞') > -1) { + } else if (data.resource.indexOf(this.$t('test_track.plan_view.blocking')) > -1) { testCase.status = 'Blocking'; - } else if (data.resource.indexOf('跳过') > -1) { + } else if (data.resource.indexOf(this.$t('test_track.plan_view.skip')) > -1) { testCase.status = 'Skip'; } } diff --git a/frontend/src/business/components/track/common/minder/TestReviewMinder.vue b/frontend/src/business/components/track/common/minder/TestReviewMinder.vue index 6295625b19..65ad2f954c 100644 --- a/frontend/src/business/components/track/common/minder/TestReviewMinder.vue +++ b/frontend/src/business/components/track/common/minder/TestReviewMinder.vue @@ -4,7 +4,7 @@ :tree-nodes="treeNodes" :data-map="dataMap" :tags="tags" - :distinct-tags="[...tags, '未开始']" + :distinct-tags="[...tags, $t('test_track.plan.plan_status_prepare')]" @save="save" /> @@ -18,7 +18,7 @@ name: "TestReviewMinder", data() { return{ dataMap: new Map(), - tags: ['通过', '不通过'], + tags: [this.$t('test_track.plan_view.pass'), this.$t('test_track.plan_view.not_pass')], result: {} } }, @@ -48,11 +48,11 @@ name: "TestReviewMinder", this.result = this.$post('/test/review/case/list/all', {reviewId: this.reviewId}, response => { this.dataMap = getTestCaseDataMap(response.data, true, (data, item) => { if (item.reviewStatus === 'Pass') { - data.resource.push("通过"); + data.resource.push(this.$t('test_track.plan_view.pass')); } else if (item.reviewStatus === 'UnPass') { - data.resource.push("不通过"); + data.resource.push(this.$t('test_track.plan_view.not_pass')); } else { - data.resource.push("未开始"); + data.resource.push(this.$t('test_track.plan.plan_status_prepare')); } data.caseId = item.caseId; }); @@ -68,7 +68,7 @@ name: "TestReviewMinder", }, buildSaveCase(root, saveCases) { let data = root.data; - if (data.resource && data.resource.indexOf("用例") > -1) { + if (data.resource && data.resource.indexOf(this.$t('api_test.definition.request.case')) > -1) { this._buildSaveCase(root, saveCases); } else { if (root.children) { @@ -89,9 +89,9 @@ name: "TestReviewMinder", // name: data.text, }; if (data.resource.length > 1) { - if (data.resource.indexOf('不通过') > -1) { + if (data.resource.indexOf(this.$t('test_track.plan_view.not_pass')) > -1) { testCase.status = 'UnPass'; - } else if (data.resource.indexOf('通过') > -1) { + } else if (data.resource.indexOf(this.$t('test_track.plan_view.pass')) > -1) { testCase.status = 'Pass'; } } diff --git a/frontend/src/business/components/track/common/tableItems/planview/StatusTableItem.vue b/frontend/src/business/components/track/common/tableItems/planview/StatusTableItem.vue index 14b4bd8de4..80a08496c7 100644 --- a/frontend/src/business/components/track/common/tableItems/planview/StatusTableItem.vue +++ b/frontend/src/business/components/track/common/tableItems/planview/StatusTableItem.vue @@ -3,7 +3,7 @@ - + diff --git a/frontend/src/business/components/track/plan/view/comonents/functional/TestPlanFunctional.vue b/frontend/src/business/components/track/plan/view/comonents/functional/TestPlanFunctional.vue index a4c154d3c6..94bc8e1e18 100644 --- a/frontend/src/business/components/track/plan/view/comonents/functional/TestPlanFunctional.vue +++ b/frontend/src/business/components/track/plan/view/comonents/functional/TestPlanFunctional.vue @@ -11,10 +11,10 @@