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

View File

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