박정하 박정하 04-18
250418 박정하 이슈 수정
@5c55ec0471d1c292da31b73edb904e40a956e68b
client/views/component/connection/modalContents/DatasetUpdate.vue
--- client/views/component/connection/modalContents/DatasetUpdate.vue
+++ client/views/component/connection/modalContents/DatasetUpdate.vue
@@ -27,21 +27,6 @@
               <button class="blue-border-btn small-btn" @click="fnOpenModal"> 타겟 데이터 조회 </button>
             </td>
           </tr>
-          <tr>
-            <th>기존 데이터 삭제 여부</th>
-            <td>
-              <div class="input-container flex">
-                <label class="radio-label mr5">
-                  <input type="radio" name="radio" :value="false" class="custom-radiobox" v-model="jobItm.itm_option_bool" />
-                  <span>기존 데이터 삭제</span>
-                </label>
-                <label class="radio-label">
-                  <input type="radio" name="radio" :value="true" class="custom-radiobox" v-model="jobItm.itm_option_bool" />
-                  <span>기존 데이터 미삭제</span>
-                </label>
-              </div>
-            </td>
-          </tr>
         </tbody>
       </table>
       <!-- 매핑 -->
@@ -183,6 +168,7 @@
     for (let column of this.frontColumns) {
       column.isConnect = false;
     }
+    console.log("this.frontColumns: ", this.frontColumns)
   },
 
   watch: {
@@ -240,40 +226,43 @@
 
     // 타겟 데이터 조회 후 처리
     fnSetTargetData() {
-      this.jobItm.dataTable.columnDatas =
-        this.jobItm.dataTable.columnDatas.filter(
-          (column) => column.orginlColumnNm !== "ts_row"
-        );
-      this.matchList = [];
-      for (let column of this.jobItm.dataTable.columnDatas) {
-        this.matchList.push({
-          origin: column,
-          target: column,
-        });
-      }
-      
-      if (this.isCheck) {
-        // this.item.itemList의 모든 항목에 대해
-        this.item.itemList.forEach(item => {
-          if (this.matchList.length > 0) {
-            // 깊은 복사를 통해 origin과 target 연결 끊기
-            const matchingTarget = this.matchList.find(match =>
-              match.target.displyColumnNm === item.orginColumnNm
-            );
+      this.jobItm.dataTable.columnDatas = this.jobItm.dataTable.columnDatas.filter((column) => column.orginlColumnNm !== "ts_row");
 
-            // 일치하는 target이 있으면 해당 target의 displyColumnNm만 변경
-            if (matchingTarget && matchingTarget.target) {
-              // target 객체만 변경 (원본 객체와 분리)
-              const newTarget = JSON.parse(JSON.stringify(matchingTarget.target));
-              newTarget.displyColumnNm = item.targetColumnNm;
-
-              // 기존 참조를 끊고 새 객체로 교체
-              matchingTarget.target = newTarget;
+      this.matchList = []; // 초기화
+      if (this.isCheck) { // 기존값 있는 경우
+        for (let item of this.item.itemList) {
+          let origin = {};
+          let target = {};
+          for (let column of this.jobItm.dataTable.columnDatas) {
+            if (item.orginColumnNm === column.displyColumnNm) {
+              origin = column;
+              break;
             }
           }
-        });
+          for (let frontCol of this.frontColumns) {
+            if (frontCol.displyColumnNm === item.targetColumnNm) {
+              target = frontCol;
+              break;
+            }
+          }
+          this.matchList.push({ origin, target });
+        };
         this.isCheck = false;
+      } else { // 기존값 없는 경우
+        for (let column of this.jobItm.dataTable.columnDatas) {
+          let origin = column;
+          let target = {};
+          for (let frontCol of this.frontColumns) {
+            if (column.columnNm === frontCol.columnNm) {
+              target = frontCol;
+              break;
+            }
+          };
+          this.matchList.push({ origin, target });
+        }
       }
+
+      this.fnMatchList(); // 매치 리스트 실행
     },
 
     // 매치 리스트
client/views/component/connection/modalContents/DbRead.vue
--- client/views/component/connection/modalContents/DbRead.vue
+++ client/views/component/connection/modalContents/DbRead.vue
@@ -152,11 +152,12 @@
                   <p> 총 <span>{{ jobItm.dataTable.totalRows }}</span>건 중 <span>{{ jobItm.dataTable.rowData.length }}</span>건 조회 </p>
                 </div>
                 <div style="height: calc(100% - 15px); overflow: auto;">
-                  <table class="list-table">
+                  <table class="list-table" v-if="jobItm.dataTable.columnDatas.length > 0">
                     <thead>
-                      <tr v-if="jobItm.dataTable.columnDatas.length > 0">
-                        <th v-for="(itm, indx) in jobItm.dataTable
-                          .columnDatas" :key="indx" style="min-width: 150px !important"> {{ itm.columnNm }} <label class="check-label">
+                      <tr>
+                        <th v-for="(itm, indx) in jobItm.dataTable.columnDatas" :key="indx" style="min-width: 150px !important">
+                          <label class="check-label">
+                            <span class="mr10">{{ itm.columnNm }}</span>
                             <input type="checkbox" class="custom-checkbox" v-model="itm.pkAt" />
                           </label>
                         </th>
Add a comment
List