fix: 缺陷列表错位

This commit is contained in:
chenjianxing 2021-09-02 15:16:01 +08:00 committed by jianxing
parent 43343bf7b9
commit f8b2b5b7ae
3 changed files with 18 additions and 11 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<div v-if="tableActive"> <div>
<el-table <el-table
border border
:data="data" :data="data"
@ -115,7 +115,6 @@ export default {
selectDataCounts: 0, selectDataCounts: 0,
selectRows: new Set(), selectRows: new Set(),
selectIds: [], selectIds: [],
tableActive: true,
hasBatchTipShow: false hasBatchTipShow: false
}; };
}, },
@ -350,16 +349,13 @@ export default {
}, },
resetHeader() { resetHeader() {
this.$emit('update:fields', getCustomTableHeader(this.fieldKey, this.customFields)); this.$emit('update:fields', getCustomTableHeader(this.fieldKey, this.customFields));
this.reloadTable(); this.doLayout();
}, },
toggleRowSelection() { toggleRowSelection() {
this.$refs.table.toggleRowSelection(); this.$refs.table.toggleRowSelection();
}, },
reloadTable() { reloadTable() {
this.tableActive = false; this.doLayout();
this.$nextTick(() => {
this.tableActive = true;
});
} }
} }
}; };

View File

@ -840,8 +840,4 @@ export default {
.el-tag { .el-tag {
margin-left: 10px; margin-left: 10px;
} }
/*/deep/ .el-table__fixed-body-wrapper {*/
/* top: 60px !important;*/
/*}*/
</style> </style>

View File

@ -48,6 +48,7 @@
prop="num" prop="num"
:field="item" :field="item"
sortable sortable
min-width="100"
:fields-width="fieldsWidth"> :fields-width="fieldsWidth">
</ms-table-column> </ms-table-column>
@ -56,6 +57,7 @@
:fields-width="fieldsWidth" :fields-width="fieldsWidth"
:label="$t('test_track.issue.title')" :label="$t('test_track.issue.title')"
sortable sortable
min-width="110"
prop="title"> prop="title">
</ms-table-column> </ms-table-column>
@ -64,6 +66,7 @@
:fields-width="fieldsWidth" :fields-width="fieldsWidth"
:filters="platformFilters" :filters="platformFilters"
:label="$t('test_track.issue.platform')" :label="$t('test_track.issue.platform')"
min-width="80"
prop="platform"> prop="platform">
</ms-table-column> </ms-table-column>
@ -71,6 +74,7 @@
:field="item" :field="item"
:fields-width="fieldsWidth" :fields-width="fieldsWidth"
sortable sortable
min-width="110"
:label="$t('test_track.issue.platform_status') " :label="$t('test_track.issue.platform_status') "
prop="platformStatus"> prop="platformStatus">
<template v-slot="scope"> <template v-slot="scope">
@ -83,6 +87,7 @@
:fields-width="fieldsWidth" :fields-width="fieldsWidth"
column-key="creator" column-key="creator"
sortable sortable
min-width="100"
:label="$t('custom_field.issue_creator')" :label="$t('custom_field.issue_creator')"
prop="creatorName"> prop="creatorName">
</ms-table-column> </ms-table-column>
@ -221,7 +226,14 @@ export default {
isThirdPart: false isThirdPart: false
}; };
}, },
watch: {
'$route'(to, from) {
window.removeEventListener("resize", this.tableDoLayout);
},
},
activated() { activated() {
//
window.addEventListener('resize', this.tableDoLayout);
getProjectMember((data) => { getProjectMember((data) => {
this.members = data; this.members = data;
}); });
@ -270,6 +282,9 @@ export default {
} }
}, },
methods: { methods: {
tableDoLayout() {
this.$refs.table.doLayout();
},
getCustomFieldValue(row, field) { getCustomFieldValue(row, field) {
return getCustomFieldValue(row, field, this.members); return getCustomFieldValue(row, field, this.members);
}, },