fix(测试跟踪): 修复table高度

This commit is contained in:
Captain.B 2021-05-26 18:07:20 +08:00 committed by 刘瑞斌
parent adff3b26f0
commit 3cf57c48fa
2 changed files with 87 additions and 71 deletions

View File

@ -22,11 +22,11 @@
{{ $t('test_track.plan.test_plan') }} {{ $t('test_track.plan.test_plan') }}
</el-menu-item> </el-menu-item>
<el-menu-item :index="'/track/issue'"> <el-menu-item :index="'/track/issue'" popper-class="submenu">
{{ $t("缺陷管理") }} {{ $t("缺陷管理") }}
</el-menu-item> </el-menu-item>
<el-menu-item :index="'/track/testPlan/reportList'"> <el-menu-item :index="'/track/testPlan/reportList'" popper-class="submenu">
{{ $t("commons.report") }} {{ $t("commons.report") }}
</el-menu-item> </el-menu-item>
</el-menu> </el-menu>
@ -84,7 +84,7 @@ export default {
} }
}, },
pathName: '', pathName: '',
} };
}, },
watch: { watch: {
'$route': { '$route': {
@ -130,7 +130,7 @@ export default {
}, },
beforeDestroy() { beforeDestroy() {
} }
} };
</script> </script>

View File

@ -1,81 +1,82 @@
<template> <template>
<el-main> <ms-container>
<el-card> <ms-main-container>
<el-card class="table-card">
<template v-slot:header>
<ms-table-header :condition.sync="page.condition" @search="getIssues" @create="handleCreate"
:create-tip="$t('test_track.issue.create_issue')" :title="$t('test_track.issue.issue_list')"
:tip="$t('issue.search_name')" :have-search="false"/>
</template>
<template v-slot:header> <ms-table
<ms-table-header :condition.sync="page.condition" @search="getIssues" @create="handleCreate" v-loading="page.result.loading"
:create-tip="$t('test_track.issue.create_issue')" :title="$t('test_track.issue.issue_list')" :data="page.data"
:tip="$t('issue.search_name')" :have-search="false"/> :condition="page.condition"
</template> :total="page.total"
:page-size.sync="page.pageSize"
:operators="operators"
:show-select-all="false"
:screen-height="screenHeight"
@handlePageChange="getIssues"
@refresh="getIssues">
<ms-table <ms-table-column
v-loading="page.result.loading" :label="$t('test_track.issue.id')"
:data="page.data" prop="id" v-if="false">
:condition="page.condition" </ms-table-column>
:total="page.total" <ms-table-column
:page-size.sync="page.pageSize" :label="$t('test_track.issue.id')"
:operators="operators" prop="num">
:show-select-all="false" </ms-table-column>
:screen-height="screenHeight"
@handlePageChange="getIssues"
@refresh="getIssues">
<ms-table-column <ms-table-column
:label="$t('test_track.issue.id')" :label="$t('test_track.issue.title')"
prop="id" v-if="false"> prop="title">
</ms-table-column> </ms-table-column>
<ms-table-column
:label="$t('test_track.issue.id')"
prop="num">
</ms-table-column>
<ms-table-column <ms-table-column
:label="$t('test_track.issue.title')" :label="$t('test_track.issue.status')"
prop="title"> prop="status">
</ms-table-column> <template v-slot="scope">
<span>{{ issueStatusMap[scope.row.status] ? issueStatusMap[scope.row.status] : scope.row.status }}</span>
</template>
</ms-table-column>
<ms-table-column <ms-table-column
:label="$t('test_track.issue.status')" :label="$t('test_track.issue.platform')"
prop="status"> prop="platform">
<template v-slot="scope"> </ms-table-column>
<span>{{ issueStatusMap[scope.row.status] ? issueStatusMap[scope.row.status] : scope.row.status }}</span>
</template>
</ms-table-column>
<ms-table-column <ms-table-column
:label="$t('test_track.issue.platform')" :label="$t('custom_field.issue_creator')"
prop="platform"> prop="creatorName">
</ms-table-column> </ms-table-column>
<ms-table-column <ms-table-column
:label="$t('custom_field.issue_creator')" :label="$t('test_track.issue.issue_resource')"
prop="creatorName"> prop="resourceName">
</ms-table-column> <template v-slot="scope">
<el-link v-if="scope.row.resourceName" @click="$router.push('/track/plan/view/' + scope.row.resourceId)">
<ms-table-column {{ scope.row.resourceName }}
:label="$t('test_track.issue.issue_resource')" </el-link>
prop="resourceName"> <span v-else>
<template v-slot="scope">
<el-link v-if="scope.row.resourceName" @click="$router.push('/track/plan/view/' + scope.row.resourceId)">
{{scope.row.resourceName}}
</el-link>
<span v-else>
-- --
</span> </span>
</template> </template>
</ms-table-column> </ms-table-column>
<issue-description-table-item/> <issue-description-table-item/>
</ms-table> </ms-table>
<ms-table-pagination :change="getIssues" :current-page.sync="page.currentPage" :page-size.sync="page.pageSize" :total="page.total"/> <ms-table-pagination :change="getIssues" :current-page.sync="page.currentPage" :page-size.sync="page.pageSize"
:total="page.total"/>
<issue-edit @refresh="getIssues" ref="issueEdit"/> <issue-edit @refresh="getIssues" ref="issueEdit"/>
</el-card>
</el-main>
</el-card>
</ms-main-container>
</ms-container>
</template> </template>
<script> <script>
@ -87,7 +88,8 @@ import MsTablePagination from "@/business/components/common/pagination/TablePagi
import { import {
CUSTOM_FIELD_SCENE_OPTION, CUSTOM_FIELD_SCENE_OPTION,
CUSTOM_FIELD_TYPE_OPTION, CUSTOM_FIELD_TYPE_OPTION,
FIELD_TYPE_MAP, ISSUE_STATUS_MAP, FIELD_TYPE_MAP,
ISSUE_STATUS_MAP,
SYSTEM_FIELD_NAME_MAP SYSTEM_FIELD_NAME_MAP
} from "@/common/js/table-constants"; } from "@/common/js/table-constants";
import MsTableHeader from "@/business/components/common/components/MsTableHeader"; import MsTableHeader from "@/business/components/common/components/MsTableHeader";
@ -95,17 +97,23 @@ import IssueDescriptionTableItem from "@/business/components/track/issue/IssueDe
import IssueEdit from "@/business/components/track/issue/IssueEdit"; import IssueEdit from "@/business/components/track/issue/IssueEdit";
import {getIssues} from "@/network/Issue"; import {getIssues} from "@/network/Issue";
import {getPageInfo} from "@/common/js/tableUtils"; import {getPageInfo} from "@/common/js/tableUtils";
import MsContainer from "@/business/components/common/components/MsContainer";
import MsMainContainer from "@/business/components/common/components/MsMainContainer";
export default { export default {
name: "CustomFieldList", name: "CustomFieldList",
components: { components: {
MsMainContainer,
MsContainer,
IssueEdit, IssueEdit,
IssueDescriptionTableItem, IssueDescriptionTableItem,
MsTableHeader, MsTableHeader,
MsTablePagination, MsTableButton, MsTableOperators, MsTableColumn, MsTable}, MsTablePagination, MsTableButton, MsTableOperators, MsTableColumn, MsTable
},
data() { data() {
return { return {
page: getPageInfo(), page: getPageInfo(),
screenHeight: 'calc(100vh - 310px)', screenHeight: 'calc(100vh - 290px)',
operators: [ operators: [
{ {
tip: this.$t('commons.edit'), icon: "el-icon-edit", tip: this.$t('commons.edit'), icon: "el-icon-edit",
@ -165,7 +173,7 @@ export default {
this.$refs.issueEdit.open(copyData); this.$refs.issueEdit.open(copyData);
}, },
handleDelete(data) { handleDelete(data) {
this.page.result = this.$get('issues/delete/' + data.id, () => { this.page.result = this.$get('issues/delete/' + data.id, () => {
this.$success(this.$t('commons.delete_success')); this.$success(this.$t('commons.delete_success'));
this.getIssues(); this.getIssues();
}); });
@ -181,5 +189,13 @@ export default {
</script> </script>
<style scoped> <style scoped>
.table-page {
padding-top: 20px;
margin-right: -9px;
float: right;
}
.el-table {
cursor: pointer;
}
</style> </style>