
--- client/views/component/connection/modalContents/DatasetUpdate.vue
+++ client/views/component/connection/modalContents/DatasetUpdate.vue
... | ... | @@ -27,21 +27,6 @@ |
27 | 27 |
<button class="blue-border-btn small-btn" @click="fnOpenModal"> 타겟 데이터 조회 </button> |
28 | 28 |
</td> |
29 | 29 |
</tr> |
30 |
- <tr> |
|
31 |
- <th>기존 데이터 삭제 여부</th> |
|
32 |
- <td> |
|
33 |
- <div class="input-container flex"> |
|
34 |
- <label class="radio-label mr5"> |
|
35 |
- <input type="radio" name="radio" :value="false" class="custom-radiobox" v-model="jobItm.itm_option_bool" /> |
|
36 |
- <span>기존 데이터 삭제</span> |
|
37 |
- </label> |
|
38 |
- <label class="radio-label"> |
|
39 |
- <input type="radio" name="radio" :value="true" class="custom-radiobox" v-model="jobItm.itm_option_bool" /> |
|
40 |
- <span>기존 데이터 미삭제</span> |
|
41 |
- </label> |
|
42 |
- </div> |
|
43 |
- </td> |
|
44 |
- </tr> |
|
45 | 30 |
</tbody> |
46 | 31 |
</table> |
47 | 32 |
<!-- 매핑 --> |
... | ... | @@ -183,6 +168,7 @@ |
183 | 168 |
for (let column of this.frontColumns) { |
184 | 169 |
column.isConnect = false; |
185 | 170 |
} |
171 |
+ console.log("this.frontColumns: ", this.frontColumns) |
|
186 | 172 |
}, |
187 | 173 |
|
188 | 174 |
watch: { |
... | ... | @@ -240,40 +226,43 @@ |
240 | 226 |
|
241 | 227 |
// 타겟 데이터 조회 후 처리 |
242 | 228 |
fnSetTargetData() { |
243 |
- this.jobItm.dataTable.columnDatas = |
|
244 |
- this.jobItm.dataTable.columnDatas.filter( |
|
245 |
- (column) => column.orginlColumnNm !== "ts_row" |
|
246 |
- ); |
|
247 |
- this.matchList = []; |
|
248 |
- for (let column of this.jobItm.dataTable.columnDatas) { |
|
249 |
- this.matchList.push({ |
|
250 |
- origin: column, |
|
251 |
- target: column, |
|
252 |
- }); |
|
253 |
- } |
|
254 |
- |
|
255 |
- if (this.isCheck) { |
|
256 |
- // this.item.itemList의 모든 항목에 대해 |
|
257 |
- this.item.itemList.forEach(item => { |
|
258 |
- if (this.matchList.length > 0) { |
|
259 |
- // 깊은 복사를 통해 origin과 target 연결 끊기 |
|
260 |
- const matchingTarget = this.matchList.find(match => |
|
261 |
- match.target.displyColumnNm === item.orginColumnNm |
|
262 |
- ); |
|
229 |
+ this.jobItm.dataTable.columnDatas = this.jobItm.dataTable.columnDatas.filter((column) => column.orginlColumnNm !== "ts_row"); |
|
263 | 230 |
|
264 |
- // 일치하는 target이 있으면 해당 target의 displyColumnNm만 변경 |
|
265 |
- if (matchingTarget && matchingTarget.target) { |
|
266 |
- // target 객체만 변경 (원본 객체와 분리) |
|
267 |
- const newTarget = JSON.parse(JSON.stringify(matchingTarget.target)); |
|
268 |
- newTarget.displyColumnNm = item.targetColumnNm; |
|
269 |
- |
|
270 |
- // 기존 참조를 끊고 새 객체로 교체 |
|
271 |
- matchingTarget.target = newTarget; |
|
231 |
+ this.matchList = []; // 초기화 |
|
232 |
+ if (this.isCheck) { // 기존값 있는 경우 |
|
233 |
+ for (let item of this.item.itemList) { |
|
234 |
+ let origin = {}; |
|
235 |
+ let target = {}; |
|
236 |
+ for (let column of this.jobItm.dataTable.columnDatas) { |
|
237 |
+ if (item.orginColumnNm === column.displyColumnNm) { |
|
238 |
+ origin = column; |
|
239 |
+ break; |
|
272 | 240 |
} |
273 | 241 |
} |
274 |
- }); |
|
242 |
+ for (let frontCol of this.frontColumns) { |
|
243 |
+ if (frontCol.displyColumnNm === item.targetColumnNm) { |
|
244 |
+ target = frontCol; |
|
245 |
+ break; |
|
246 |
+ } |
|
247 |
+ } |
|
248 |
+ this.matchList.push({ origin, target }); |
|
249 |
+ }; |
|
275 | 250 |
this.isCheck = false; |
251 |
+ } else { // 기존값 없는 경우 |
|
252 |
+ for (let column of this.jobItm.dataTable.columnDatas) { |
|
253 |
+ let origin = column; |
|
254 |
+ let target = {}; |
|
255 |
+ for (let frontCol of this.frontColumns) { |
|
256 |
+ if (column.columnNm === frontCol.columnNm) { |
|
257 |
+ target = frontCol; |
|
258 |
+ break; |
|
259 |
+ } |
|
260 |
+ }; |
|
261 |
+ this.matchList.push({ origin, target }); |
|
262 |
+ } |
|
276 | 263 |
} |
264 |
+ |
|
265 |
+ this.fnMatchList(); // 매치 리스트 실행 |
|
277 | 266 |
}, |
278 | 267 |
|
279 | 268 |
// 매치 리스트 |
--- client/views/component/connection/modalContents/DbRead.vue
+++ client/views/component/connection/modalContents/DbRead.vue
... | ... | @@ -152,11 +152,12 @@ |
152 | 152 |
<p> 총 <span>{{ jobItm.dataTable.totalRows }}</span>건 중 <span>{{ jobItm.dataTable.rowData.length }}</span>건 조회 </p> |
153 | 153 |
</div> |
154 | 154 |
<div style="height: calc(100% - 15px); overflow: auto;"> |
155 |
- <table class="list-table"> |
|
155 |
+ <table class="list-table" v-if="jobItm.dataTable.columnDatas.length > 0"> |
|
156 | 156 |
<thead> |
157 |
- <tr v-if="jobItm.dataTable.columnDatas.length > 0"> |
|
158 |
- <th v-for="(itm, indx) in jobItm.dataTable |
|
159 |
- .columnDatas" :key="indx" style="min-width: 150px !important"> {{ itm.columnNm }} <label class="check-label"> |
|
157 |
+ <tr> |
|
158 |
+ <th v-for="(itm, indx) in jobItm.dataTable.columnDatas" :key="indx" style="min-width: 150px !important"> |
|
159 |
+ <label class="check-label"> |
|
160 |
+ <span class="mr10">{{ itm.columnNm }}</span> |
|
160 | 161 |
<input type="checkbox" class="custom-checkbox" v-model="itm.pkAt" /> |
161 | 162 |
</label> |
162 | 163 |
</th> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?