하석형 하석형 05-29
250529 하석형 통계관리 권한 목록 동적으로 표시, lodash 전체 -> 사용 기능만 import로 변경
@9e1f91a49481fdb26c25f87f64a9f55b9e2b12a0
client/views/pages/adm/departmentManagement/DepartmentManagement.vue
--- client/views/pages/adm/departmentManagement/DepartmentManagement.vue
+++ client/views/pages/adm/departmentManagement/DepartmentManagement.vue
@@ -208,7 +208,8 @@
 </template>
 
 <script>
-import _ from "lodash";
+import cloneDeep from 'lodash/cloneDeep';
+import isEqual from 'lodash/isEqual';
 import draggable from "vuedraggable";
 import Hierachy from "../../../component/hierachy/HierachyDraggable.vue";
 import ListTable from "../../../component/table/ListTable.vue";
@@ -301,7 +302,7 @@
           this.fnReset(); // 초기화
           this.mblTelnoSplit(res.data.data.deptMbr);
           this.viewDept = res.data.data.dept; // 부서 정보
-          this.originDept = _.cloneDeep(this.viewDept); // 변경전 부서
+          this.originDept = cloneDeep(this.viewDept); // 변경전 부서
           this.deptMbr = res.data.data.deptMbr; // 부서에 등록된 사용자 목록
           this.selectedDeptId = this.viewDept.deptId;
           if (this.viewDept.authrtList.length > 0) {
@@ -335,7 +336,7 @@
         return false;
       }
       // 변경전 코드와 비교
-      if(_.isEqual(this.viewDept, this.originDept)) {
+      if(isEqual(this.viewDept, this.originDept)) {
         alert("변경할 내용이 없습니다.");
         return false;
       }
@@ -345,7 +346,7 @@
         const res = await action(this.viewDept);
         alert(res.data.message);
         if (res.status == 200) {
-          this.originDept = _.cloneDeep(this.viewDept); // 변경전 코드
+          this.originDept = cloneDeep(this.viewDept); // 변경전 코드
           this.findAll();
           // this.selectedDeptId = res.data.data.deptId;
         }
@@ -392,7 +393,7 @@
         alert(res.data.message);
         if (res.status == 200) {
           this.fnReset(); // 초기화
-          this.originDept = _.cloneDeep(this.newDept); // 변경전 부서
+          this.originDept = cloneDeep(this.newDept); // 변경전 부서
           this.viewDept = {};
           this.findAll(); // 목록 재조회
         }
@@ -417,7 +418,7 @@
       //   }
       // }
       this.fnReset(); // 초기화
-      this.originDept = _.cloneDeep(this.newDept); // 변경전 부서
+      this.originDept = cloneDeep(this.newDept); // 변경전 부서
       this.submitStts = true;
     },
     // 하위 신규 객체 생성
@@ -442,12 +443,12 @@
       this.fnReset(); // 초기화
       this.viewDept.upDeptId = upDeptId;
       this.viewDept.upDeptNm = upDeptNm;
