fix(测试跟踪): 解决评审页面用例条数分页时 会显示不正确问题

--user=郭雨琦
--bug=1013774
【测试跟踪】github#14253 开始用例评审,评审页面用例条数分页时
会显示不正确
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001013774
This commit is contained in:
guoyuqi 2022-06-15 15:19:29 +08:00 committed by f2c-ci-robot[bot]
parent 34b2e60f15
commit 2a2f42b103
2 changed files with 12 additions and 14 deletions

View File

@ -335,7 +335,7 @@ export default {
currentPage: 1,
pageSize: 10,
total: 0,
totalCount: 0,
pageCount: 0,
status: 'default',
testPlan: {},
isReadOnly: false,
@ -480,9 +480,13 @@ export default {
condition() {
this.$emit('setCondition', this.condition);
},
pageCount() {
this.currentPage = 1;
}
},
created() {
this.condition.orders = getLastTableSortField(this.tableHeaderKey);
this.pageCount = Math.ceil(this.total / this.pageSize);
},
mounted() {
this.$emit('setCondition', this.condition);
@ -565,13 +569,8 @@ export default {
this.condition.projectId = getCurrentProjectID();
if (this.planId) {
this.result = getTestPlanTestCase(this.currentPage, this.pageSize, this.condition, (data) => {
if (this.totalCount === 0) {
this.totalCount = data.itemCount;
}
this.total = data.itemCount;
if (this.total !== this.totalCount) {
this.currentPage = 1
}
this.pageCount = Math.ceil(this.total / this.pageSize);
this.tableData = data.listObject;
for (let i = 0; i < this.tableData.length; i++) {
if (this.tableData[i]) {

View File

@ -228,7 +228,7 @@ export default {
currentPage: 1,
pageSize: 10,
total: 0,
totalCount: 0,
pageCount: 0,
enableOrderDrag: true,
selectRows: new Set(),
testReview: {},
@ -316,6 +316,9 @@ export default {
currentVersion() {
this.condition.versionId = this.currentVersion;
this.initTableData();
},
pageCount() {
this.currentPage = 1;
}
},
computed: {
@ -328,6 +331,7 @@ export default {
},
created() {
this.condition.orders = getLastTableSortField(this.tableHeaderKey);
this.pageCount = Math.ceil(this.total / this.pageSize);
},
mounted() {
this.$emit('setCondition', this.condition);
@ -374,13 +378,8 @@ export default {
this.condition.nodeIds = this.selectNodeIds;
if (this.reviewId) {
this.result = getTestReviewTestCase(this.currentPage, this.pageSize, this.condition, (data) => {
if (this.totalCount === 0) {
this.totalCount = data.itemCount;
}
this.total = data.itemCount;
if (this.total !== this.totalCount) {
this.currentPage = 1
}
this.pageCount = Math.ceil(this.total / this.pageSize);
this.tableData = data.listObject;
this.getPreData();
if (callback && callback instanceof Function) {