From 2a2f42b103795b49164190007a2dd0c902d5aded Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Wed, 15 Jun 2022 15:19:29 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=AF=84=E5=AE=A1=E9=A1=B5=E9=9D=A2=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E6=9D=A1=E6=95=B0=E5=88=86=E9=A1=B5=E6=97=B6=20?= =?UTF-8?q?=E4=BC=9A=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3=E7=A1=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 --bug=1013774 【测试跟踪】github#14253 开始用例评审,评审页面用例条数分页时 会显示不正确 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001013774 --- .../comonents/functional/FunctionalTestCaseList.vue | 13 ++++++------- .../view/components/TestReviewTestCaseList.vue | 13 ++++++------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue b/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue index 92e214d2bc..e37403b5a4 100644 --- a/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue @@ -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]) { diff --git a/frontend/src/business/components/track/review/view/components/TestReviewTestCaseList.vue b/frontend/src/business/components/track/review/view/components/TestReviewTestCaseList.vue index 57f0722af8..bced0eda0d 100644 --- a/frontend/src/business/components/track/review/view/components/TestReviewTestCaseList.vue +++ b/frontend/src/business/components/track/review/view/components/TestReviewTestCaseList.vue @@ -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) {