refactor: i18n

This commit is contained in:
shiziyuan9527 2021-06-21 16:45:28 +08:00 committed by 刘瑞斌
parent c34fecd059
commit 21a35e82b4
19 changed files with 125 additions and 52 deletions

View File

@ -2,20 +2,17 @@ package io.metersphere.track.controller;
import io.metersphere.base.domain.TestCase; import io.metersphere.base.domain.TestCase;
import io.metersphere.commons.constants.RoleConstants; import io.metersphere.i18n.Translator;
import io.metersphere.performance.base.ChartsData; import io.metersphere.performance.base.ChartsData;
import io.metersphere.track.response.BugStatustics; import io.metersphere.track.response.BugStatustics;
import io.metersphere.track.response.TrackCountResult; import io.metersphere.track.response.TrackCountResult;
import io.metersphere.track.response.TrackStatisticsDTO; import io.metersphere.track.response.TrackStatisticsDTO;
import io.metersphere.track.service.TestCaseService; import io.metersphere.track.service.TestCaseService;
import io.metersphere.track.service.TrackService; import io.metersphere.track.service.TrackService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.List; import java.util.List;
@ -78,9 +75,9 @@ public class TrackController {
statistics.setCoverageRage(df.format(coverageRageNumber) + "%"); statistics.setCoverageRage(df.format(coverageRageNumber) + "%");
} }
statistics.setApiCaseCountStr("接口用例&nbsp;&nbsp;<br/><br/>" + statistics.getApiCaseCount()); statistics.setApiCaseCountStr(Translator.get("api_case") + "&nbsp;&nbsp;<br/><br/>" + statistics.getApiCaseCount());
statistics.setPerformanceCaseCountStr("性能用例&nbsp;&nbsp;<br/><br/>" + statistics.getPerformanceCaseCount()); statistics.setPerformanceCaseCountStr(Translator.get("performance_case") + "&nbsp;&nbsp;<br/><br/>" + statistics.getPerformanceCaseCount());
statistics.setScenarioCaseStr("场景用例&nbsp;&nbsp;<br/><br/>" + statistics.getScenarioCaseCount()); statistics.setScenarioCaseStr(Translator.get("scenario_case") + "&nbsp;&nbsp;<br/><br/>" + statistics.getScenarioCaseCount());
return statistics; return statistics;
} }

View File

@ -257,4 +257,9 @@ project_environment_setting=Project environment setting
project_file_management=Project file management project_file_management=Project file management
personal_information_personal_settings=Personal information personal settings personal_information_personal_settings=Personal information personal settings
personal_information_apikeys=Personal information API Keys personal_information_apikeys=Personal information API Keys
auth_title=Auth auth_title=Auth
# track home
api_case=API
performance_case=PERFORMANCE
scenario_case=SCENARIO

View File

@ -256,4 +256,9 @@ project_environment_setting=项目-环境设置
project_file_management=项目-文件管理 project_file_management=项目-文件管理
personal_information_personal_settings=个人信息-个人设置 personal_information_personal_settings=个人信息-个人设置
personal_information_apikeys=个人信息-API Keys personal_information_apikeys=个人信息-API Keys
auth_title=系统认证 auth_title=系统认证
# track home
api_case=接口用例
performance_case=性能用例
scenario_case=场景用例

View File

@ -257,4 +257,8 @@ project_environment_setting=項目-環境設置
project_file_management=項目-文件管理 project_file_management=項目-文件管理
personal_information_personal_settings=個人信息-個人設置 personal_information_personal_settings=個人信息-個人設置
personal_information_apikeys=個人信息-API Keys personal_information_apikeys=個人信息-API Keys
auth_title=系统认证 auth_title=系统认证
# track home
api_case=接口用例
performance_case=性能用例
scenario_case=場景用例

View File

