yjryu / KERIS star
류윤주 류윤주 2023-11-27
231127 류윤주 메뉴 통계 커밋
@305cc1368cf09d8d94ac146f11aea53e8f816607
client/resources/css/Main.css
--- client/resources/css/Main.css
+++ client/resources/css/Main.css
@@ -97,25 +97,31 @@
   box-shadow: 1px 1px 20px #3a3a3a;
   background-color: white;
 }
-.main-popup-div .swiper-wrapper {
-  padding: 0 0 3rem;
-}
+
 .main-popup-div {
   border-radius: 2rem;
 }
+
+.main-popup-div a{
+  display: block;
+  width: 100%;
+  height: auto;
+}
 .main-popup img {
   width: 100%;
-  /* margin: 2rem; */
   border-top-right-radius: 2rem;
   border-top-left-radius: 2rem;
+  object-fit: cover;
 }
 .main-popup-input {
-  padding: 0.5rem 1.7rem;
+  padding: 2rem 1.7rem;
   display: flex;
   justify-content: space-between;
   text-align: center;
 }
-
+.main-popup-input p{
+  cursor: pointer;
+}
 .modal-news-title {
   font-size: 2rem;
   font-weight: 600;
client/views/component/chart/BarChart.vue
--- client/views/component/chart/BarChart.vue
+++ client/views/component/chart/BarChart.vue
@@ -14,12 +14,15 @@
     props: {
         chartData: {
             type: Array,
-            default:[],
+            default: [],
         },
         mapping: {
             type: Array,
             required: true,
         },
+        columnX:{
+            type:String
+        }
     },
     data() {
         return {
@@ -27,7 +30,7 @@
         };
     },
     methods: {
-        chartCreate: function (data, mapping) {
+        chartCreate: function (data, columnX ,mapping) {
             let chartWarp = this.$refs["chartdiv"]; // 차트 상위 div ref 매칭
             chartWarp.innerHTML = ""; // 차트 상위 div 내용 초기화 (기존 차트 삭제)
             let div = document.createElement("div"); // 차트를 담을 빈 div 생성 (차트 하위 div)
@@ -76,7 +79,7 @@
             })
 
             let xAxis = chart.xAxes.push(am5xy.CategoryAxis.new(root, {
-                categoryField: "date",
+                categoryField: columnX,
                 renderer: xRenderer,
                 tooltip: am5.Tooltip.new(root, {})
             }));
@@ -102,7 +105,7 @@
                     xAxis: xAxis,
                     yAxis: yAxis,
                     valueYField: fieldName,
-                    categoryXField: "date"
+                    categoryXField: columnX
                 }));
 
                 series.columns.template.setAll({
@@ -135,10 +138,12 @@
             }
 
             let keys = Object.keys(data[0]); // 데이터 객체의 모든 키를 가져옵니다.
-            for (let i = 0; i < keys.length; i++) { // 첫 번째 키인 'year'는 제외하고 반복합니다.
+            for (let i = 0; i < keys.length; i++) {
                 let key = keys[i];
-                let koreanKey = mapping[key]; // 영어 키를 한글로 맵핑합니다.
-                makeSeries(koreanKey, key);
+                if (key !== 'stats_date') { // 'stats_date'를 제외하고 차트를 생성합니다.
+                    let koreanKey = mapping[key]; // 영어 키를 한글로 맵핑합니다.
+                    makeSeries(koreanKey, key);
+                }
             }
 
 
@@ -150,9 +155,9 @@
     },
     watch: {
         'chartData': function (newData) {
-            console.log('pageList  - ',newData);
+            console.log('pageList  - ', newData);
             console.log('mapping  -  ', this.mapping)
-            this.chartCreate(newData, this.mapping)
+            this.chartCreate(newData,this.columnX, this.mapping)
         }
     },
     computed: {
@@ -162,7 +167,6 @@
 
     },
     mounted() {
-
     }
 }
 
client/views/pages/admin/statistics/MatchingStatistics.vue
--- client/views/pages/admin/statistics/MatchingStatistics.vue
+++ client/views/pages/admin/statistics/MatchingStatistics.vue
@@ -41,18 +41,19 @@
                         </div>
                         <table class="statistics-table">
                             <colgroup>
-                                <col style="width: 20%;" />
                                 <col style="width: 16%;" />
-                                <col style="width: 16%;" />
-                                <col style="width: 16%;" />
-                                <col style="width: 16%;" />
-                                <col style="width: 16%;" />
+                                <col style="width: 14%;" />
+                                <col style="width: 14%;" />
+                                <col style="width: 14%;" />
+                                <col style="width: 14%;" />
+                                <col style="width: 14%;" />
+                                <col style="width: 14%;" />
                             </colgroup>
                             <thead>
                                 <tr>
                                     <th rowspan="2">기업별</th>
-                                    <th colspan="5" v-if="selectedOption1 === 'pick'">Pick</th>
-                                    <th colspan="5" v-else-if="selectedOption1 === 'matching'">Matching</th>
+                                    <th colspan="6" v-if="selectedOption1 === 'pick'">Pick</th>
+                                    <th colspan="6" v-else-if="selectedOption1 === 'matching'">Matching</th>
                                 </tr>
                                 <tr>
                                     <th>성공건수</th>
client/views/pages/admin/statistics/MenuStatistics.vue
--- client/views/pages/admin/statistics/MenuStatistics.vue
+++ client/views/pages/admin/statistics/MenuStatistics.vue
@@ -21,7 +21,7 @@
                 </div>
             </div>
         </div>
