fix(测试跟踪): 用例评审ID排序显示问题

--bug=1016674 --user=宋昌昌 【测试跟踪】github #17805,用例评审关联的功能测试用例列表按ID排序的显示结果和功能用例列表不一致 https://www.tapd.cn/55049933/s/1250441
This commit is contained in:
song-cc-rock 2022-09-22 15:53:16 +08:00 committed by jianxing
parent 99cab02ba4
commit 555e14dc28
3 changed files with 46 additions and 7 deletions

View File

@ -115,6 +115,9 @@
<when test="order.name == 'custom_num'"> <when test="order.name == 'custom_num'">
test_case.custom_num ${order.type} test_case.custom_num ${order.type}
</when> </when>
<when test="order.name == 'num'">
test_case.num ${order.type}
</when>
<when test="order.name == 'priority'"> <when test="order.name == 'priority'">
test_case.priority ${order.type} test_case.priority ${order.type}
</when> </when>

View File

@ -54,7 +54,8 @@
v-if="!customNum" v-if="!customNum"
:field="item" :field="item"
:fields-width="fieldsWidth" :fields-width="fieldsWidth"
prop="num" :column-key="'num'"
:prop="'num'"
sortable sortable
:label="$t('commons.id')" :label="$t('commons.id')"
min-width="80"> min-width="80">
@ -68,7 +69,8 @@
<ms-table-column <ms-table-column
v-if="item.id === 'num' && customNum" v-if="item.id === 'num' && customNum"
:fields-width="fieldsWidth" :fields-width="fieldsWidth"
prop="customNum" :column-key="'customNum'"
:prop="'customNum'"
sortable sortable
:label="$t('commons.id')" :label="$t('commons.id')"
min-width="80"> min-width="80">

View File

@ -40,12 +40,31 @@
> >
<span v-for="item in fields" :key="item.key"> <span v-for="item in fields" :key="item.key">
<ms-table-column <ms-table-column
v-if="item.id === 'num'" v-if="!customNum"
prop="customNum" :field="item"
sortable="custom"
:fields-width="fieldsWidth" :fields-width="fieldsWidth"
:column-key="'num'"
:prop="'num'"
sortable
:label="$t('commons.id')" :label="$t('commons.id')"
min-width="120px"/> min-width="80">
<template v-slot:default="scope">
{{ scope.row.num }}
</template>
</ms-table-column>
<ms-table-column
v-if="item.id === 'num' && customNum"
:fields-width="fieldsWidth"
:column-key="'customNum'"
:prop="'customNum'"
sortable
:label="$t('commons.id')"
min-width="80">
<template v-slot:default="scope">
{{ scope.row.customNum }}
</template>
</ms-table-column>
<ms-table-column <ms-table-column
prop="name" prop="name"
@ -316,7 +335,13 @@ export default {
}, },
editTestReviewTestCaseOrder() { editTestReviewTestCaseOrder() {
return editTestReviewTestCaseOrder; return editTestReviewTestCaseOrder;
} },
customNum() {
return this.$store.state.currentProjectIsCustomNum;
},
projectId() {
return getCurrentProjectID();
},
}, },
created() { created() {
this.condition.orders = getLastTableSortField(this.tableHeaderKey); this.condition.orders = getLastTableSortField(this.tableHeaderKey);
@ -328,6 +353,7 @@ export default {
this.isTestManagerOrTestUser = true; this.isTestManagerOrTestUser = true;
this.initTableHeader(); this.initTableHeader();
this.getVersionOptions(); this.getVersionOptions();
this.getProject();
}, },
methods: { methods: {
nextPage() { nextPage() {
@ -425,6 +451,14 @@ export default {
this.initTableData(); this.initTableData();
this.$emit('search'); this.$emit('search');
}, },
getProject() {
this.$get('/project_application/get/config/' + this.projectId + "/CASE_CUSTOM_NUM", result => {
let data = result.data;
if (data) {
this.$store.commit('setCurrentProjectIsCustomNum', data.caseCustomNum);
}
});
},
buildPagePath(path) { buildPagePath(path) {
return path + "/" + this.currentPage + "/" + this.pageSize; return path + "/" + this.currentPage + "/" + this.pageSize;
}, },