yjryu / KERIS star
Stormen123 2023-12-14
231214 김성훈 관리자단 - 사용자관리, 구독서비스 페이징 GET 방식으로 변경
@58da0170c8f54845240f751c8b8c5cf0ca7470cf
client/views/pages/admin/subscribe/Subscribe.vue
--- client/views/pages/admin/subscribe/Subscribe.vue
+++ client/views/pages/admin/subscribe/Subscribe.vue
@@ -48,7 +48,7 @@
             </div>
             <div class="bottom-wrap">
                 <PaginationButton v-model:currentPage="subscListSearch.currentPage" :perPage="subscListSearch.perPage"
-                    :totalCount="subscListCount" :maxRange="5" :click="subscSelectList" />
+                    :totalCount="subscListCount" :maxRange="5" :click="subscSelectListPage" />
             </div>
         </div>
     </div>
@@ -63,7 +63,7 @@
     data() {
         return {
             subscListSearch: {
-                currentPage: 1,
+                currentPage: 0,
                 perPage: 10,
                 searchType: 'all',
             },
@@ -135,14 +135,31 @@
                 alert("구독자 리스트 Excel 다운로드 오류, 관리자에게 문의해주세요.");
             });
         },
+
+        subscSelectListPage: function() {
+            this.$router.push({ path: '/adm/subscribe.page', query: { "page": this.subscListSearch.currentPage } });
+        }
     },
-    watch: {},
+    watch: {
+        'subscListSearch.currentPage': function () {
+            this.subscSelectList();
+        },
+    },
     computed: {},
     components: {
         PaginationButton: PaginationButton,
     },
+    created() {
+        if(this.$route.query.page) {
+            this.subscListSearch.currentPage = Number(this.$route.query.page);
+        } else {
+            this.subscListSearch.currentPage = 1;
+        }
+    },
     mounted() {
-        this.subscSelectList()
+        if(!this.$route.query.page) {
+            this.subscSelectList()
+        }
     }
 };
 </script>
