fix: 国际化
This commit is contained in:
parent
ca26657e91
commit
0217702655
|
@ -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: ""
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
<el-tab-pane name="default" :label="$t('api_test.definition.case_title')">
|
||||
<ms-tab-button
|
||||
:active-dom.sync="activeDom"
|
||||
:left-tip="'用例列表'"
|
||||
:left-tip="$t('api_test.definition.case_title')"
|
||||
:left-content="'CASE'"
|
||||
:right-tip="'脑图'"
|
||||
:right-content="'脑图'"
|
||||
:right-tip="$t('test_track.case.minder')"
|
||||
:right-content="$t('test_track.case.minder')"
|
||||
:middle-button-enable="false">
|
||||
<test-case-list
|
||||
v-if="activeDom === 'left'"
|
||||
|
|
|
@ -18,7 +18,7 @@ name: "TestCaseMinder",
|
|||
return{
|
||||
testCase: [],
|
||||
dataMap: new Map(),
|
||||
tags: ['用例', '前置条件', '备注'],
|
||||
tags: [this.$t('api_test.definition.request.case'), this.$t('test_track.case.prerequisite'), this.$t('commons.remark')],
|
||||
result: {}
|
||||
}
|
||||
},
|
||||
|
@ -47,7 +47,6 @@ name: "TestCaseMinder",
|
|||
}
|
||||
},
|
||||
save(data) {
|
||||
console.log(this.dataMap);
|
||||
let saveCases = [];
|
||||
this.buildSaveCase(data.root, saveCases, undefined);
|
||||
let param = {
|
||||
|
@ -60,7 +59,7 @@ name: "TestCaseMinder",
|
|||
},
|
||||
buildSaveCase(root, saveCases, parent) {
|
||||
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) {
|
||||
|
@ -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 {
|
||||
// 测试步骤
|
||||
|
|
|
@ -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"
|
||||
/>
|
||||
</template>
|
||||
|
@ -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';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
/>
|
||||
</template>
|
||||
|
@ -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';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<ms-tag v-if="value == 'Prepare'" type="info" :content="$t('test_track.plan.plan_status_prepare')"/>
|
||||
<ms-tag v-if="value == 'Underway'" type="primary" :content="$t('test_track.plan.plan_status_running')"/>
|
||||
<ms-tag v-if="value == 'Pass'" type="success" :content="$t('test_track.plan_view.pass')"/>
|
||||
<ms-tag v-if="value == 'UnPass'" type="danger" content="未通过"/>
|
||||
<ms-tag v-if="value == 'UnPass'" type="danger" content="$t('test_track.plan_view.not_pass')"/>
|
||||
<ms-tag v-if="value == 'Failure'" type="danger" :content="$t('test_track.plan_view.failure')"/>
|
||||
<ms-tag v-if="value == 'Blocking'" type="warning" :content="$t('test_track.plan_view.blocking')"/>
|
||||
<ms-tag v-if="value == 'Skip'" type="info" :content="$t('test_track.plan_view.skip')"/>
|
||||
|
|
|
@ -11,10 +11,10 @@
|
|||
<template v-slot:main>
|
||||
<ms-tab-button
|
||||
:active-dom.sync="activeDom"
|
||||
:left-tip="'用例列表'"
|
||||
:left-tip="$t('api_test.definition.case_title')"
|
||||
:left-content="'CASE'"
|
||||
:right-tip="'脑图'"
|
||||
:right-content="'脑图'"
|
||||
:right-tip="$t('test_track.case.minder')"
|
||||
:right-content="$t('test_track.case.minder')"
|
||||
:middle-button-enable="false">
|
||||
<functional-test-case-list
|
||||
class="table-list"
|
||||
|
|
|
@ -12,10 +12,10 @@
|
|||
<template v-slot:main>
|
||||
<ms-tab-button
|
||||
:active-dom.sync="activeDom"
|
||||
:left-tip="'用例列表'"
|
||||
:left-tip="$t('api_test.definition.case_title')"
|
||||
:left-content="'CASE'"
|
||||
:right-tip="'脑图'"
|
||||
:right-content="'脑图'"
|
||||
:right-tip="$t('test_track.case.minder')"
|
||||
:right-content="$t('test_track.case.minder')"
|
||||
:middle-button-enable="false">
|
||||
<test-review-test-case-list
|
||||
class="table-list"
|
||||
|
|
|
@ -1102,6 +1102,7 @@ export default {
|
|||
cancel_relevance_success: "Unlinked successfully",
|
||||
switch_project: "Switch project",
|
||||
case: {
|
||||
minder: "Minder",
|
||||
check_select: "Please check the case",
|
||||
export_all_cases: 'Are you sure you want to export all use cases?',
|
||||
input_test_case: 'Please enter the associated case name',
|
||||
|
@ -1310,6 +1311,7 @@ export default {
|
|||
executor: "Executor",
|
||||
execute_result: "Result",
|
||||
pass: "Pass",
|
||||
not_pass: "UnPass",
|
||||
failure: "Failure",
|
||||
blocking: "Blocking",
|
||||
skip: "Skip",
|
||||
|
|
|
@ -1106,6 +1106,7 @@ export default {
|
|||
cancel_relevance_success: "取消关联成功",
|
||||
switch_project: "切换项目",
|
||||
case: {
|
||||
minder: "脑图",
|
||||
check_select: "请勾选用例",
|
||||
export_all_cases: '确定要导出全部用例吗?',
|
||||
input_test_case: '请输入关联用例名称',
|
||||
|
@ -1314,6 +1315,7 @@ export default {
|
|||
executor: "执行人",
|
||||
execute_result: "执行结果",
|
||||
pass: "通过",
|
||||
not_pass: "不通过",
|
||||
failure: "失败",
|
||||
blocking: "阻塞",
|
||||
skip: "跳过",
|
||||
|
|
|
@ -1104,6 +1104,7 @@ export default {
|
|||
cancel_relevance_success: "取消關聯成功",
|
||||
switch_project: "切換項目",
|
||||
case: {
|
||||
minder: "腦圖",
|
||||
check_select: "請勾選用例",
|
||||
export_all_cases: '確定要導出全部用例嗎?',
|
||||
input_test_case: '請輸入關聯用例名稱',
|
||||
|
@ -1312,6 +1313,7 @@ export default {
|
|||
executor: "執行人",
|
||||
execute_result: "執行結果",
|
||||
pass: "通過",
|
||||
not_pass: "不通過",
|
||||
failure: "失敗",
|
||||
blocking: "阻塞",
|
||||
skip: "跳過",
|
||||
|
|
Loading…
Reference in New Issue