fix(测试跟踪): 修改自定义表头后,拖拽排序失效

--bug=1014223 --user=陈建星 【测试跟踪】表头显示字段增加/减少后用例拖拽失效,刷新后正常 https://www.tapd.cn/55049933/s/1185871
This commit is contained in:
chenjianxing 2022-06-18 16:00:39 +08:00 committed by jianxing
parent 44dba335c6
commit db16e04b8e
3 changed files with 30 additions and 19 deletions

View File

@ -19,7 +19,6 @@
@header-dragend="headerDragend"
@cell-mouse-enter="showPopover"
@row-click="handleRowClick"
:key="tableActive"
ref="table">
<el-table-column
@ -139,7 +138,6 @@ import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOpe
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import MsCustomTableHeader from "@/business/components/common/components/table/MsCustomTableHeader";
import {lineToHump} from "@/common/js/utils";
import {editTestCaseOrder} from "@/network/testCase";
/**
* 参考 ApiList
@ -166,8 +164,7 @@ export default {
selectRows: new Set(),
selectIds: [],
hasBatchTipShow: false,
defaultSort: {},
tableActive: true
defaultSort: {}
};
},
props: {
@ -489,10 +486,8 @@ export default {
this.$refs.table.toggleRowSelection();
},
reloadTable() {
this.tableActive = false;
this.$nextTick(() => {
this.doLayout();
this.tableActive = true;
});
},
addPaddingColClass({column}) {

View File

@ -48,14 +48,6 @@
:label="$t('commons.delete_user')"
min-width="120"/>
<ms-table-column
prop="projectName"
:fields-width="fieldsWidth"
:label="$t('test_track.case.project')"
v-if="publicEnable"
min-width="150px">
</ms-table-column>
<span v-for="(item, index) in fields" :key="index">
<ms-table-column
v-if="item.id === 'lastExecResult'"
@ -71,6 +63,14 @@
</template>
</ms-table-column>
<ms-table-column
prop="projectName"
:fields-width="fieldsWidth"
:label="$t('test_track.case.project')"
v-if="publicEnable && item.id === 'projectName'"
min-width="150px">
</ms-table-column>
<ms-table-column
v-if="!customNum"
:field="item"
@ -527,6 +527,10 @@ export default {
}
},
created: function () {
if (this.publicEnable) {
this.tableHeaderKey = 'TRACK_PUBLIC_TEST_CASE';
this.fields = getCustomTableHeader(this.tableHeaderKey);
}
this.getTemplateField();
this.$emit('setCondition', this.condition);
this.initTableData();
@ -632,7 +636,7 @@ export default {
Promise.all([p1, p2]).then((data) => {
let template = data[1];
this.testCaseTemplate = template;
this.fields = getTableHeaderWithCustomFields('TRACK_TEST_CASE', this.testCaseTemplate.customFields, this.members);
this.fields = getTableHeaderWithCustomFields(this.tableHeaderKey, this.testCaseTemplate.customFields, this.members);
// todo
this.condition.components = this.condition.components.filter(item => item.custom !== true);
let comp = getAdvSearchCustomField(this.condition, this.testCaseTemplate.customFields);

View File

@ -215,7 +215,20 @@ export let CUSTOM_TABLE_HEADER = {
{id: 'desc', key: '9', label: 'test_track.case.case_desc'},
{id: 'lastExecResult', key: '0', label: 'test_track.plan_view.execute_result'},
],
// 公共用例库
TRACK_PUBLIC_TEST_CASE: [
{id: 'num', key: '1', label: 'commons.id'},
{id: 'name', key: '2', label: 'commons.name'},
{id: 'reviewStatus', key: '3', label: 'test_track.case.status'},
{id: 'tags', key: '4', label: 'commons.tag'},
{id: 'versionId', key: 'b', label: 'project.version.name', xpack: true},
{id: 'projectName', key: '5', label: 'test_track.case.project'},
{id: 'updateTime', key: '6', label: 'commons.update_time'},
{id: 'createName', key: '7', label: 'commons.create_user'},
{id: 'createTime', key: '8', label: 'commons.create_time'},
{id: 'desc', key: '9', label: 'test_track.case.case_desc'},
{id: 'lastExecResult', key: '0', label: 'test_track.plan_view.execute_result'},
],
// 测试报告
TRACK_REPORT_TABLE: [
{id: 'name', key: '1', label: 'test_track.report.list.name'},
@ -306,4 +319,3 @@ export let CUSTOM_TABLE_HEADER = {
]
}