hyeonZIP 2024-02-16
240216 임재현 도메인진단규칙 검색조건&페이징 문제 수정
@95187886ba5cf9a98efd7dda65c0ec80431580de
client/views/pages/rule/DomainRuleManagement.vue
--- client/views/pages/rule/DomainRuleManagement.vue
+++ client/views/pages/rule/DomainRuleManagement.vue
@@ -36,7 +36,7 @@
                   <td>
                     <select
                       class="square-select"
-                      v-model="valRuleSearch.val_rule_type"
+                      v-model="previousValRuleData.val_rule_type"
                       style="width: 100%"
                       @change="updateSearchButton()"
                     >
@@ -54,13 +54,13 @@
                   <td style="position: relative">
                     <input
                       type="text"
-                      v-model="valRuleSearch.val_rule_nm"
+                      v-model="previousValRuleData.val_rule_nm"
                       class="square-input"
                       style="width: 100%; margin-left: auto"
                     />
                     <button
                       style="position: absolute"
-                      @click="selectValRule"
+                      @click="setPage(2)"
                       class="square-button"
                     >
                       <svg-icon
@@ -136,7 +136,7 @@
                       name=""
                       id=""
                       class="square-select"
-                      v-model="cmListSearch.code_type"
+                      v-model="previousCmData.code_type"
                       @change="updateSearchButton()"
                     >
                       <option :value="null">선택</option>
@@ -149,12 +149,12 @@
                     <input
                       type="text"
                       class="square-input"
-                      v-model="cmListSearch.code_nm"
+                      v-model="previousCmData.code_nm"
                       style="width: 100%; margin-left: auto"
                     />
                     <button
                       style="position: absolute"
-                      @click="selectCodeList"
+                      @click="setPage(3)"
                       class="square-button"
                     >
                       <svg-icon
@@ -323,7 +323,7 @@
                 </tr>
               </tbody>
             </table>
-            <button class="blue-btn small-btn" @click="setPage()">검색</button>
+            <button class="blue-btn small-btn" @click="setPage(1)">검색</button>
           </div>
         </div>
         <div class="content-titleZone">
@@ -464,6 +464,18 @@
         table_nm: null,
         column_nm: null,
       },
+
+      previousDomainData: {
+        currentPage: 1,
+        perPage: 15,
+        user_id: $cookies.get("USER_ID"),
+        dbmsType: "all",
+        searchText: null,
+        dbms_name: null,
+        schema_name: null,
+        table_nm: null,
+        column_nm: null,
+      },
       // update할 도메인 진단 규칙
       checkedDomain: [],
       domainUpdate: {
@@ -490,10 +502,29 @@
         user_id: $cookies.get("USER_ID"),
       },
 
+      previousValRuleData: {
+        dqi_nm: "전체",
+        val_rule_type: "전체",
+        val_rule_nm: null,
+        currentPage: 1,
+        perPage: 10,
+        user_id: $cookies.get("USER_ID"),
+      },
+
       // select한 코드
       codeList: [],
       codeListCount: 0,
+
       cmListSearch: {
+        dbms_id: null,
+        code_type: null,
+        code_nm: null,
+        currentPage: 1,
+        perPage: 10,
+        user_id: $cookies.get("USER_ID"),
+      },
+
+      previousCmData: {
         dbms_id: null,
         code_type: null,
         code_nm: null,
@@ -684,8 +715,6 @@
       if (vm.searchButton) {
         vm.domainSearch.currentPage = 1;
       }
-      vm.domainSearch.dbms_name = vm.selectDbms.dbms_name;
-      vm.domainSearch.schema_name = vm.selectSchema.schema_name;
       axios({
         url: "selectDomainRule.json",
         method: "post",
@@ -815,26 +844,33 @@
     },
 
     //예외 처리 및 검색 버튼 누를시 페이지 1로 초기화
-    setPage: function () {
+    setPage: function (menu) {
       if (this.$checkLogin() == true) {
         return;
       }
-      if (this.searchButton) {
-        this.domainSearch.currentPage = 1;
+      switch (menu) {
+        case 1:
+          if (this.selectDbms === "") {
+            this.$showAlert("deny", "DBMS를 선택해주세요.");
+            break;
+          }
+          if (this.selectSchema === "") {
+            this.$showAlert("deny", "스키마를 선택해주세요.");
+            break;
+          }
+          this.domainSearch.dbms_name = this.selectDbms.dbms_name;
+          this.domainSearch.schema_name = this.selectSchema.schema_name;
+
+          this.checkedDomain = [];
+          this.selectDomainRule();
+          break;
+        case 2:
+          this.valRuleSearch = { ...this.previousValRuleData };
+          this.selectValRule();
+        case 3:
+          this.cmListSearch = { ...this.previousCmData };
+          this.selectCodeList();
       }
-      if (this.$checkLogin() == true) {
-        return;
-      }
-      if (this.selectDbms === "") {
-        this.$showAlert("deny", "DBMS를 선택해주세요.");
-        return;
-      }
-      if (this.selectSchema === "") {
-        this.$showAlert("deny", "스키마를 선택해주세요.");
-        return;
-      }
-      this.checkedDomain = [];
-      this.selectDomainRule();
     },
 
     //페이지네이션 클릭 이벤트
Add a comment
List