-        <BarChart :chartData="pageLogListByDate" :mapping="keyMapping" />
+        <BarChart :chartData="pageLogListByDate" :mapping="keyMapping" columnX="stats_date"/>
         <div class="table-zone">
             <div class="btn-wrap">
                 <button class="blue-border-bnt">Excel 다운로드</button>
@@ -84,7 +84,7 @@
     data() {
         return {
             keyMapping: {
-                stats_date: "date",
+                stats_date: "날짜",
                 info: "통합지원센터",
                 technology: "기술문서",
                 databook: "자료집",
@@ -92,6 +92,7 @@
                 notice: "공지사항",
                 news: "홍보뉴스",
                 wg: "전문가협의체",
+                total:"전체"
             },
            
             pageListSearch: {
client/views/pages/user/main/Main.vue
--- client/views/pages/user/main/Main.vue
+++ client/views/pages/user/main/Main.vue
@@ -326,31 +326,30 @@
 
 
 
-    <!-- <div class="main-popup" v-if="showPopup">
+    <div class="main-popup" v-show="popupList.length > 0">
         <div>
-
             <div class="main-popup-div">
-                <swiper style="margin: 2rem;" :spaceBetween="30" :centeredSlides="true" :autoplay="{
+                <swiper :spaceBetween="30" :centeredSlides="true" :autoplay="{
                     delay: 3000,
                     disableOnInteraction: false,
                 }" :pagination="{
     clickable: true,
 }" :navigation="false" :modules="modules" class="mySwiper">
 
-                    <swiper-slide><img src="../../../../resources/jpg/main-popup-img.jpg" alt=""></swiper-slide>
-                    <swiper-slide><img src="../../../../resources/jpg/main-popup-img.jpg" alt=""></swiper-slide>
-                    <swiper-slide><img src="../../../../resources/jpg/main-popup-img.jpg" alt=""></swiper-slide>
-                    <swiper-slide><img src="../../../../resources/jpg/main-popup-img.jpg" alt=""></swiper-slide>
+                    <swiper-slide v-for="(item, index) in popupList" :key="index">
+                        <a :href="item.shortcuts_url" target="_blank">
+                            <img :src="getFilePath(item.file_path, item.file_nm, item.file_extn_nm)" alt="">
+                        </a>
+                    </swiper-slide>
 
                 </swiper>
             </div>
             <div class="main-popup-input" :class="{ active: doNotShow }">
                 <p @click="closeForDay">오늘 하루동안 열지 않기</p>
                 <p @click="closeNow">닫기</p>
-
             </div>
         </div>
-    </div> -->
+    </div>
 </template>
 
 <script>
@@ -386,9 +385,6 @@
             swiper: null,
             store: useStore(),
             popupList: []
-            // showPopup: true,
-            // doNotShow: false,
-            // doNotShow: this.checkPopup()
         }
     },
     methods: {
@@ -398,10 +394,9 @@
         //     localStorage.setItem('popupClosed', now);
         //     this.doNotShow = true;
         // },
-        // closeNow: function () {
-        //     this.doNotShow = true;
-
-        // },
+        closeNow: function () {
+            this.popupList = [];
+        },
         // checkPopup: function () {
         //     const popupClosedTime = localStorage.getItem('popupClosed');
         //     if (popupClosedTime) {
@@ -416,7 +411,9 @@
         //     return false;
         // },
 
-
+        getFilePath: function (filePath, fileName,fileExt) {
+            return `http://localhost:8080${filePath}/${fileName}.${fileExt}`;
+        },
 
 
         showAlert: function () {
@@ -529,10 +526,10 @@
                         'Content-Type': "application/json; charset=UTF-8",
                     },
                     data: { "page_nm": "공지사항" }
-                }).then(function(){
+                }).then(function () {
                     vm.$router.push({ path: '/NoticeOne.page', query: { 'post_id': item.post_id, 'file_id': item.file_id, 'bbs_id': item.bbs_id } });
                 })
-            
+
             }).catch(function (error) {
                 console.log(error)
                 alert("공지사항 상세보기 오류, 관리자에게 문의바랍니다.");
@@ -540,16 +537,16 @@
         },
 
         /** 사이트 방문자 통계 */
-        visitLogInsert: function() {
+        visitLogInsert: function () {
             const vm = this;
-            console.log("vm.store.state.loginUser   ",vm.store.state.loginUser)
+            console.log("vm.store.state.loginUser   ", vm.store.state.loginUser)
             axios({
                 url: '/statistics/visitLogInsert.json',
                 method: 'post',
                 hearder: {
                     'Content-Type': "application/json; charset=UTF-8",
                 },
-                data: {'user' : vm.store.state.loginUser}
+                data: { 'user': vm.store.state.loginUser }
             })
         },
 
@@ -564,7 +561,7 @@
                 },
             }).then(function (response) {
                 vm.popupList = response.data;
-                console.log("vm.popupList",vm.popupList)
+                console.log("vm.popupList", vm.popupList)
             }).catch(function (error) {
                 alert('팝업 목록 조회 오류, 관리자에게 문의하세요.');
             })
@@ -572,12 +569,6 @@
 
     },
     watch: {
-        doNotShow(newValue) {
-            if (newValue) {
-                this.showPopup = false;
-                localStorage.setItem('doNotShow', true);
-            }
-        }
     },
     computed: {
 
@@ -598,10 +589,6 @@
         this.noticeListForMain();
         this.noticeBannerListForMain();
         this.visitLogInsert();
-        this.initSwiper();
-        if (localStorage.getItem('doNotShow')) {
-            this.showPopup = false;
-        }
     }
 }
 </script>
Add a comment
List