client/views/pages/admin/user/CompanySelectOne.vue
--- client/views/pages/admin/user/CompanySelectOne.vue
+++ client/views/pages/admin/user/CompanySelectOne.vue
@@ -338,7 +338,7 @@
         },
         //리스트 페이지로 이동
         adminSelectListPage: function () {
-            this.$router.push({ path: '/adm/userSelectList.page', query: {} });
+            this.$router.push({ path: '/adm/userSelectList.page', query: {'tab': this.$route.query.tab, 'Cpage' : this.$route.query.Cpage} });
         },
 
         resetPassword: function() {
client/views/pages/admin/user/UserSelectList.vue
--- client/views/pages/admin/user/UserSelectList.vue
+++ client/views/pages/admin/user/UserSelectList.vue
@@ -10,7 +10,7 @@
             <div class="content-wrap">
                 <ul class="tab-menu">
                     <li v-for="(tab, index) in tabMenu" :key="index">
-                        <a @click="currentTab = index" :class="{ active: currentTab === index }">{{ tab }}</a>
+                        <a @click="currentTabChange(index)" :class="{ active: currentTab === index }">{{ tab }}</a>
                     </li>
                 </ul>
                 <div class="tab-content">
@@ -305,6 +305,17 @@
         };
     },
     methods: {
+        currentTabChange: function(index) {
+            this.currentTab = index;
+            if(index === 0) {
+                this.userSelectListPage();
+            } else if (index === 1) {
+                this.companySelectListPage();
+            } else {
+                this.managerSelectListPage();
+            }
+        },
+
         openModal: function () {
             this.isModalOpen = true;
             this.passwordSyncCheck()
@@ -589,28 +600,28 @@
 
          //상세조회 페이지로 이동
          userSelectOnePage: function (user) {
-            this.$router.push({ path: '/adm/userSelectOne.page', query: { 'user_id': user.user_id, 'Upage': this.userListSearch.currentPage } });
+            this.$router.push({ path: '/adm/userSelectOne.page', query: { 'tab': this.currentTab, 'Upage': this.userListSearch.currentPage, 'user_id': user.user_id  } });
         },
 
         companySelectOnePage: function (company) {
-            this.$router.push({ path: '/adm/companySelectOne.page', query: { 'user_id': company.user_id, 'Cpage': this.companyListSearch.currentPage} });
+            this.$router.push({ path: '/adm/companySelectOne.page', query: { 'tab': this.currentTab, 'Cpage': this.companyListSearch.currentPage, 'user_id': company.user_id} });
         },
 
         //상세조회 페이지로 이동
         adminSelectOnePage: function (admin) {
-            this.$router.push({ path: '/adm/userSelectOne.page', query: { 'mngr_id': admin.mngr_id, 'Mpage':  this.managerListSearch.currentPage } });
+            this.$router.push({ path: '/adm/userSelectOne.page', query: { 'tab': this.currentTab, 'Mpage':  this.managerListSearch.currentPage, 'mngr_id': admin.mngr_id } });
         },
 
         userSelectListPage: function() {
-            this.$router.push({ path: '/adm/userSelectList.page', query: { 'Upage': this.userListSearch.currentPage } });
+            this.$router.push({ path: '/adm/userSelectList.page', query: { 'tab': this.currentTab, 'Upage': this.userListSearch.currentPage } });
         },
 
         companySelectListPage: function() {
-            this.$router.push({ path: '/adm/userSelectList.page', query: { 'Cpage': this.companyListSearch.currentPage } });
+            this.$router.push({ path: '/adm/userSelectList.page', query: { 'tab': this.currentTab, 'Cpage': this.companyListSearch.currentPage } });
         },
 
         managerSelectListPage: function() {
-            this.$router.push({ path: '/adm/userSelectList.page', query: { 'Mpage': this.managerListSearch.currentPage } });
+            this.$router.push({ path: '/adm/userSelectList.page', query: { 'tab': this.currentTab, 'Mpage': this.managerListSearch.currentPage } });
         }
     },
     watch: {
@@ -634,7 +645,7 @@
         'managerListSearch.currentPage': function () {
             this.managerSelectList();
         },
-        
+
     },
     computed: {},
     components: {
@@ -643,18 +654,21 @@
     created() {
         if(this.$route.query.Upage) {
             this.userListSearch.currentPage = Number(this.$route.query.Upage);
+            this.currentTab = Number(this.$route.query.tab);
         } else {
             this.userListSearch.currentPage = 1;
         }
 
         if(this.$route.query.Cpage) {
             this.companyListSearch.currentPage = Number(this.$route.query.Cpage);
+            this.currentTab = Number(this.$route.query.tab);
         } else {
             this.companyListSearch.currentPage = 1;
         }
 
         if(this.$route.query.Mpage) {
             this.managerListSearch.currentPage = Number(this.$route.query.Mpage);
+            this.currentTab = Number(this.$route.query.tab);
         } else {
             this.managerListSearch.currentPage = 1;
         }
client/views/pages/admin/user/UserSelectOne.vue
--- client/views/pages/admin/user/UserSelectOne.vue
+++ client/views/pages/admin/user/UserSelectOne.vue
@@ -339,7 +339,11 @@
 
         //리스트 페이지로 이동
         adminSelectListPage: function () {
-            this.$router.push({ path: '/adm/userSelectList.page', query: {} });
+            if(this.route.query.user_id) {
+                this.$router.push({ path: '/adm/userSelectList.page', query: {'tab': this.$route.query.tab, 'Upage' : this.$route.query.Upage} });
+            } else {
+                this.$router.push({ path: '/adm/userSelectList.page', query: {'tab': this.$route.query.tab, 'Mpage' : this.$route.query.Mpage} });
+            }
         },
     },
     watch: {},
Add a comment
List