From 8d0eb878a25d70e8b601167e63a8ff9f1db99142 Mon Sep 17 00:00:00 2001 From: Ilya Sochkov Date: Sat, 21 Dec 2024 19:07:43 +0300 Subject: [PATCH 1/3] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=B0=D0=B3=D0=B8=D0=BD=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/src/components/ContentComponent.vue | 92 +++++++++++++++---- .../components/project/NewProjectButton.vue | 2 +- .../components/project/ProjectComponent.vue | 2 +- .../src/src/components/task/TasksListPage.vue | 62 ++++++++++++- 4 files changed, 132 insertions(+), 26 deletions(-) diff --git a/frontend/src/src/components/ContentComponent.vue b/frontend/src/src/components/ContentComponent.vue index 7d36707..450233b 100644 --- a/frontend/src/src/components/ContentComponent.vue +++ b/frontend/src/src/components/ContentComponent.vue @@ -2,7 +2,7 @@
@@ -200,6 +212,11 @@ export default { this.currentPage++; } }, + goToPage(page) { + if (page >= 1 && page <= this.totalPages) { + this.currentPage = page; + } + }, }, beforeMount() { this.fetchProjects(); @@ -309,6 +326,10 @@ button:hover { margin: 0 10px; } +.pagination button.active { + background-color: #5c5583; +} + .pagination button:hover { background-color: #5c5583; } diff --git a/frontend/src/src/components/task/TasksListPage.vue b/frontend/src/src/components/task/TasksListPage.vue index 389377b..280352e 100644 --- a/frontend/src/src/components/task/TasksListPage.vue +++ b/frontend/src/src/components/task/TasksListPage.vue @@ -67,7 +67,19 @@
@@ -240,6 +252,11 @@ export default { this.currentPage++; } }, + goToPage(page) { + if (page >= 1 && page <= this.totalPages) { + this.currentPage = page; + } + }, }, beforeMount() { this.fetchTaskData(); @@ -370,6 +387,10 @@ button:hover { margin: 0 10px; } +.pagination button.active { + background-color: #5c5583; +} + .pagination button:hover { background-color: #5c5583; } @@ -378,4 +399,4 @@ button:hover { background-color: #ccc; cursor: not-allowed; } - \ No newline at end of file + From 7a6338c4a0b320f78d7a24f248187d5a9354c521 Mon Sep 17 00:00:00 2001 From: Ilya Sochkov Date: Mon, 23 Dec 2024 15:36:04 +0300 Subject: [PATCH 3/3] =?UTF-8?q?=D0=9E=D1=82=D0=BA=D0=BE=D1=80=D1=80=D0=B5?= =?UTF-8?q?=D0=BA=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BB=20=D0=BF=D0=B0?= =?UTF-8?q?=D0=B3=D0=B8=D0=BD=D0=B0=D1=86=D0=B8=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/src/components/ContentComponent.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/src/components/ContentComponent.vue b/frontend/src/src/components/ContentComponent.vue index cc92d34..9ccf505 100644 --- a/frontend/src/src/components/ContentComponent.vue +++ b/frontend/src/src/components/ContentComponent.vue @@ -105,10 +105,10 @@ export default { return user ? user.role : null; }, itemsPerPage() { - if (this.currentPage === 1 && this.userRole !== 'Рабочий' && this.userRole !== 'Прораб') { - return 6; + if (this.currentPage === 1 && (this.userRole === 'Рабочий' || this.userRole === 'Прораб')) { + return 7; } - return 7; + return 6; }, paginatedItems() { const start = (this.currentPage - 1) * this.itemsPerPage; @@ -116,7 +116,7 @@ export default { return this.items.slice(start, end); }, totalPages() { - return Math.ceil((this.items.length - (this.currentPage === 1 && this.userRole !== 'Рабочий' && this.userRole !== 'Прораб' ? 1 : 0)) / this.itemsPerPage); + return Math.ceil(this.items.length / this.itemsPerPage); }, }, methods: {