-      this.originDept = _.cloneDeep(this.viewDept); // 변경전 부서
+      this.originDept = cloneDeep(this.viewDept); // 변경전 부서
       this.submitStts = true;
     },
     // 초기화
     fnReset() {
-      this.viewDept = _.cloneDeep(this.newDept);
+      this.viewDept = cloneDeep(this.newDept);
       this.selectedDeptId = null; // 선택된 부서 객체 아이디 초기화
       this.selectedAuthrt = "";
       this.mbrList = []; // 부서에 등록되지 않은 사용자 정보 초기화
@@ -603,7 +604,7 @@
     async fnListUpdate() {
       try {
         // 내용이 변경된 경우
-        if(!_.isEqual(this.viewDept, this.originDept)) {
+        if(!isEqual(this.viewDept, this.originDept)) {
           if (!confirm("부서 목록을 저장하시겠습니까?\n 작성 중인 부서정보는 저장되지 않습니다.")) {
             return;
           }
@@ -645,7 +646,7 @@
 
     // 변경 감지
     isChanged() {
-      if(!_.isEqual(this.viewDept, this.originDept) || this.selectedAuthrt != this.viewDept.authrtList[0]?.authrtCd) {
+      if(!isEqual(this.viewDept, this.originDept) || this.selectedAuthrt != this.viewDept.authrtList[0]?.authrtCd) {
         if (!confirm("작성 중인 부서정보는 저장되지 않습니다.\n계속 하시겠습니까?")) {
           return true;
         }
client/views/pages/adm/menuManagement/menuManagement/MenuManagement.vue
--- client/views/pages/adm/menuManagement/menuManagement/MenuManagement.vue
+++ client/views/pages/adm/menuManagement/menuManagement/MenuManagement.vue
@@ -175,7 +175,8 @@
 </template>
 
 <script>
-import _ from "lodash";
+import cloneDeep from 'lodash/cloneDeep';
+import isEqual from 'lodash/isEqual';
 import draggable from "vuedraggable";
 import Hierachy from "../../../../component/hierachy/HierachyDraggable.vue";
 // Api
@@ -239,7 +240,7 @@
       if (this.valiadtion() == false) {
         return;
       }
-      let data = _.cloneDeep(this.viewMenu);
+      let data = cloneDeep(this.viewMenu);
       if (data["menuType"] == "") {
         data.menuType = "";
         data.menuTypeCtgry = "";
@@ -303,8 +304,8 @@
       //   }
       // }
       this.editMode = true;
-      this.viewMenu = _.cloneDeep(this.newMenu);
-      this.originMenu = _.cloneDeep(this.viewMenu);
+      this.viewMenu = cloneDeep(this.newMenu);
+      this.originMenu = cloneDeep(this.viewMenu);
       this.selectedMenuId = this.viewMenu.deptId;
     },
     // 하위 신규 객체 생성
@@ -323,10 +324,10 @@
       }
       const upMenuId = this.originMenu.menuId;
       const upMenuNm = this.originMenu.menuNm;
-      this.viewMenu = _.cloneDeep(this.newMenu);
+      this.viewMenu = cloneDeep(this.newMenu);
       this.viewMenu.upMenuId = upMenuId;
       this.viewMenu.upMenuNm = upMenuNm;
-      this.originMenu = _.cloneDeep(this.viewMenu);
+      this.originMenu = cloneDeep(this.viewMenu);
       this.selectedMenuId = null;
     },
 
@@ -385,7 +386,7 @@
         const res = await menuSave(data);
         alert(res.data.message);
         if (res.status == 200) {
-          this.originMenu = _.cloneDeep(this.viewMenu); // 변경 전 메뉴 정보
+          this.originMenu = cloneDeep(this.viewMenu); // 변경 전 메뉴 정보
           this.fnViewList(); // 목록 새로고침
         }
       } catch (error) {
@@ -443,7 +444,7 @@
           } else if (this.viewMenu.menuType == "conts") {
             this.ctgryList = this.contsTypeList;
           }
-          this.originMenu = _.cloneDeep(this.viewMenu); // 변경 전 메뉴 정보
+          this.originMenu = cloneDeep(this.viewMenu); // 변경 전 메뉴 정보
         }
       } catch (error) {
         const errorData = error.response.data;
@@ -460,7 +461,7 @@
         const res = await menuUpdate(data);
         alert(res.data.message);
         if (res.status == 200) {
-          this.originMenu = _.cloneDeep(this.viewMenu); // 변경 전 메뉴 정보
+          this.originMenu = cloneDeep(this.viewMenu); // 변경 전 메뉴 정보
           this.fnViewList(); // 목록 새로고침
         }
       } catch (error) {
@@ -544,7 +545,7 @@
     async fnListUpdate() {
       try {
         // 내용이 변경된 경우
-        if(!_.isEqual(this.viewMenu, this.originMenu)) {
+        if(!isEqual(this.viewMenu, this.originMenu)) {
           if (!confirm("메뉴 목록을 저장하시겠습니까?\n 작성 중인 메뉴정보는 저장되지 않습니다.")) {
             return;
           }
@@ -584,7 +585,7 @@
 
     // 변경 감지
     isChanged() {
-      if(!_.isEqual(this.viewMenu, this.originMenu)) {
+      if(!isEqual(this.viewMenu, this.originMenu)) {
         if (!confirm("작성 중인 메뉴정보는 저장되지 않습니다.\n계속 하시겠습니까?")) {
           return true;
         }
@@ -599,7 +600,7 @@
       this.ctgryList = [];
       this.viewMenu["menuTypeCtgry"] == "";
       this.viewMenu["linkUrl"] == null;
-      this.originMenu = _.cloneDeep(this.viewMenu);
+      this.originMenu = cloneDeep(this.viewMenu);
       // 데이터 삽입
       if (menuType == "bbs") {
         this.ctgryList = this.bbsList;
client/views/pages/adm/preferences/commonCodeManagement/CommonCodeManagement.vue
--- client/views/pages/adm/preferences/commonCodeManagement/CommonCodeManagement.vue
+++ client/views/pages/adm/preferences/commonCodeManagement/CommonCodeManagement.vue
@@ -95,7 +95,8 @@
 </template>
 
 <script>
-import _ from "lodash";
+import cloneDeep from 'lodash/cloneDeep';
+import isEqual from 'lodash/isEqual';
 import draggable from "vuedraggable";
 import Hierachy from "../../../../component/hierachy/HierachyDraggable.vue";
 
@@ -169,7 +170,7 @@
         const res = await findByCd(params);
         if (res.status == 200) {
           this.viewCode = res.data.data.code;
-          this.originCode = _.cloneDeep(this.viewCode); // 변경전 코드
+          this.originCode = cloneDeep(this.viewCode); // 변경전 코드
           this.submitStts = false;
         }
       } catch (error) {
@@ -189,7 +190,7 @@
       }
 
       // 변경전 코드와 비교
-      if(_.isEqual(this.viewCode, this.originCode)) {
+      if(isEqual(this.viewCode, this.originCode)) {
         alert("변경할 내용이 없습니다.");
         return false;
       }
@@ -205,7 +206,7 @@
         const res = await action(this.viewCode);
         alert(res.data.message);
         if (res.status == 200) {
-          this.originCode = _.cloneDeep(this.viewCode); // 변경전 코드
+          this.originCode = cloneDeep(this.viewCode); // 변경전 코드
           this.findAll();
           // this.selectedCd = res.data.data.cd;
         }
@@ -262,8 +263,8 @@
       //   }
       // }
       this.selectedCd = null; // 선택된 코드 초기화
-      this.viewCode = _.cloneDeep(this.newCode);
-      this.originCode = _.cloneDeep(this.viewCode); // 변경전 코드
+      this.viewCode = cloneDeep(this.newCode);
+      this.originCode = cloneDeep(this.viewCode); // 변경전 코드
       this.submitStts = true;
     },
     // 하위 신규 객체 생성
@@ -283,10 +284,10 @@
       }
       const upCd = this.originCode.cd;
       const upCdNm = this.originCode.cdNm;
-      this.viewCode = _.cloneDeep(this.newCode);
+      this.viewCode = cloneDeep(this.newCode);
       this.viewCode.upCd = upCd;
       this.viewCode.upCdNm = upCdNm;
-      this.originCode = _.cloneDeep(this.viewCode); // 변경전 코드
+      this.originCode = cloneDeep(this.viewCode); // 변경전 코드
       this.submitStts = true;
     },
     validation() {
@@ -311,7 +312,7 @@
     async fnListUpdate() {
       try {
         // 내용이 변경된 경우
-        if(!_.isEqual(this.viewCode, this.originCode)) {
+        if(!isEqual(this.viewCode, this.originCode)) {
           if (!confirm("공통코드 목록을 저장하시겠습니까?\n 작성 중인 공통코드정보는 저장되지 않습니다.")) {
             return;
           }
@@ -334,7 +335,7 @@
 
     // 변경 감지
     isChanged() {
-      if(!_.isEqual(this.viewCode, this.originCode)) {
+      if(!isEqual(this.viewCode, this.originCode)) {
         if (!confirm("작성 중인 공통코드정보는 저장되지 않습니다.\n계속 하시겠습니까?")) {
           return true;
         }
client/views/pages/adm/statistics/BbsStatistics.vue
--- client/views/pages/adm/statistics/BbsStatistics.vue
+++ client/views/pages/adm/statistics/BbsStatistics.vue
@@ -62,29 +62,41 @@
         <div class="tbl-wrap" ref="first">
           <table class="tbl data mixing">
             <colgroup>
+              <template v-for="(key, index) of chartData[0]" :key="index">
+                <col
+                  v-if="index > 1"
+                  :width="100 / chartData[0].length - 2 + '%'"
+                />
+              </template>
+              <!-- <col width="25%" />
               <col width="25%" />
               <col width="25%" />
-              <col width="25%" />
-              <col width="25%" />
+              <col width="25%" /> -->
             </colgroup>
             <thead>
               <tr>
                 <th rowspan="2"  class="sticky top-0">구분</th>
-                <th colspan="3"  class="sticky top-0">사용자 구분</th>
+                <th :colspan="authrtNmList.length" class="sticky top-0">사용자 구분</th>
               </tr>
               <tr>
-                <th class="sticky top-40">관리자</th>
+                <th v-for="authrtNm in authrtNmList" :key="authrtNm" class="sticky top-40">
+                  {{ authrtNm }}
+                </th>
+                <!-- <th class="sticky top-40">관리자</th>
                 <th class="sticky top-40">사용자</th>
-                <th class="sticky top-40">비로그인 사용자</th>
+                <th class="sticky top-40">비로그인 사용자</th> -->
               </tr>
             </thead>
             <tbody>
               <template v-if="bbsCnt > 0">
                 <tr v-for="(tr, index) of chartData" :key="index">
                   <td>{{ tr.menu }}</td>
-                  <td>{{ tr["관리자"] }}</td>
+                  <td v-for="authrtNm in authrtNmList" :key="authrtNm">
+                    {{ tr[authrtNm] }}
+                  </td>
+                  <!-- <td>{{ tr["관리자"] }}</td>
                   <td>{{ tr["사용자"] }}</td>
-                  <td>{{ tr["비로그인 사용자"] }}</td>
+                  <td>{{ tr["비로그인 사용자"] }}</td> -->
                 </tr>
               </template>
               <template v-else>
@@ -127,6 +139,7 @@
       bbsCnt: 0,
       // 차트 높이 스타일
       // heightStyle: {},
+      authrtNmList: [],
     };
   },
   created() {
@@ -158,6 +171,7 @@
           for (let data of response.data.data.list) {
             let newData = {};
             newData["menu"] = data["bbs_nm"];
+            this.authrtNmList = data["authrt_nm"];
             for (let i = 0; i < data["authrt_nm"].length; i++) {
               newData[data["authrt_nm"][i]] = data["cntn_nope"][i];
             }
client/views/pages/adm/statistics/MenuStatistics.vue
--- client/views/pages/adm/statistics/MenuStatistics.vue
+++ client/views/pages/adm/statistics/MenuStatistics.vue
@@ -62,34 +62,46 @@
         <div class="tbl-wrap  overflow-y" ref="first">
           <table class="tbl data mixing">
             <colgroup>
+              <template v-for="(key, index) of chartData[0]" :key="index">
+                <col
+                  v-if="index > 1"
+                  :width="100 / chartData[0].length - 2 + '%'"
+                />
+              </template>
+              <!-- <col width="25%" />
               <col width="25%" />
               <col width="25%" />
-              <col width="25%" />
-              <col width="25%" />
+              <col width="25%" /> -->
             </colgroup>
             <thead>
               <tr>
                 <th rowspan="2" class="sticky top-0">구분</th>
-                <th colspan="3" class="sticky top-0">사용자 구분</th>
+                <th :colspan="authrtNmList.length" class="sticky top-0">사용자 구분</th>
               </tr>
               <tr>
-                <th class="sticky top-40">관리자</th>
+                <th v-for="authrtNm in authrtNmList" :key="authrtNm" class="sticky top-40">
+                  {{ authrtNm }}
+                </th>
+                <!-- <th class="sticky top-40">관리자</th>
                 <th class="sticky top-40">사용자</th>
-                <th class="sticky top-40">비로그인 사용자</th>
+                <th class="sticky top-40">비로그인 사용자</th> -->
               </tr>
             </thead>
             <tbody>
               <template v-if="menuCnt > 0">
                 <tr v-for="(tr, index) of chartData" :key="index">
                   <td>{{ tr.menu }}</td>
-                  <td>{{ tr["관리자"] }}</td>
+                  <td v-for="authrtNm in authrtNmList" :key="authrtNm">
+                    {{ tr[authrtNm] }}
+                  </td>
+                  <!-- <td>{{ tr["관리자"] }}</td>
                   <td>{{ tr["사용자"] }}</td>
-                  <td>{{ tr["비로그인 사용자"] }}</td>
+                  <td>{{ tr["비로그인 사용자"] }}</td> -->
                 </tr>
               </template>
               <template v-else>
                 <tr>
-                  <td colspan="4" class="data-none">
+                  <td :colspan="1 + authrtNmList.length" class="data-none">
                     등록된 정보가 존재하지 않습니다.
                   </td>
                 </tr>
@@ -128,6 +140,7 @@
       menuCnt: 0,
       // 차트 높이 스타일
       heightStyle: {},
+      authrtNmList: [],
     };
   },
   created() {
@@ -159,6 +172,7 @@
         for (let data of response.data.data.list) {
           let newData = {};
           newData["menu"] = data["menu_name"];
+          this.authrtNmList = data["authrt_nm"];
           for (let i = 0; i < data["authrt_nm"].length; i++) {
             newData[data["authrt_nm"][i]] = data["cntn_nope"][i];
           }
client/views/pages/adm/statistics/UserStatistics.vue
--- client/views/pages/adm/statistics/UserStatistics.vue
+++ client/views/pages/adm/statistics/UserStatistics.vue
@@ -77,20 +77,26 @@
             <thead class="sticky">
               <tr>
                 <th rowspan="2" class="sticky top-0" >구분</th>
-                <th colspan="3" class="sticky top-0">사용자 구분</th>
+                <th :colspan="authrtNmList.length" class="sticky top-0">사용자 구분</th>
               </tr>
               <tr>
-                <th class="sticky top-40">관리자</th>
+                <th v-for="authrtNm in authrtNmList" :key="authrtNm" class="sticky top-40">
+                  {{ authrtNm }}
+                </th>
+                <!-- <th class="sticky top-40">관리자</th>
                 <th class="sticky top-40">사용자</th>
-                <th class="sticky top-40">비로그인 사용자</th>
+                <th class="sticky top-40">비로그인 사용자</th> -->
               </tr>
             </thead>
             <tbody>
               <tr v-for="(tr, index) of chartData" :key="index">
                 <td>{{ tr.date }}</td>
-                <td>{{ tr["관리자"] }}</td>
+                <td v-for="authrtNm in authrtNmList" :key="authrtNm">
+                  {{ tr[authrtNm] }}
+                </td>
+                <!-- <td>{{ tr["관리자"] }}</td>
                 <td>{{ tr["사용자"] }}</td>
-                <td>{{ tr["비로그인 사용자"] }}</td>
+                <td>{{ tr["비로그인 사용자"] }}</td> -->
               </tr>
             </tbody>
           </table>
@@ -123,6 +129,7 @@
       chartData: [],
       // 전체 수
       totalCnt: 0,
+      authrtNmList: [],
     };
   },
   created() {
@@ -153,6 +160,7 @@
         for (let data of response.data.data.list) {
           let newData = {};
           newData["date"] = data["dates"];
+          this.authrtNmList = data["authrt_nm"];
           for (let i = 0; i < data["authrt_nm"].length; i++) {
             newData[data["authrt_nm"][i]] = data["cntn_nope"][i];
           }
Add a comment
List