
250529 하석형 통계관리 권한 목록 동적으로 표시, lodash 전체 -> 사용 기능만 import로 변경
@9e1f91a49481fdb26c25f87f64a9f55b9e2b12a0
--- client/views/pages/adm/departmentManagement/DepartmentManagement.vue
+++ client/views/pages/adm/departmentManagement/DepartmentManagement.vue
... | ... | @@ -208,7 +208,8 @@ |
208 | 208 |
</template> |
209 | 209 |
|
210 | 210 |
<script> |
211 |
-import _ from "lodash"; |
|
211 |
+import cloneDeep from 'lodash/cloneDeep'; |
|
212 |
+import isEqual from 'lodash/isEqual'; |
|
212 | 213 |
import draggable from "vuedraggable"; |
213 | 214 |
import Hierachy from "../../../component/hierachy/HierachyDraggable.vue"; |
214 | 215 |
import ListTable from "../../../component/table/ListTable.vue"; |
... | ... | @@ -301,7 +302,7 @@ |
301 | 302 |
this.fnReset(); // 초기화 |
302 | 303 |
this.mblTelnoSplit(res.data.data.deptMbr); |
303 | 304 |
this.viewDept = res.data.data.dept; // 부서 정보 |
304 |
- this.originDept = _.cloneDeep(this.viewDept); // 변경전 부서 |
|
305 |
+ this.originDept = cloneDeep(this.viewDept); // 변경전 부서 |
|
305 | 306 |
this.deptMbr = res.data.data.deptMbr; // 부서에 등록된 사용자 목록 |
306 | 307 |
this.selectedDeptId = this.viewDept.deptId; |
307 | 308 |
if (this.viewDept.authrtList.length > 0) { |
... | ... | @@ -335,7 +336,7 @@ |
335 | 336 |
return false; |
336 | 337 |
} |
337 | 338 |
// 변경전 코드와 비교 |
338 |
- if(_.isEqual(this.viewDept, this.originDept)) { |
|
339 |
+ if(isEqual(this.viewDept, this.originDept)) { |
|
339 | 340 |
alert("변경할 내용이 없습니다."); |
340 | 341 |
return false; |
341 | 342 |
} |
... | ... | @@ -345,7 +346,7 @@ |
345 | 346 |
const res = await action(this.viewDept); |
346 | 347 |
alert(res.data.message); |
347 | 348 |
if (res.status == 200) { |
348 |
- this.originDept = _.cloneDeep(this.viewDept); // 변경전 코드 |
|
349 |
+ this.originDept = cloneDeep(this.viewDept); // 변경전 코드 |
|
349 | 350 |
this.findAll(); |
350 | 351 |
// this.selectedDeptId = res.data.data.deptId; |
351 | 352 |
} |
... | ... | @@ -392,7 +393,7 @@ |
392 | 393 |
alert(res.data.message); |
393 | 394 |
if (res.status == 200) { |
394 | 395 |
this.fnReset(); // 초기화 |
395 |
- this.originDept = _.cloneDeep(this.newDept); // 변경전 부서 |
|
396 |
+ this.originDept = cloneDeep(this.newDept); // 변경전 부서 |
|
396 | 397 |
this.viewDept = {}; |
397 | 398 |
this.findAll(); // 목록 재조회 |
398 | 399 |
} |
... | ... | @@ -417,7 +418,7 @@ |
417 | 418 |
// } |
418 | 419 |
// } |
419 | 420 |
this.fnReset(); // 초기화 |
420 |
- this.originDept = _.cloneDeep(this.newDept); // 변경전 부서 |
|
421 |
+ this.originDept = cloneDeep(this.newDept); // 변경전 부서 |
|
421 | 422 |
this.submitStts = true; |
422 | 423 |
}, |
423 | 424 |
// 하위 신규 객체 생성 |
... | ... | @@ -442,12 +443,12 @@ |
442 | 443 |
this.fnReset(); // 초기화 |
443 | 444 |
this.viewDept.upDeptId = upDeptId; |
444 | 445 |
this.viewDept.upDeptNm = upDeptNm; |
445 |
- this.originDept = _.cloneDeep(this.viewDept); // 변경전 부서 |
|
446 |
+ this.originDept = cloneDeep(this.viewDept); // 변경전 부서 |
|
446 | 447 |
this.submitStts = true; |
447 | 448 |
}, |
448 | 449 |
// 초기화 |
449 | 450 |
fnReset() { |
450 |
- this.viewDept = _.cloneDeep(this.newDept); |
|
451 |
+ this.viewDept = cloneDeep(this.newDept); |
|
451 | 452 |
this.selectedDeptId = null; // 선택된 부서 객체 아이디 초기화 |
452 | 453 |
this.selectedAuthrt = ""; |
453 | 454 |
this.mbrList = []; // 부서에 등록되지 않은 사용자 정보 초기화 |
... | ... | @@ -603,7 +604,7 @@ |
603 | 604 |
async fnListUpdate() { |
604 | 605 |
try { |
605 | 606 |
// 내용이 변경된 경우 |
606 |
- if(!_.isEqual(this.viewDept, this.originDept)) { |
|
607 |
+ if(!isEqual(this.viewDept, this.originDept)) { |
|
607 | 608 |
if (!confirm("부서 목록을 저장하시겠습니까?\n 작성 중인 부서정보는 저장되지 않습니다.")) { |
608 | 609 |
return; |
609 | 610 |
} |
... | ... | @@ -645,7 +646,7 @@ |
645 | 646 |
|
646 | 647 |
// 변경 감지 |
647 | 648 |
isChanged() { |
648 |
- if(!_.isEqual(this.viewDept, this.originDept) || this.selectedAuthrt != this.viewDept.authrtList[0]?.authrtCd) { |
|
649 |
+ if(!isEqual(this.viewDept, this.originDept) || this.selectedAuthrt != this.viewDept.authrtList[0]?.authrtCd) { |
|
649 | 650 |
if (!confirm("작성 중인 부서정보는 저장되지 않습니다.\n계속 하시겠습니까?")) { |
650 | 651 |
return true; |
651 | 652 |
} |
--- client/views/pages/adm/preferences/commonCodeManagement/CommonCodeManagement.vue
+++ client/views/pages/adm/preferences/commonCodeManagement/CommonCodeManagement.vue
... | ... | @@ -95,7 +95,8 @@ |
95 | 95 |
</template> |
96 | 96 |
|
97 | 97 |
<script> |
98 |
-import _ from "lodash"; |
|
98 |
+import cloneDeep from 'lodash/cloneDeep'; |
|
99 |
+import isEqual from 'lodash/isEqual'; |
|
99 | 100 |
import draggable from "vuedraggable"; |
100 | 101 |
import Hierachy from "../../../../component/hierachy/HierachyDraggable.vue"; |
101 | 102 |
|
... | ... | @@ -169,7 +170,7 @@ |
169 | 170 |
const res = await findByCd(params); |
170 | 171 |
if (res.status == 200) { |
171 | 172 |
this.viewCode = res.data.data.code; |
172 |
- this.originCode = _.cloneDeep(this.viewCode); // 변경전 코드 |
|
173 |
+ this.originCode = cloneDeep(this.viewCode); // 변경전 코드 |
|
173 | 174 |
this.submitStts = false; |
174 | 175 |
} |
175 | 176 |
} catch (error) { |
... | ... | @@ -189,7 +190,7 @@ |
189 | 190 |
} |
190 | 191 |
|
191 | 192 |
// 변경전 코드와 비교 |
192 |
- if(_.isEqual(this.viewCode, this.originCode)) { |
|
193 |
+ if(isEqual(this.viewCode, this.originCode)) { |
|
193 | 194 |
alert("변경할 내용이 없습니다."); |
194 | 195 |
return false; |
195 | 196 |
} |
... | ... | @@ -205,7 +206,7 @@ |
205 | 206 |
const res = await action(this.viewCode); |
206 | 207 |
alert(res.data.message); |
207 | 208 |
if (res.status == 200) { |
208 |
- this.originCode = _.cloneDeep(this.viewCode); // 변경전 코드 |
|
209 |
+ this.originCode = cloneDeep(this.viewCode); // 변경전 코드 |
|
209 | 210 |
this.findAll(); |
210 | 211 |
// this.selectedCd = res.data.data.cd; |
211 | 212 |
} |
... | ... | @@ -262,8 +263,8 @@ |
262 | 263 |
// } |
263 | 264 |
// } |
264 | 265 |
this.selectedCd = null; // 선택된 코드 초기화 |
265 |
- this.viewCode = _.cloneDeep(this.newCode); |
|
266 |
- this.originCode = _.cloneDeep(this.viewCode); // 변경전 코드 |
|
266 |
+ this.viewCode = cloneDeep(this.newCode); |
|
267 |
+ this.originCode = cloneDeep(this.viewCode); // 변경전 코드 |
|
267 | 268 |
this.submitStts = true; |
268 | 269 |
}, |
269 | 270 |
// 하위 신규 객체 생성 |
... | ... | @@ -283,10 +284,10 @@ |
283 | 284 |
} |
284 | 285 |
const upCd = this.originCode.cd; |
285 | 286 |
const upCdNm = this.originCode.cdNm; |
286 |
- this.viewCode = _.cloneDeep(this.newCode); |
|
287 |
+ this.viewCode = cloneDeep(this.newCode); |
|
287 | 288 |
this.viewCode.upCd = upCd; |
288 | 289 |
this.viewCode.upCdNm = upCdNm; |
289 |
- this.originCode = _.cloneDeep(this.viewCode); // 변경전 코드 |
|
290 |
+ this.originCode = cloneDeep(this.viewCode); // 변경전 코드 |
|
290 | 291 |
this.submitStts = true; |
291 | 292 |
}, |
292 | 293 |
validation() { |
... | ... | @@ -311,7 +312,7 @@ |
311 | 312 |
async fnListUpdate() { |
312 | 313 |
try { |
313 | 314 |
// 내용이 변경된 경우 |
314 |
- if(!_.isEqual(this.viewCode, this.originCode)) { |
|
315 |
+ if(!isEqual(this.viewCode, this.originCode)) { |
|
315 | 316 |
if (!confirm("공통코드 목록을 저장하시겠습니까?\n 작성 중인 공통코드정보는 저장되지 않습니다.")) { |
316 | 317 |
return; |
317 | 318 |
} |
... | ... | @@ -334,7 +335,7 @@ |
334 | 335 |
|
335 | 336 |
// 변경 감지 |
336 | 337 |
isChanged() { |
337 |
- if(!_.isEqual(this.viewCode, this.originCode)) { |
|
338 |
+ if(!isEqual(this.viewCode, this.originCode)) { |
|
338 | 339 |
if (!confirm("작성 중인 공통코드정보는 저장되지 않습니다.\n계속 하시겠습니까?")) { |
339 | 340 |
return true; |
340 | 341 |
} |
--- client/views/pages/adm/statistics/BbsStatistics.vue
+++ client/views/pages/adm/statistics/BbsStatistics.vue
... | ... | @@ -62,29 +62,41 @@ |
62 | 62 |
<div class="tbl-wrap" ref="first"> |
63 | 63 |
<table class="tbl data mixing"> |
64 | 64 |
<colgroup> |
65 |
+ <template v-for="(key, index) of chartData[0]" :key="index"> |
|
66 |
+ <col |
|
67 |
+ v-if="index > 1" |
|
68 |
+ :width="100 / chartData[0].length - 2 + '%'" |
|
69 |
+ /> |
|
70 |
+ </template> |
|
71 |
+ <!-- <col width="25%" /> |
|
65 | 72 |
<col width="25%" /> |
66 | 73 |
<col width="25%" /> |
67 |
- <col width="25%" /> |
|
68 |
- <col width="25%" /> |
|
74 |
+ <col width="25%" /> --> |
|
69 | 75 |
</colgroup> |
70 | 76 |
<thead> |
71 | 77 |
<tr> |
72 | 78 |
<th rowspan="2" class="sticky top-0">구분</th> |
73 |
- <th colspan="3" class="sticky top-0">사용자 구분</th> |
|
79 |
+ <th :colspan="authrtNmList.length" class="sticky top-0">사용자 구분</th> |
|
74 | 80 |
</tr> |
75 | 81 |
<tr> |
76 |
- <th class="sticky top-40">관리자</th> |
|
82 |
+ <th v-for="authrtNm in authrtNmList" :key="authrtNm" class="sticky top-40"> |
|
83 |
+ {{ authrtNm }} |
|
84 |
+ </th> |
|
85 |
+ <!-- <th class="sticky top-40">관리자</th> |
|
77 | 86 |
<th class="sticky top-40">사용자</th> |
78 |
- <th class="sticky top-40">비로그인 사용자</th> |
|
87 |
+ <th class="sticky top-40">비로그인 사용자</th> --> |
|
79 | 88 |
</tr> |
80 | 89 |
</thead> |
81 | 90 |
<tbody> |
82 | 91 |
<template v-if="bbsCnt > 0"> |
83 | 92 |
<tr v-for="(tr, index) of chartData" :key="index"> |
84 | 93 |
<td>{{ tr.menu }}</td> |
85 |
- <td>{{ tr["관리자"] }}</td> |
|
94 |
+ <td v-for="authrtNm in authrtNmList" :key="authrtNm"> |
|
95 |
+ {{ tr[authrtNm] }} |
|
96 |
+ </td> |
|
97 |
+ <!-- <td>{{ tr["관리자"] }}</td> |
|
86 | 98 |
<td>{{ tr["사용자"] }}</td> |
87 |
- <td>{{ tr["비로그인 사용자"] }}</td> |
|
99 |
+ <td>{{ tr["비로그인 사용자"] }}</td> --> |
|
88 | 100 |
</tr> |
89 | 101 |
</template> |
90 | 102 |
<template v-else> |
... | ... | @@ -127,6 +139,7 @@ |
127 | 139 |
bbsCnt: 0, |
128 | 140 |
// 차트 높이 스타일 |
129 | 141 |
// heightStyle: {}, |
142 |
+ authrtNmList: [], |
|
130 | 143 |
}; |
131 | 144 |
}, |
132 | 145 |
created() { |
... | ... | @@ -158,6 +171,7 @@ |
158 | 171 |
for (let data of response.data.data.list) { |
159 | 172 |
let newData = {}; |
160 | 173 |
newData["menu"] = data["bbs_nm"]; |
174 |
+ this.authrtNmList = data["authrt_nm"]; |
|
161 | 175 |
for (let i = 0; i < data["authrt_nm"].length; i++) { |
162 | 176 |
newData[data["authrt_nm"][i]] = data["cntn_nope"][i]; |
163 | 177 |
} |
--- client/views/pages/adm/statistics/MenuStatistics.vue
+++ client/views/pages/adm/statistics/MenuStatistics.vue
... | ... | @@ -62,34 +62,46 @@ |
62 | 62 |
<div class="tbl-wrap overflow-y" ref="first"> |
63 | 63 |
<table class="tbl data mixing"> |
64 | 64 |
<colgroup> |
65 |
+ <template v-for="(key, index) of chartData[0]" :key="index"> |
|
66 |
+ <col |
|
67 |
+ v-if="index > 1" |
|
68 |
+ :width="100 / chartData[0].length - 2 + '%'" |
|
69 |
+ /> |
|
70 |
+ </template> |
|
71 |
+ <!-- <col width="25%" /> |
|
65 | 72 |
<col width="25%" /> |
66 | 73 |
<col width="25%" /> |
67 |
- <col width="25%" /> |
|
68 |
- <col width="25%" /> |
|
74 |
+ <col width="25%" /> --> |
|
69 | 75 |
</colgroup> |
70 | 76 |
<thead> |
71 | 77 |
<tr> |
72 | 78 |
<th rowspan="2" class="sticky top-0">구분</th> |
73 |
- <th colspan="3" class="sticky top-0">사용자 구분</th> |
|
79 |
+ <th :colspan="authrtNmList.length" class="sticky top-0">사용자 구분</th> |
|
74 | 80 |
</tr> |
75 | 81 |
<tr> |
76 |
- <th class="sticky top-40">관리자</th> |
|
82 |
+ <th v-for="authrtNm in authrtNmList" :key="authrtNm" class="sticky top-40"> |
|
83 |
+ {{ authrtNm }} |
|
84 |
+ </th> |
|
85 |
+ <!-- <th class="sticky top-40">관리자</th> |
|
77 | 86 |
<th class="sticky top-40">사용자</th> |
78 |
- <th class="sticky top-40">비로그인 사용자</th> |
|
87 |
+ <th class="sticky top-40">비로그인 사용자</th> --> |
|
79 | 88 |
</tr> |
80 | 89 |
</thead> |
81 | 90 |
<tbody> |
82 | 91 |
<template v-if="menuCnt > 0"> |
83 | 92 |
<tr v-for="(tr, index) of chartData" :key="index"> |
84 | 93 |
<td>{{ tr.menu }}</td> |
85 |
- <td>{{ tr["관리자"] }}</td> |
|
94 |
+ <td v-for="authrtNm in authrtNmList" :key="authrtNm"> |
|
95 |
+ {{ tr[authrtNm] }} |
|
96 |
+ </td> |
|
97 |
+ <!-- <td>{{ tr["관리자"] }}</td> |
|
86 | 98 |
<td>{{ tr["사용자"] }}</td> |
87 |
- <td>{{ tr["비로그인 사용자"] }}</td> |
|
99 |
+ <td>{{ tr["비로그인 사용자"] }}</td> --> |
|
88 | 100 |
</tr> |
89 | 101 |
</template> |
90 | 102 |
<template v-else> |
91 | 103 |
<tr> |
92 |
- <td colspan="4" class="data-none"> |
|
104 |
+ <td :colspan="1 + authrtNmList.length" class="data-none"> |
|
93 | 105 |
등록된 정보가 존재하지 않습니다. |
94 | 106 |
</td> |
95 | 107 |
</tr> |
... | ... | @@ -128,6 +140,7 @@ |
128 | 140 |
menuCnt: 0, |
129 | 141 |
// 차트 높이 스타일 |
130 | 142 |
heightStyle: {}, |
143 |
+ authrtNmList: [], |
|
131 | 144 |
}; |
132 | 145 |
}, |
133 | 146 |
created() { |
... | ... | @@ -159,6 +172,7 @@ |
159 | 172 |
for (let data of response.data.data.list) { |
160 | 173 |
let newData = {}; |
161 | 174 |
newData["menu"] = data["menu_name"]; |
175 |
+ this.authrtNmList = data["authrt_nm"]; |
|
162 | 176 |
for (let i = 0; i < data["authrt_nm"].length; i++) { |
163 | 177 |
newData[data["authrt_nm"][i]] = data["cntn_nope"][i]; |
164 | 178 |
} |
--- client/views/pages/adm/statistics/UserStatistics.vue
+++ client/views/pages/adm/statistics/UserStatistics.vue
... | ... | @@ -77,20 +77,26 @@ |
77 | 77 |
<thead class="sticky"> |
78 | 78 |
<tr> |
79 | 79 |
<th rowspan="2" class="sticky top-0" >구분</th> |
80 |
- <th colspan="3" class="sticky top-0">사용자 구분</th> |
|
80 |
+ <th :colspan="authrtNmList.length" class="sticky top-0">사용자 구분</th> |
|
81 | 81 |
</tr> |
82 | 82 |
<tr> |
83 |
- <th class="sticky top-40">관리자</th> |
|
83 |
+ <th v-for="authrtNm in authrtNmList" :key="authrtNm" class="sticky top-40"> |
|
84 |
+ {{ authrtNm }} |
|
85 |
+ </th> |
|
86 |
+ <!-- <th class="sticky top-40">관리자</th> |
|
84 | 87 |
<th class="sticky top-40">사용자</th> |
85 |
- <th class="sticky top-40">비로그인 사용자</th> |
|
88 |
+ <th class="sticky top-40">비로그인 사용자</th> --> |
|
86 | 89 |
</tr> |
87 | 90 |
</thead> |
88 | 91 |
<tbody> |
89 | 92 |
<tr v-for="(tr, index) of chartData" :key="index"> |
90 | 93 |
<td>{{ tr.date }}</td> |
91 |
- <td>{{ tr["관리자"] }}</td> |
|
94 |
+ <td v-for="authrtNm in authrtNmList" :key="authrtNm"> |
|
95 |
+ {{ tr[authrtNm] }} |
|
96 |
+ </td> |
|
97 |
+ <!-- <td>{{ tr["관리자"] }}</td> |
|
92 | 98 |
<td>{{ tr["사용자"] }}</td> |
93 |
- <td>{{ tr["비로그인 사용자"] }}</td> |
|
99 |
+ <td>{{ tr["비로그인 사용자"] }}</td> --> |
|
94 | 100 |
</tr> |
95 | 101 |
</tbody> |
96 | 102 |
</table> |
... | ... | @@ -123,6 +129,7 @@ |
123 | 129 |
chartData: [], |
124 | 130 |
// 전체 수 |
125 | 131 |
totalCnt: 0, |
132 |
+ authrtNmList: [], |
|
126 | 133 |
}; |
127 | 134 |
}, |
128 | 135 |
created() { |
... | ... | @@ -153,6 +160,7 @@ |
153 | 160 |
for (let data of response.data.data.list) { |
154 | 161 |
let newData = {}; |
155 | 162 |
newData["date"] = data["dates"]; |
163 |
+ this.authrtNmList = data["authrt_nm"]; |
|
156 | 164 |
for (let i = 0; i < data["authrt_nm"].length; i++) { |
157 | 165 |
newData[data["authrt_nm"][i]] = data["cntn_nope"][i]; |
158 | 166 |
} |
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?