fix:自定义表头缺陷列表

This commit is contained in:
wenyann 2021-06-03 16:13:21 +08:00 committed by 刘瑞斌
parent 974e5ebbdd
commit f77ec0dd2c
3 changed files with 160 additions and 16 deletions

View File

@ -1,7 +1,9 @@
<template>
<ms-table-column
:label="$t('test_track.issue.description')"
prop="description">
prop="description"
:field="field"
:fields-width="fieldsWidth">
<template v-slot:default="scope">
<el-popover
placement="right"
@ -20,6 +22,7 @@
<script>
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
import MsTableColumn from "@/business/components/common/components/table/Ms-table-column";
import {getCustomTableWidth} from "@/common/js/tableUtils";
export default {
name: "IssueDescriptionTableItem",
components: {MsTableColumn},
@ -27,7 +30,11 @@ export default {
return {
editor: ClassicEditor,
readConfig: {toolbar: []},
}
};
},
props: {
field: Object,
fieldsWidth: Object
}
}
</script>

View File

@ -11,6 +11,7 @@
<ms-table
v-loading="page.result.loading"
:data="page.data"
:enableSelection="false"
:condition="page.condition"
:total="page.total"
:page-size.sync="page.pageSize"
@ -18,23 +19,35 @@
:show-select-all="false"
:screen-height="screenHeight"
@handlePageChange="getIssues"
@refresh="getIssues">
:fields.sync="fields"
field-key="ISSUE_LIST"
@refresh="getIssues"
>
<span v-for="(item) in fields" :key="item.key">
<!-- <ms-table-column
:label="$t('test_track.issue.id')"
prop="id"
:field="item"
:fields-width="fieldsWidth"
v-if="false">
</ms-table-column>-->
<ms-table-column
:label="$t('test_track.issue.id')"
prop="id" v-if="false">
</ms-table-column>
<ms-table-column
:label="$t('test_track.issue.id')"
prop="num">
prop="num"
:field="item"
:fields-width="fieldsWidth">
</ms-table-column>
<ms-table-column
:field="item"
:fields-width="fieldsWidth"
:label="$t('test_track.issue.title')"
prop="title">
</ms-table-column>
<ms-table-column
:field="item"
:fields-width="fieldsWidth"
:label="$t('test_track.issue.status')"
prop="status">
<template v-slot="scope">
@ -43,16 +56,22 @@
</ms-table-column>
<ms-table-column
:field="item"
:fields-width="fieldsWidth"
:label="$t('test_track.issue.platform')"
prop="platform">
</ms-table-column>
<ms-table-column
:field="item"
:fields-width="fieldsWidth"
:label="$t('custom_field.issue_creator')"
prop="creatorName">
</ms-table-column>
<ms-table-column
:field="item"
:fields-width="fieldsWidth"
:label="$t('test_track.issue.issue_resource')"
prop="resourceName">
<template v-slot="scope">
@ -65,8 +84,8 @@
</template>
</ms-table-column>
<issue-description-table-item/>
<issue-description-table-item :fields-width="fieldsWidth" :field="item"/>
</span>
</ms-table>
<ms-table-pagination :change="getIssues" :current-page.sync="page.currentPage" :page-size.sync="page.pageSize"
@ -96,7 +115,7 @@ import MsTableHeader from "@/business/components/common/components/MsTableHeader
import IssueDescriptionTableItem from "@/business/components/track/issue/IssueDescriptionTableItem";
import IssueEdit from "@/business/components/track/issue/IssueEdit";
import {getIssues} from "@/network/Issue";
import {getPageInfo} from "@/common/js/tableUtils";
import {getCustomTableHeader, getCustomTableWidth, getPageInfo} from "@/common/js/tableUtils";
import MsContainer from "@/business/components/common/components/MsContainer";
import MsMainContainer from "@/business/components/common/components/MsMainContainer";
import {getCurrentProjectID} from "@/common/js/utils";
@ -114,6 +133,8 @@ export default {
data() {
return {
page: getPageInfo(),
fields: getCustomTableHeader('ISSUE_LIST'),
fieldsWidth: getCustomTableWidth('ISSUE_LIST'),
screenHeight: 'calc(100vh - 290px)',
operators: [
{

View File

@ -39,7 +39,7 @@ export const CUSTOM_TABLE_HEADER = {
{id: 'createTime', key: '6', label: i18n.t('commons.create_time')},
{id: 'updateTime', key: '7', label: i18n.t('commons.update_time')},
],
//接口定义
API_DEFINITION: [
{id: 'num', key: '1', label: "ID"},
{id: 'name', key: '2', label: i18n.t('api_test.definition.api_name')},
@ -53,7 +53,7 @@ export const CUSTOM_TABLE_HEADER = {
{id: 'casePassingRate', key: 'a', label: i18n.t('api_test.definition.api_case_passing_rate')},
{id: 'status', key: 'b', label: i18n.t('api_test.definition.api_status')}
],
//接口用例
API_CASE: [
{id: 'num', key: '1', label: "ID"},
{id: 'name', key: '2', label: i18n.t('test_track.case.name')},
@ -64,7 +64,7 @@ export const CUSTOM_TABLE_HEADER = {
{id: 'createUser', key: '7', label: "创建人"},
{id: 'updateTime', key: '8', label: i18n.t('api_test.definition.api_last_time')},
],
//场景测试
API_SCENARIO: [
{id: 'num', key: '1', label: "ID"},
{id: 'name', key: '2', label: i18n.t('api_report.scenario_name')},
@ -77,6 +77,122 @@ export const CUSTOM_TABLE_HEADER = {
{id: 'stepTotal', key: '9', label: i18n.t('api_test.automation.step')},
{id: 'lastResult', key: 'a', label: i18n.t('api_test.automation.last_result')},
{id: 'passRate', key: 'b', label: i18n.t('api_test.automation.passing_rate')},
],
//用例评审
TEST_CASE_REVIEW: [
{id: 'name', key: '1', label: i18n.t('test_track.review.review_name')},
{id: 'reviewer', key: '2', label: i18n.t('test_track.review.reviewer')},
{id: 'projectName', key: '3', label: i18n.t('test_track.review.review_project')},
{id: 'creatorName', key: '4', label: i18n.t('test_track.review.review_creator')},
{id: 'status', key: '5', label: i18n.t('test_track.review.review_status')},
{id: 'createTime', key: '6', label: i18n.t('commons.create_time')},
{id: 'endTime', key: '7', label: i18n.t('test_track.review.end_time')},
{id: 'tags', key: '8', label: i18n.t('commons.tag')},
],
//用例评审-功能用例
TEST_CASE_REVIEW_FUNCTION_TEST_CASE: [
{id: 'num', key: '1', label: i18n.t('commons.id')},
{id: 'name', key: '2', label: i18n.t('commons.name')},
{id: 'priority', key: '3', label: i18n.t('test_track.case.priority')},
{id: 'type', key: '4', label: i18n.t('test_track.case.type')},
{id: 'nodePath', key: '5', label: i18n.t('test_track.case.module')},
{id: 'projectName', key: '6', label: i18n.t('test_track.review.review_project')},
{id: 'reviewerName', key: '7', label: i18n.t('test_track.review.reviewer')},
{id: 'reviewStatus', key: '8', label: i18n.t('test_track.case.status')},
{id: 'updateTime', key: '9', label: i18n.t('commons.update_time')},
{id: 'maintainer', key: '10', label: i18n.t('custom_field.case_maintainer')},
],
//测试计划
TEST_PLAN_LIST: [
{id: 'name', key: '1', label: i18n.t('commons.name')},
{id: 'userName', key: '2', label: i18n.t('test_track.plan.plan_principal')},
{id: 'status', key: '3', label: i18n.t('test_track.plan.plan_status')},
{id: 'stage', key: '4', label: i18n.t('test_track.plan.plan_stage')},
{id: 'testRate', key: '5', label: i18n.t('test_track.home.test_rate')},
{id: 'projectName', key: '6', label: i18n.t('test_track.plan.plan_project')},
{id: 'plannedStartTime', key: '7', label: i18n.t('test_track.plan.planned_start_time')},
{id: 'plannedEndTime', key: '8', label: i18n.t('test_track.plan.planned_end_time')},
{id: 'actualStartTime', key: '9', label: i18n.t('test_track.plan.actual_start_time')},
{id: 'actualEndTime', key: '10', label: i18n.t('test_track.plan.actual_end_time')},
{id: 'tags', key: '11', label: i18n.t('commons.tag')},
{id: 'executionTimes', key: '12', label: i18n.t('commons.execution_times')},
{id: 'passRate', key: '13', label: i18n.t('commons.pass_rate')},
{id: 'createUser', key: '14', label: i18n.t('commons.create_user')},
],
//测试计划-功能用例
TEST_PLAN_FUNCTION_TEST_CASE: [
{id: 'num', key: '1', label: i18n.t('commons.id')},
{id: 'name', key: ' 2', label: i18n.t('commons.name')},
{id: 'priority', key: '3', label: i18n.t('test_track.case.priority')},
{id: 'type', key: '4', label: i18n.t('test_track.case.type')},
{id: 'tags', key: '5', label: i18n.t('commons.tag')},
{id: 'nodePath', key: '6', label: i18n.t('test_track.case.module')},
{id: 'projectName', key: '7', label: i18n.t('test_track.review.review_project')},
{id: 'issuesContent', key: '8', label: i18n.t('test_track.issue.issue')},
{id: 'executorName', key: '9', label: i18n.t('test_track.plan_view.executor')},
{id: 'status', key: '10', label: i18n.t('test_track.plan_view.execute_result')},
{id: 'updateTime', key: '11', label: i18n.t('commons.update_time')},
{id: 'maintainer', key: '12', label: i18n.t('api_test.definition.request.responsible')}
],
//测试计划-api用例
TEST_PLAN_API_CASE: [
{id: 'num', key: '1', label: i18n.t('commons.id')},
{id: 'name', key: '2', label: i18n.t('api_test.definition.api_name')},
{id: 'priority', key: '3', label: i18n.t('test_track.case.priority')},
{id: 'path', key: '4', label: i18n.t('api_test.definition.api_path')},
{id: 'createUser', key: '5', label: i18n.t('api_test.creator')},
{id: 'custom', key: '6', label: i18n.t('api_test.definition.api_last_time')},
{id: 'tags', key: '7', label: i18n.t('commons.tag')},
{id: 'execResult', key: '8', label: '执行状态'},
{id: 'maintainer', key: '9', label: i18n.t('api_test.definition.request.responsible')}
],
//测试计划-性能用例
TEST_PLAN_LOAD_CASE: [
{id: 'num', key: '1', label: i18n.t('commons.id')},
{id: 'caseName', key: '2', label: i18n.t('commons.name')},
{id: 'projectName', key: '3', label: i18n.t('load_test.project_name')},
{id: 'userName', key: '4', label: i18n.t('load_test.user_name')},
{id: 'createTime', key: '5', label: i18n.t('commons.create_time')},
{id: 'status', key: '6', label: i18n.t('commons.status')},
{id: 'caseStatus', key: '7', label: i18n.t('test_track.plan.load_case.execution_status')},
{id: 'loadReportId', key: '8', label: i18n.t('test_track.plan.load_case.report')},
],
//测试计划-场景用例
TEST_PLAN_SCENARIO_CASE: [
{id: 'num', key: '1', label: i18n.t('commons.id')},
{id: 'name', key: '2', label: i18n.t('api_test.automation.scenario_name')},
{id: 'level', key: '3', label: i18n.t('api_test.automation.case_level')},
{id: 'tagNames', key: '4', label: i18n.t('api_test.automation.tag')},
{id: 'userId', key: '5', label: i18n.t('api_test.automation.creator')},
{id: 'updateTime', key: '6', label: i18n.t('api_test.automation.update_time')},
{id: 'stepTotal', key: '7', label: i18n.t('api_test.automation.success')},
{id: 'lastResult', key: '8', label: i18n.t('api_test.automation.fail')},
{id: 'passRate', key: '9', label: i18n.t('api_test.automation.passing_rate')},
{id: 'maintainer', key: '10', label: i18n.t('api_test.definition.request.responsible')}
],
//测试用例
TRACK_TEST_CASE: [
{id: 'num', key: '1', label: i18n.t('commons.id')},
{id: 'name', key: '2', label: i18n.t('commons.name')},
{id: 'priority', key: '3', label: i18n.t('test_track.case.priority')},
{id: 'reviewStatus', key: '4', label: i18n.t('test_track.case.status')},
{id: 'tags', key: '5', label: i18n.t('commons.tag')},
{id: 'nodePath', key: '6', label: i18n.t('test_track.case.module')},
{id: 'updateTime', key: '7', label: i18n.t('commons.update_time')},
{id: 'createUser', key: '8', label: i18n.t('commons.create_user')},
{id: 'maintainer', key: '9', label: i18n.t('custom_field.case_maintainer')},
],
//缺陷列表
ISSUE_LIST: [
{id: 'num', key: '1', label: i18n.t('test_track.issue.id')},
{id: 'title', key: '2', label: i18n.t('test_track.issue.title')},
{id: 'status', key: '3', label: i18n.t('test_track.issue.status')},
{id: 'platform', key: '4', label: i18n.t('test_track.issue.platform')},
{id: 'creatorName', key: '5', label: i18n.t('custom_field.issue_creator')},
{id: 'resourceName', key: '6', label: i18n.t('test_track.issue.issue_resource')},
{id: 'description', key: '7', label: i18n.t('test_track.issue.description')},
]
}