박민혁 박민혁 2024-02-16
240216 박민혁 진단 실행 및 결과 수정
@a6adc28710c3675a73edd3d72b0901b1f155068c
--- SQL
+++ SQL
@@ -154,7 +154,7 @@
 	RESULT_CNT           INTEGER,
 	ERROR_CNT            INTEGER,
 	ERROR_NM             CHARACTER VARYING NULL,
-	MANAGE_RULE_ID       INTEGER REFERENCES MANAGE_RULE(MANAGE_RULE_ID) ON DELETE CASCADE, 
+	MANAGE_RULE_ID       INTEGER REFERENCES MANAGE_RULE(MANAGE_RULE_ID) ON DELETE CASCADE
 );
 
 
client/views/pages/result/ExecRuleResult.vue
--- client/views/pages/result/ExecRuleResult.vue
+++ client/views/pages/result/ExecRuleResult.vue
@@ -124,8 +124,7 @@
             </tr>
           </thead>
           <tbody>
-            <tr
-              v-for="(item, index) in manageResultList" :key="index" @dblclick="tableSelect()">
+            <tr v-for="(item, index) in manageResultList" :key="index" @dblclick="tableSelect(index)">
               <td>
                 {{
                   index + 1 + (searchData.currentPage - 1) * searchData.perPage
@@ -148,13 +147,8 @@
             <th colspan="12">총 {{ rowTotalCount }}건</th>
           </tfoot>
         </table>
-        <PaginationButton
-          v-model:currentPage="searchData.currentPage"
-          :perPage="searchData.perPage"
-          :totalCount="rowTotalCount"
-          :maxRange="5"
-          :click = "handlePageClick"
-        />
+        <PaginationButton v-model:currentPage="searchData.currentPage" :perPage="searchData.perPage"
+          :totalCount="rowTotalCount" :maxRange="5" :click="handlePageClick" />
       </div>
     </div>
   </div>
@@ -162,7 +156,7 @@
     <div class="modal-container" style="height: 60%">
       <div class="modal-title">
         <div class="flex justify-between align-center">
-          <h1>{{ null }}컬럼오류데이터조회</h1>
+          <h1>{{ selectedResultName }} 컬럼오류데이터조회</h1>
           <button class="close-btn" @click="closeModal">X</button>
         </div>
       </div>
@@ -171,9 +165,9 @@
           <li id="tab01" v-show="activeTab === 'tab1'">
             <table class="list-table">
               <colgroup>
-                <col style="width: 5%" />
-                <col style="width: 85%" />
-                <col style="width: " />
+                <col style="width: 20%" />
+                <col style="width: 40%" />
+                <col style="width: 40" />
               </colgroup>
               <thead>
                 <tr>
@@ -181,15 +175,14 @@
                   <th>오류 데이터</th>
                   <th>건수</th>
                 </tr>
-                <tbody>
-                    <tr>
-                        <!-- v-for자리 -->
-                        <td>1</td>
-                        <td>test_error</td>
-                        <td>15</td>
-                        </tr>
-                </tbody>
               </thead>
+              <tbody>
+                <tr v-for="(item, index) in manageResultDetail" :key="index">
+                  <td>{{ index + 1 }}</td>
+                  <td>{{ item.error_data }}</td>
+                  <td>{{ item.error_data_cnt }}</td>
+                </tr>
+              </tbody>
             </table>
           </li>
           <li id="tab01" v-show="activeTab === 'tab1'"></li>
@@ -216,8 +209,10 @@
       searchPath: mdiMagnify,
       inputValue: null,
 
-      //SELECT한 데이터 저장 리스트
       manageResultList: [],
+      manageResultDetail: [],
+      selectedResultName: null,
+
       //옵션리스트
       dbmsOption: [],
       schemaOption: [],
@@ -271,7 +266,7 @@
     selectExecResult: function () {
       const vm = this;
       if (vm.$checkLogin() == true) {
-          return;
+        return;
       }
       axios({
         url: "selectExecResult.json",
@@ -347,8 +342,38 @@
         });
     },
 
-    tableSelect: function () {
-      this.isModalOpen = true;
+    tableSelect: function (index) {
+      const vm = this;
+      vm.isModalOpen = true;
+      vm.selectedResultName = vm.manageResultList[index].column_nm;
+      vm.manageResultDetail = [];
+
+      const error_nm = this.manageResultList[index].error_nm;
+      const error_nm_array = error_nm || [];
+
+      function findErrorDataIndex(error_data, manageResultDetail) {
+        for (let i = 0; i < manageResultDetail.length; i++) {
+          if (manageResultDetail[i].error_data === error_data) {
+            return i;
+          }
+        }
+        return -1;
+      }
+
+      for (let i = 0; i < error_nm_array.length; i++) {
+        const error_data = error_nm_array[i];
+        const errorDataIndex = findErrorDataIndex(error_data, vm.manageResultDetail);
+        if (errorDataIndex !== -1) {
+          vm.manageResultDetail[errorDataIndex].error_data_cnt++;
+        } else {
+          vm.manageResultDetail.push({
+            error_data: error_data,
+            error_data_cnt: 1
+          });
+        }
+      }
+
+      console.log(manageResultDetail);
     },
 
     // 탭 변경
@@ -360,7 +385,7 @@
     },
 
     //페이지네이션 클릭 이벤트
-    handlePageClick() {},
+    handlePageClick() { },
 
     //검색버튼을 눌렀을 시
     setPage: function () {
@@ -402,7 +427,8 @@
 </script>
 
 <style scoped>
-.execRuleResultTable tr td select, input {
-    width: 100%;
+.execRuleResultTable tr td select,
+input {
+  width: 100%;
 }
 </style>
Add a comment
List