@ -176,12 +176,12 @@ export default {
} }
}, },
legend: { legend: {
data: ["功能用例数", "关联用例数"], data: [this.$t('test_track.home.function_case_count'), this.$t('test_track.home.relevance_case_count')],
orient: 'vertical', orient: 'vertical',
right: '80', right: '80',
}, },
series: [{ series: [{
name: "功能用例数", name: this.$t('test_track.home.function_case_count'),
data: yAxis1, data: yAxis1,
type: 'bar', type: 'bar',
itemStyle: { itemStyle: {
@ -191,7 +191,7 @@ export default {
} }
}, },
{ {
name: "关联用例数", name: this.$t('test_track.home.relevance_case_count'),
data: yAxis2, data: yAxis2,
type: 'bar', type: 'bar',
itemStyle: { itemStyle: {

View File

@ -2,7 +2,7 @@
<el-card class="table-card" v-loading="result.loading" body-style="padding:10px;"> <el-card class="table-card" v-loading="result.loading" body-style="padding:10px;">
<div slot="header"> <div slot="header">
<span class="title"> <span class="title">
遗留缺陷统计 {{ $t('test_track.home.bug_count') }}
</span> </span>
</div> </div>
<el-container> <el-container>
@ -15,17 +15,17 @@
{{ $t('api_test.home_page.unit_of_measurement') }} {{ $t('api_test.home_page.unit_of_measurement') }}
</span> </span>
<div> <div>
占比 {{ $t('test_track.home.percentage') }}
<span class="rage"> <span class="rage">
{{rage}} {{rage}}
</span> </span>
</div> </div>
</div> </div>
</el-aside> </el-aside>
<el-table border :data="tableData" class="adjust-table table-content" height="300"> <el-table border :data="tableData" class="adjust-table table-content" height="300">
<el-table-column prop="index" label="序号" <el-table-column prop="index" :label="$t('test_track.home.serial_number')"
width="60" show-overflow-tooltip/> width="60" show-overflow-tooltip/>
<el-table-column prop="planName" label="测试计划名称" <el-table-column prop="planName" :label="$t('test_track.home.test_plan_name')"
width="130" show-overflow-tooltip/> width="130" show-overflow-tooltip/>
<el-table-column prop="createTime" :label="$t('commons.create_time')" width="180" show-overflow-tooltip> <el-table-column prop="createTime" :label="$t('commons.create_time')" width="180" show-overflow-tooltip>
<template v-slot:default="scope"> <template v-slot:default="scope">
@ -44,11 +44,11 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="caseSize" label="用例数" <el-table-column prop="caseSize" :label="$t('test_track.home.case_size')"
width="80" show-overflow-tooltip/> width="80" show-overflow-tooltip/>
<el-table-column prop="bugSize" label="缺陷数" <el-table-column prop="bugSize" :label="$t('test_track.home.bug_size')"
width="80" show-overflow-tooltip/> width="80" show-overflow-tooltip/>
<el-table-column prop="passRage" label="通过率" <el-table-column prop="passRage" :label="$t('test_track.home.passing_rate')"
width="80" show-overflow-tooltip/> width="80" show-overflow-tooltip/>
</el-table> </el-table>
</el-container> </el-container>
@ -100,6 +100,7 @@ export default {
.el-aside { .el-aside {
line-height: 100px; line-height: 100px;
text-align: center; text-align: center;
overflow-y: hidden;
} }
.count-number { .count-number {

View File

@ -2,7 +2,7 @@
<el-card class="table-card" v-loading="result.loading" body-style="padding:10px;"> <el-card class="table-card" v-loading="result.loading" body-style="padding:10px;">
<div slot="header" > <div slot="header" >
<span class="title"> <span class="title">
用例数量统计 {{ $t('test_track.home.case_count') }}
</span> </span>
</div> </div>
@ -68,7 +68,7 @@
<el-aside width="60%" class="count-number-show" style="margin-bottom: 0px;margin-top: 0px"> <el-aside width="60%" class="count-number-show" style="margin-bottom: 0px;margin-top: 0px">
<el-container> <el-container>
<el-aside width="30%"> <el-aside width="30%">
评审率: {{ $t('test_track.home.review_rate') }}:
</el-aside> </el-aside>
<el-main style="padding: 0px 0px 0px 0px; line-height: 100px; text-align: center;"> <el-main style="padding: 0px 0px 0px 0px; line-height: 100px; text-align: center;">
<span class="count-number"> <span class="count-number">
@ -87,7 +87,7 @@
<el-row> <el-row>
<el-col> <el-col>
<span class="default-property"> <span class="default-property">
未评审 {{ $t('test_track.review.prepare') }}
{{"\xa0\xa0"}} {{"\xa0\xa0"}}
<el-link type="info" @click="redirectPage('Prepare')" target="_blank" style="color: #000000"> <el-link type="info" @click="redirectPage('Prepare')" target="_blank" style="color: #000000">
{{trackCountData.prepareCount}} {{trackCountData.prepareCount}}
@ -96,7 +96,7 @@
</el-col> </el-col>
<el-col style="margin-top: 5px;"> <el-col style="margin-top: 5px;">
<span class="default-property"> <span class="default-property">
未通过 {{ $t('test_track.review.un_pass') }}
{{"\xa0\xa0"}} {{"\xa0\xa0"}}
<el-link type="info" @click="redirectPage('UnPass')" target="_blank" style="color: #000000"> <el-link type="info" @click="redirectPage('UnPass')" target="_blank" style="color: #000000">
{{trackCountData.unPassCount}} {{trackCountData.unPassCount}}
@ -105,7 +105,7 @@
</el-col> </el-col>
<el-col style="margin-top: 5px;"> <el-col style="margin-top: 5px;">
<span class="main-property"> <span class="main-property">
已通过 {{ $t('test_track.review.pass') }}
{{"\xa0\xa0"}} {{"\xa0\xa0"}}
<el-link type="info" @click="redirectPage('Pass')" target="_blank" style="color: #000000"> <el-link type="info" @click="redirectPage('Pass')" target="_blank" style="color: #000000">
{{trackCountData.passCount}} {{trackCountData.passCount}}

View File

@ -2,7 +2,7 @@
<el-card class="table-card" v-loading="result.loading" body-style="padding:10px;"> <el-card class="table-card" v-loading="result.loading" body-style="padding:10px;">
<div slot="header"> <div slot="header">
<span class="title"> <span class="title">
用例维护人分布 {{ $t('test_track.home.case_maintenance') }}
</span> </span>
</div> </div>
<el-container> <el-container>

View File

@ -2,7 +2,7 @@
<el-card class="table-card" v-loading="result.loading" body-style="padding:10px;"> <el-card class="table-card" v-loading="result.loading" body-style="padding:10px;">
<div slot="header" > <div slot="header" >
<span class="title"> <span class="title">
关联用例数量统计 {{ $t('test_track.home.relevance_case') }}
</span> </span>
</div> </div>
@ -51,7 +51,7 @@
<el-aside width="60%" class="count-number-show" style="margin-bottom: 0px;margin-top: 0px"> <el-aside width="60%" class="count-number-show" style="margin-bottom: 0px;margin-top: 0px">
<el-container> <el-container>
<el-aside width="30%"> <el-aside width="30%">
覆盖率: {{ $t('test_track.home.coverage') }}:
</el-aside> </el-aside>
<el-main style="padding: 0px 0px 0px 0px; line-height: 100px; text-align: center;"> <el-main style="padding: 0px 0px 0px 0px; line-height: 100px; text-align: center;">
<span class="count-number"> <span class="count-number">
@ -70,7 +70,7 @@
<el-row> <el-row>
<el-col> <el-col>
<span class="default-property"> <span class="default-property">
未覆盖 {{ $t('api_test.home_page.detail_card.uncoverage') }}
{{"\xa0\xa0"}} {{"\xa0\xa0"}}
<el-link type="info" @click="redirectPage('uncoverage')" target="_blank" style="color: #000000"> <el-link type="info" @click="redirectPage('uncoverage')" target="_blank" style="color: #000000">
{{relevanceCountData.uncoverageCount}} {{relevanceCountData.uncoverageCount}}
@ -79,7 +79,7 @@
</el-col> </el-col>
<el-col style="margin-top: 5px;"> <el-col style="margin-top: 5px;">
<span class="main-property"> <span class="main-property">
已覆盖 {{ $t('api_test.home_page.detail_card.coverage') }}
{{"\xa0\xa0"}} {{"\xa0\xa0"}}
<el-link type="info" @click="redirectPage('coverage')" target="_blank" style="color: #000000"> <el-link type="info" @click="redirectPage('coverage')" target="_blank" style="color: #000000">
{{relevanceCountData.coverageCount}} {{relevanceCountData.coverageCount}}

View File

@ -2,7 +2,7 @@
<el-card class="table-card" v-loading="result.loading" body-style="padding:10px;"> <el-card class="table-card" v-loading="result.loading" body-style="padding:10px;">
<div slot="header"> <div slot="header">
<span class="title"> <span class="title">
用例评审 {{ $t('test_track.home.case_review') }}
</span> </span>
<ms-table-button v-if="!showMyCreator" icon="el-icon-view" <ms-table-button v-if="!showMyCreator" icon="el-icon-view"
:content="$t('test_track.review.my_create')" @click="searchMyCreator" style="float: right"/> :content="$t('test_track.review.my_create')" @click="searchMyCreator" style="float: right"/>

View File

@ -12,10 +12,10 @@
<template v-slot:menu> <template v-slot:menu>
<el-menu v-if="isMenuShow" :active-text-color="color" :default-active="activeIndex" <el-menu v-if="isMenuShow" :active-text-color="color" :default-active="activeIndex"
class="el-menu-demo header-menu" mode="horizontal" @select="handleSelect"> class="el-menu-demo header-menu" mode="horizontal" @select="handleSelect">
<el-menu-item index="functional">功能测试用例</el-menu-item> <el-menu-item index="functional">{{ $t('test_track.functional_test_case') }}</el-menu-item>
<el-menu-item index="api" v-modules="['api']">接口测试用例</el-menu-item> <el-menu-item index="api" v-modules="['api']">{{ $t('test_track.api_test_case') }}</el-menu-item>
<el-menu-item index="load" v-modules="['performance']">性能测试用例</el-menu-item> <el-menu-item index="load" v-modules="['performance']">{{ $t('test_track.performance_test_case') }}</el-menu-item>
<el-menu-item index="report">报告统计</el-menu-item> <el-menu-item index="report">{{ $t('test_track.report_statistics') }}</el-menu-item>
</el-menu> </el-menu>
</template> </template>
</ms-test-plan-header-bar> </ms-test-plan-header-bar>

View File

@ -45,7 +45,7 @@ export default {
} }
.menu-ul { .menu-ul {
width: 500px; width: 600px;
display: inline-block; display: inline-block;
} }

View File

@ -4,22 +4,22 @@
<div class="char-component"> <div class="char-component">
<div class="char-item" v-if="showFunctional"> <div class="char-item" v-if="showFunctional">
<ms-pie-chart v-if="isShow" :text="'功能测试用例'" @onClick="onFuncCharClick" <ms-pie-chart v-if="isShow" :text="$t('test_track.functional_test_case')" @onClick="onFuncCharClick"
:name="$t('test_track.plan_view.test_result')" :data="functionalCharData"/> :name="$t('test_track.plan_view.test_result')" :data="functionalCharData"/>
</div> </div>
<div class="char-item" v-if="showApi"> <div class="char-item" v-if="showApi">
<ms-pie-chart v-if="isShow" :text="'接口测试用例'" @onClick="onApiCharClick" <ms-pie-chart v-if="isShow" :text="$t('test_track.api_test_case')" @onClick="onApiCharClick"
:name="$t('test_track.plan_view.test_result')" :data="apiCharData"/> :name="$t('test_track.plan_view.test_result')" :data="apiCharData"/>
</div> </div>
<div class="char-item" v-if="showScenario"> <div class="char-item" v-if="showScenario">
<ms-pie-chart v-if="isShow" :text="'场景测试用例'" @onClick="onScenarioCharClick" <ms-pie-chart v-if="isShow" :text="$t('test_track.scenario_test_case')" @onClick="onScenarioCharClick"
:name="$t('test_track.plan_view.test_result')" :data="scenarioCharData"/> :name="$t('test_track.plan_view.test_result')" :data="scenarioCharData"/>
</div> </div>
<div class="char-item" v-if="showLoad"> <div class="char-item" v-if="showLoad">
<ms-pie-chart v-if="isShow" :text="'性能测试用例'" @onClick="onLoadCharClick" <ms-pie-chart v-if="isShow" :text="$t('test_track.performance_test_case')" @onClick="onLoadCharClick"
:name="$t('test_track.plan_view.test_result')" :data="loadCharData"/> :name="$t('test_track.plan_view.test_result')" :data="loadCharData"/>
</div> </div>
</div> </div>

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="failure-cases-list"> <div class="failure-cases-list">
<div class="failure-cases-list-header"> <div class="failure-cases-list-header">
功能测试用例 {{ $t('test_track.functional_test_case') }}
</div> </div>
<el-table <el-table

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="failure-cases-list"> <div class="failure-cases-list">
<div class="failure-cases-list-header"> <div class="failure-cases-list-header">
性能测试用例 {{ $t('test_track.performance_test_case') }}
</div> </div>
<el-table <el-table

View File

@ -12,7 +12,7 @@
<el-menu v-if="isMenuShow" :active-text-color="color" <el-menu v-if="isMenuShow" :active-text-color="color"
class="el-menu-demo header-menu" mode="horizontal" @select="handleSelect" class="el-menu-demo header-menu" mode="horizontal" @select="handleSelect"
:default-active="activeIndex"> :default-active="activeIndex">
<el-menu-item index="functional">功能测试用例</el-menu-item> <el-menu-item index="functional">{{ $t('test_track.functional_test_case') }}</el-menu-item>
<!-- <el-menu-item index="api">接口测试用例</el-menu-item> <!-- <el-menu-item index="api">接口测试用例</el-menu-item>
<el-menu-item index="load">性能测试用例</el-menu-item>--> <el-menu-item index="load">性能测试用例</el-menu-item>-->
<!-- <el-menu-item index="report">报告统计</el-menu-item>--> <!-- <el-menu-item index="report">报告统计</el-menu-item>-->

View File

@ -1302,6 +1302,11 @@ export default {
actual_result: ": The actual result is empty", actual_result: ": The actual result is empty",
cancel_relevance_success: "Unlinked successfully", cancel_relevance_success: "Unlinked successfully",
switch_project: "Switch project", switch_project: "Switch project",
functional_test_case: "Functional Case",
api_test_case: "Api Case",
performance_test_case: "Performance Case",
scenario_test_case: "Scenario Case",
report_statistics: "Report Statistics",
case: { case: {
list: "List", list: "List",
minder: "Minder", minder: "Minder",
@ -1473,7 +1478,8 @@ export default {
input_review_project: "Please select the project", input_review_project: "Please select the project",
input_reviewer: "Please select reviewer", input_reviewer: "Please select reviewer",
no_link_case: "No associated use cases!", no_link_case: "No associated use cases!",
pass: "pass", prepare: "Prepare",
pass: "Pass",
un_pass: "UnPass", un_pass: "UnPass",
comment: "Comment", comment: "Comment",
my_review: "My Review", my_review: "My Review",
@ -1517,11 +1523,26 @@ export default {
project_name: "Project" project_name: "Project"
}, },
home: { home: {
recent_test: "Recent test", recent_test: "Recent Test",
my_plan: "My plan", my_plan: "My Plan",
test_rate: "Test rate", test_rate: "Test Rate",
tested_case: "Tested case", tested_case: "Tested Case",
review_progress: "Review progress" review_progress: "Review Progress",
case_count: "Statistics of the number of use cases",
relevance_case: "Relevance Case",
case_maintenance: "Use case maintainer distribution",
bug_count: "Statistics of remaining defects",
case_review: "Use case review",
review_rate: "Rate",
coverage: "Coverage",
function_case_count: "Function Case Count",
relevance_case_count: "Relevance Case Count",
serial_number: "Index",
test_plan_name: "Plan Name",
case_size: "Case count",
bug_size: "Bug count",
passing_rate: "Pass Rate",
percentage: "Percentage"
}, },
plan_view: { plan_view: {
plan: "Plan", plan: "Plan",

View File

@ -1306,6 +1306,11 @@ export default {
actual_result: ": 实际结果为空", actual_result: ": 实际结果为空",
cancel_relevance_success: "取消关联成功", cancel_relevance_success: "取消关联成功",
switch_project: "切换项目", switch_project: "切换项目",
functional_test_case: "功能测试用例",
api_test_case: "接口测试用例",
performance_test_case: "性能测试用例",
scenario_test_case: "场景测试用例",
report_statistics: "报告统计",
case: { case: {
list: "列表", list: "列表",
minder: "脑图", minder: "脑图",
@ -1526,7 +1531,22 @@ export default {
my_plan: "我的计划", my_plan: "我的计划",
test_rate: "测试进度", test_rate: "测试进度",
tested_case: "已测用例", tested_case: "已测用例",
review_progress: "评审进度" review_progress: "评审进度",
case_count: "用例数量统计",
relevance_case: "关联用例数量统计",
case_maintenance: "用例维护人分布",
bug_count: "遗留缺陷统计",
case_review: "用例评审",
review_rate: "评审率",
coverage: "覆盖率",
function_case_count: "功能用例数",
relevance_case_count: "关联用例数",
serial_number: "序号",
test_plan_name: "测试计划名称",
case_size: "用例数",
bug_size: "缺陷数",
passing_rate: "通过率",
percentage: "占比"
}, },
plan_view: { plan_view: {
plan: "计划", plan: "计划",

View File

@ -1306,6 +1306,11 @@ export default {
actual_result: ": 實際結果為空", actual_result: ": 實際結果為空",
cancel_relevance_success: "取消關聯成功", cancel_relevance_success: "取消關聯成功",
switch_project: "切換項目", switch_project: "切換項目",
functional_test_case: "功能測試用例",
api_test_case: "接口測試用例",
performance_test_case: "性能測試用例",
scenario_test_case: "場景測試用例",
report_statistics: "報告統計",
case: { case: {
list: "列表", list: "列表",
minder: "腦圖", minder: "腦圖",
@ -1526,7 +1531,22 @@ export default {
my_plan: "我的計劃", my_plan: "我的計劃",
test_rate: "測試進度", test_rate: "測試進度",
tested_case: "已測用例", tested_case: "已測用例",
review_progress: "評審進度" review_progress: "評審進度",
case_count: "用例數量統計",
relevance_case: "關聯用例數量統計",
case_maintenance: "用例維護人分佈",
bug_count: "遺留缺陷統計",
case_review: "用例評審",
review_rate: "評審率",
coverage: "覆蓋率",
function_case_count: "功能用例數",
relevance_case_count: "關聯用例數",
serial_number: "序號",
test_plan_name: "測試計劃名稱",
case_size: "用例數",
bug_size: "缺陷數",
passing_rate: "通過率",
percentage: "佔比"
}, },
plan_view: { plan_view: {
plan: "計劃", plan: "計劃",