yjryu / KERIS star
Stormen123 2023-11-27
20231127 김성훈 게시글 권한 별 조회 수 통계 추가
@5f52ee99431df0f1669bc5f9dac73321b93640b7
client/views/pages/AppRouter.js
--- client/views/pages/AppRouter.js
+++ client/views/pages/AppRouter.js
@@ -68,7 +68,7 @@
 import AdminNotice from "../pages/admin/statistics/Notice.vue";
 import AdminTech from "../pages/admin/statistics/Tech.vue";
 import AdminWgCommunity from "../pages/admin/statistics/WgCommunity.vue";
-import AdminMatching from "../pages/admin/statistics/matchingStatistics.vue";
+import AdminMatching from "../pages/admin/statistics/MatchingStatistics.vue";
 
 
 const routes = [
client/views/pages/admin/statistics/Data.vue
--- client/views/pages/admin/statistics/Data.vue
+++ client/views/pages/admin/statistics/Data.vue
@@ -3,10 +3,11 @@
         <div class="chart-top">
             <div class="flex">
                 <div class="date-zone flex-start">
-                    <input type="date" name="" id="">
+                    <input type="date" name="" id="" :max="postListSearch.endDate" v-model="postListSearch.startDate">
                     <span>~</span>
-                    <input type="date" name="" id="">
-                    <button class="blue-btn">조회</button>
+                    <input type="date" name="" id="" :min="postListSearch.startDate" :max="oneMonthLater"
+                        v-model="postListSearch.endDate">
+                    <button class="blue-btn" @click="postLogListCheck()">조회</button>
                 </div>
                 <div class="date-check flex-end">
                     <div>
@@ -20,7 +21,7 @@
                 </div>
             </div>
         </div>
-        <BarChart :data="menuVisitData" :mapping="keyMapping" />
+        <BarChart :chartData="postLogListByDate" :mapping="keyMapping" />
         <div class="table-zone">
             <div class="btn-wrap">
                 <button class="blue-border-bnt">Excel 다운로드</button>
@@ -44,8 +45,8 @@
                     </tr>
                 </thead>
                 <tbody>
-                    <tr v-for="(item, index) in menuVisitData" :key="index">
-                        <td>{{ item.date }}</td>
+                    <tr v-for="(item, index) in postLogListByDate" :key="index">
+                        <td>{{ item.post_title }}</td>
                         <td>{{ item.total }}</td>
                         <td>{{ item.company }}</td>
                         <td>{{ item.common }}</td>
@@ -57,8 +58,10 @@
 </template>
  
 <script>
-import BarChart from '../../../component/chart/BarChart.vue'
-
+import axios from 'axios';
+import BarChart from '../../../component/chart/BarChart.vue';
+import COMMON_UTIL from '../../../../resources/js/commonUtil.js';
+import PaginationButton from '../../../component/pagination/PaginationButton.vue';
 
 const App = {
 
@@ -69,65 +72,63 @@
                 company: "기업회원",
                 common: "일반회원",
             },
-            menuVisitData: [
-                {
-                    date: "자료집1",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-
-                }, {
-                    date: "자료집2",
-                    total: 400,
-                    company: 100,
-                    common: 250,
-
-                }, {
-                    date: "자료집3",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-
-                }, {
-                    date: "자료집4",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-                }, {
-                    date: "자료집5",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-                }, {
-                    date: "자료집6",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-                }, {
-                    date: "자료집7",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-                },
-
-            ]
+            postListSearch: {
+                currentPage: 1,
+                perPage: 7,
+                startDate: COMMON_UTIL.oneMonthAgo(COMMON_UTIL.yesterday()),
+                endDate: COMMON_UTIL.yesterday(),
+                bbs_id: '0'
+            },
+            oneMonthLater: COMMON_UTIL.yesterday(),
+            postLogListByDate: [],
         };
     },
     methods: {
+         /** 권한 별 로그인 수 날짜 별 통계 */
+         postLogList: function () {
+            const vm = this;
+            axios({
+                url: '/statistics/postLogListByDate.json',
+                method: 'post',
+                hearder: {
+                    'Content-Type': "application/json; charset=UTF-8",
+                },
+                data: vm.postListSearch
+            }).then(function (response) {
+                vm.postLogListByDate = response.data
+            }).catch(function (error) {
+                console.log("error - ", error)
+                alert("게시글 별 조회수 조회 오류, 관리자에게 문의하세요.");
+            })
+        },
 
+        /**날짜선택 유효성 검사 */
+        postLogListCheck: function() {
+            if(COMMON_UTIL.isEmpty(this.postListSearch.endDate) === false) {
+                alert("날짜를 선택해주세요.");
+            }
+        },
     },
     watch: {
-
+        'postListSearch.startDate': function(newValue) {
+            let date = COMMON_UTIL.oneMonthLater(newValue);
+            this.postListSearch.endDate = null;
+            if(date > COMMON_UTIL.today()) {
+                this.oneMonthLater = COMMON_UTIL.yesterday();
+            } else {
+                this.oneMonthLater = date;
+            }
+        },
     },
     computed: {
 
     },
     components: {
-        'BarChart': BarChart
+        'BarChart': BarChart,
+        PaginationButton: PaginationButton,
     },
     mounted() {
-
-
+        this.postLogList();
     }
 }
 
client/views/pages/admin/statistics/Member.vue
--- client/views/pages/admin/statistics/Member.vue
+++ client/views/pages/admin/statistics/Member.vue
@@ -3,10 +3,11 @@
         <div class="chart-top">
             <div class="flex">
                 <div class="date-zone flex-start">
-                    <input type="date" name="" id="">
+                    <input type="date" name="" id="" :max="loginListSearch.endDate" v-model="loginListSearch.startDate">
                     <span>~</span>
-                    <input type="date" name="" id="">
-                    <button class="blue-btn">조회</button>
+                    <input type="date" name="" id="" :min="loginListSearch.startDate" :max="oneMonthLater"
+                        v-model="loginListSearch.endDate">
+                    <button class="blue-btn" @click="loginLogListCheck()">조회</button>
                 </div>
                 <div class="date-check flex-end">
                     <div>
@@ -42,11 +43,11 @@
                     </tr>
                 </thead>
                 <tbody>
-                    <tr v-for="(item, index) in visitData" :key="index">
-                        <td>{{ item.date }}</td>
-                        <td>{{ item.total_value }}</td>
-                        <td>{{ item.value1 }}</td>
-                        <td>{{ item.value2 }}</td>
+                    <tr v-for="(item, index) in loginLogListByDate" :key="index">
+                        <td>{{ item.stats_date }}</td>
+                        <td>{{ item.total }}</td>
+                        <td>{{ item.cpn_login_cnt }}</td>
+                        <td>{{ item.cmmn_login_cnt }}</td>
                     </tr>
                 </tbody>
             </table>
@@ -55,67 +56,73 @@
 </template>
  
 <script>
+import axios from 'axios';
 import LineChart from '../../../component/chart/LineChart.vue'
+import COMMON_UTIL from '../../../../resources/js/commonUtil.js';
+import PaginationButton from '../../../component/pagination/PaginationButton.vue';
 
 
 const App = {
 
     data() {
         return {
-            visitData: [{
-                date: "2023-11-01",
-                total_value: 100,
-                value1: 50,
-                value2: 48,
-
-            }, {
-                date: "2023-11-02",
-                total_value: 100,
-                value1: 53,
-                value2: 51,
-            }, {
-                date: "2023-11-03",
-                total_value: 100,
-                value1: 56,
-                value2: 58,
-            }, {
-                date: "2023-11-04",
-                total_value: 100,
-                value1: 52,
-                value2: 53,
-            }, {
-                date: "2023-11-05",
-                total_value: 100,
-                value1: 48,
-                value2: 44,
-            }, {
-                date: "2023-11-06",
-                total_value: 100,
-                value1: 47,
-                value2: 42,
-            }, {
-                date: "2023-11-07",
-                total_value: 100,
-                value1: 59,
-                value2: 55,
-            }]
+            loginListSearch: {
+                currentPage: 1,
+                perPage: 7,
+                startDate: COMMON_UTIL.oneMonthAgo(COMMON_UTIL.yesterday()),
+                endDate: COMMON_UTIL.yesterday(),
+                type: 'day'
+            },
+            oneMonthLater: COMMON_UTIL.yesterday(),
+            loginLogListByDate: [],
         };
     },
     methods: {
+         /** 권한 별 로그인 수 날짜 별 통계 */
+         loginLogList: function () {
+            const vm = this;
+            axios({
+                url: '/statistics/loginLogListByDate.json',
+                method: 'post',
+                hearder: {
+                    'Content-Type': "application/json; charset=UTF-8",
+                },
+                data: vm.loginListSearch
+            }).then(function (response) {
+                vm.loginLogListByDate = response.data
+            }).catch(function (error) {
+                console.log("error - ", error)
+                alert("권한별 로그인 수 조회 오류, 관리자에게 문의하세요.");
+            })
+        },
 
+        /**날짜선택 유효성 검사 */
+        loginLogListCheck: function() {
+            if(COMMON_UTIL.isEmpty(this.loginListSearch.endDate) === false) {
+                alert("날짜를 선택해주세요.");
+            }
+        },
     },
     watch: {
-
+        'loginListSearch.startDate': function(newValue) {
+            let date = COMMON_UTIL.oneMonthLater(newValue);
+            this.loginListSearch.endDate = null;
+            if(date > COMMON_UTIL.today()) {
+                this.oneMonthLater = COMMON_UTIL.yesterday();
+            } else {
+                this.oneMonthLater = date;
+            }
+        },
     },
     computed: {
 
     },
     components: {
-        'LineChart': LineChart
+        'LineChart': LineChart,
+        PaginationButton: PaginationButton,
     },
     mounted() {
-
-
+        this.loginLogList();
     }
 }
 
client/views/pages/admin/statistics/NewsAndPr.vue
--- client/views/pages/admin/statistics/NewsAndPr.vue
+++ client/views/pages/admin/statistics/NewsAndPr.vue
@@ -3,10 +3,11 @@
         <div class="chart-top">
             <div class="flex">
                 <div class="date-zone flex-start">
-                    <input type="date" name="" id="">
+                    <input type="date" name="" id="" :max="postListSearch.endDate" v-model="postListSearch.startDate">
                     <span>~</span>
-                    <input type="date" name="" id="">
-                    <button class="blue-btn">조회</button>
+                    <input type="date" name="" id="" :min="postListSearch.startDate" :max="oneMonthLater"
+                        v-model="postListSearch.endDate">
+                    <button class="blue-btn" @click="postLogListCheck()">조회</button>
                 </div>
                 <div class="date-check flex-end">
                     <div>
@@ -20,7 +21,7 @@
                 </div>
             </div>
         </div>
-        <BarChart :data="menuVisitData" :mapping="keyMapping" />
+        <BarChart :chartData="postLogListByDate" :mapping="keyMapping" />
         <div class="table-zone">
             <div class="btn-wrap">
                 <button class="blue-border-bnt">Excel 다운로드</button>
@@ -44,8 +45,8 @@
                     </tr>
                 </thead>
                 <tbody>
-                    <tr v-for="(item, index) in menuVisitData" :key="index">
-                        <td>{{ item.date }}</td>
+                    <tr v-for="(item, index) in postLogListByDate" :key="index">
+                        <td>{{ item.post_title }}</td>
                         <td>{{ item.total }}</td>
                         <td>{{ item.company }}</td>
                         <td>{{ item.common }}</td>
@@ -57,8 +58,10 @@
 </template>
  
 <script>
-import BarChart from '../../../component/chart/BarChart.vue'
-
+import axios from 'axios';
+import BarChart from '../../../component/chart/BarChart.vue';
+import COMMON_UTIL from '../../../../resources/js/commonUtil.js';
+import PaginationButton from '../../../component/pagination/PaginationButton.vue';
 
 const App = {
 
@@ -69,64 +72,63 @@
                 company: "기업회원",
                 common: "일반회원",
             },
-            menuVisitData: [
-                {
-                    date: "홍보&뉴스1",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-
-                }, {
-                    date: "홍보&뉴스2",
-                    total: 400,
-                    company: 100,
-                    common: 250,
-
-                }, {
-                    date: "홍보&뉴스3",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-
-                }, {
-                    date: "홍보&뉴스4",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-                }, {
-                    date: "홍보&뉴스5",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-                }, {
-                    date: "홍보&뉴스6",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-                }, {
-                    date: "홍보&뉴스7",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-                },
-            ]
+            postListSearch: {
+                currentPage: 1,
+                perPage: 7,
+                startDate: COMMON_UTIL.oneMonthAgo(COMMON_UTIL.yesterday()),
+                endDate: COMMON_UTIL.yesterday(),
+                bbs_id: '1'
+            },
+            oneMonthLater: COMMON_UTIL.yesterday(),
+            postLogListByDate: [],
         };
     },
     methods: {
+          /** 권한 별 로그인 수 날짜 별 통계 */
+          postLogList: function () {
+            const vm = this;
+            axios({
+                url: '/statistics/postLogListByDate.json',
+                method: 'post',
+                hearder: {
+                    'Content-Type': "application/json; charset=UTF-8",
+                },
+                data: vm.postListSearch
+            }).then(function (response) {
+                vm.postLogListByDate = response.data
+            }).catch(function (error) {
+                console.log("error - ", error)
+                alert("게시글 별 조회수 조회 오류, 관리자에게 문의하세요.");
+            })
+        },
 
+        /**날짜선택 유효성 검사 */
+        postLogListCheck: function() {
+            if(COMMON_UTIL.isEmpty(this.postListSearch.endDate) === false) {
+                alert("날짜를 선택해주세요.");
+            }
+        },
     },
     watch: {
-
+        'postListSearch.startDate': function(newValue) {
+            let date = COMMON_UTIL.oneMonthLater(newValue);
+            this.postListSearch.endDate = null;
+            if(date > COMMON_UTIL.today()) {
+                this.oneMonthLater = COMMON_UTIL.yesterday();
+            } else {
+                this.oneMonthLater = date;
+            }
+        },
     },
     computed: {
 
     },
     components: {
-        'BarChart': BarChart
+        'BarChart': BarChart,
+        PaginationButton: PaginationButton,
     },
     mounted() {
-
-
+        this.postLogList();
     }
 }
 
client/views/pages/admin/statistics/Notice.vue
--- client/views/pages/admin/statistics/Notice.vue
+++ client/views/pages/admin/statistics/Notice.vue
@@ -3,10 +3,11 @@
         <div class="chart-top">
             <div class="flex">
                 <div class="date-zone flex-start">
-                    <input type="date" name="" id="">
+                    <input type="date" name="" id="" :max="postListSearch.endDate" v-model="postListSearch.startDate">
                     <span>~</span>
-                    <input type="date" name="" id="">
-                    <button class="blue-btn">조회</button>
+                    <input type="date" name="" id="" :min="postListSearch.startDate" :max="oneMonthLater"
+                        v-model="postListSearch.endDate">
+                    <button class="blue-btn" @click="postLogListCheck()">조회</button>
                 </div>
                 <div class="date-check flex-end">
                     <div>
@@ -20,7 +21,7 @@
                 </div>
             </div>
         </div>
-        <BarChart :data="menuVisitData" :mapping="keyMapping" />
+        <BarChart :chartData="postLogListByDate" :mapping="keyMapping" />
         <div class="table-zone">
             <div class="btn-wrap">
                 <button class="blue-border-bnt">Excel 다운로드</button>
@@ -44,8 +45,8 @@
                     </tr>
                 </thead>
                 <tbody>
-                    <tr v-for="(item, index) in menuVisitData" :key="index">
-                        <td>{{ item.date }}</td>
+                    <tr v-for="(item, index) in postLogListByDate" :key="index">
+                        <td>{{ item.post_title }}</td>
                         <td>{{ item.total }}</td>
                         <td>{{ item.company }}</td>
                         <td>{{ item.common }}</td>
@@ -57,8 +58,10 @@
 </template>
  
 <script>
-import BarChart from '../../../component/chart/BarChart.vue'
-
+import axios from 'axios';
+import BarChart from '../../../component/chart/BarChart.vue';
+import COMMON_UTIL from '../../../../resources/js/commonUtil.js';
+import PaginationButton from '../../../component/pagination/PaginationButton.vue';
 
 const App = {
 
@@ -69,65 +72,63 @@
                 company: "기업회원",
                 common: "일반회원",
             },
-            menuVisitData: [
-                {
-                    date: "공지사항1",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-
-                }, {
-                    date: "공지사항2",
-                    total: 400,
-                    company: 100,
-                    common: 250,
-
-                }, {
-                    date: "공지사항3",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-
-                }, {
-                    date: "공지사항4",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-                }, {
-                    date: "공지사항5",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-                }, {
-                    date: "공지사항6",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-                }, {
-                    date: "공지사항7",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-                },
-
-            ]
+            postListSearch: {
+                currentPage: 1,
+                perPage: 7,
+                startDate: COMMON_UTIL.oneMonthAgo(COMMON_UTIL.yesterday()),
+                endDate: COMMON_UTIL.yesterday(),
+                bbs_id: '2'
+            },
+            oneMonthLater: COMMON_UTIL.yesterday(),
+            postLogListByDate: [],
         };
     },
     methods: {
+        /** 권한 별 로그인 수 날짜 별 통계 */
+        postLogList: function () {
+            const vm = this;
+            axios({
+                url: '/statistics/postLogListByDate.json',
+                method: 'post',
+                hearder: {
+                    'Content-Type': "application/json; charset=UTF-8",
+                },
+                data: vm.postListSearch
+            }).then(function (response) {
+                vm.postLogListByDate = response.data
+            }).catch(function (error) {
+                console.log("error - ", error)
+                alert("게시글 별 조회수 조회 오류, 관리자에게 문의하세요.");
+            })
+        },
 
+        /**날짜선택 유효성 검사 */
+        postLogListCheck: function() {
+            if(COMMON_UTIL.isEmpty(this.postListSearch.endDate) === false) {
+                alert("날짜를 선택해주세요.");
+            }
+        },
     },
     watch: {
-
+        'postListSearch.startDate': function(newValue) {
+            let date = COMMON_UTIL.oneMonthLater(newValue);
+            this.postListSearch.endDate = null;
+            if(date > COMMON_UTIL.today()) {
+                this.oneMonthLater = COMMON_UTIL.yesterday();
+            } else {
+                this.oneMonthLater = date;
+            }
+        },
     },
     computed: {
 
     },
     components: {
-        'BarChart': BarChart
+        'BarChart': BarChart,
+        PaginationButton: PaginationButton,
     },
     mounted() {
-
-
+        this.postLogList();
     }
 }
 
client/views/pages/admin/statistics/Tech.vue
--- client/views/pages/admin/statistics/Tech.vue
+++ client/views/pages/admin/statistics/Tech.vue
@@ -3,10 +3,11 @@
         <div class="chart-top">
             <div class="flex">
                 <div class="date-zone flex-start">
-                    <input type="date" name="" id="">
+                    <input type="date" name="" id="" :max="postListSearch.endDate" v-model="postListSearch.startDate">
                     <span>~</span>
-                    <input type="date" name="" id="">
-                    <button class="blue-btn">조회</button>
+                    <input type="date" name="" id="" :min="postListSearch.startDate" :max="oneMonthLater"
+                        v-model="postListSearch.endDate">
+                    <button class="blue-btn" @click="postLogListCheck()">조회</button>
                 </div>
                 <div class="date-check flex-end">
                     <div>
@@ -20,7 +21,7 @@
                 </div>
             </div>
         </div>
-        <BarChart :data="menuVisitData" :mapping="keyMapping" />
+        <BarChart :chartData="postLogListByDate" :mapping="keyMapping" />
         <div class="table-zone">
             <div class="btn-wrap">
                 <button class="blue-border-bnt">Excel 다운로드</button>
@@ -44,8 +45,8 @@
                     </tr>
                 </thead>
                 <tbody>
-                    <tr v-for="(item, index) in menuVisitData" :key="index">
-                        <td>{{ item.date }}</td>
+                    <tr v-for="(item, index) in postLogListByDate" :key="index">
+                        <td>{{ item.post_title }}</td>
                         <td>{{ item.total }}</td>
                         <td>{{ item.company }}</td>
                         <td>{{ item.common }}</td>
@@ -57,7 +58,10 @@
 </template>
  
 <script>
-import BarChart from '../../../component/chart/BarChart.vue'
+import axios from 'axios';
+import BarChart from '../../../component/chart/BarChart.vue';
+import COMMON_UTIL from '../../../../resources/js/commonUtil.js';
+import PaginationButton from '../../../component/pagination/PaginationButton.vue';
 
 
 const App = {
@@ -69,65 +73,64 @@
                 company: "기업회원",
                 common: "일반회원",
             },
-            menuVisitData: [
-                {
-                    date: "기술문서1",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-
-                }, {
-                    date: "기술문서2",
-                    total: 400,
-                    company: 100,
-                    common: 250,
-
-                }, {
-                    date: "기술문서3",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-
-                }, {
-                    date: "기술문서4",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-                }, {
-                    date: "기술문서5",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-                }, {
-                    date: "기술문서6",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-                }, {
-                    date: "기술문서7",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-                },
-
-            ]
+            
+            postListSearch: {
+                currentPage: 1,
+                perPage: 7,
+                startDate: COMMON_UTIL.oneMonthAgo(COMMON_UTIL.yesterday()),
+                endDate: COMMON_UTIL.yesterday(),
+                bbs_id: '3'
+            },
+            oneMonthLater: COMMON_UTIL.yesterday(),
+            postLogListByDate: [],
         };
     },
     methods: {
+        /** 권한 별 로그인 수 날짜 별 통계 */
+        postLogList: function () {
+            const vm = this;
+            axios({
+                url: '/statistics/postLogListByDate.json',
+                method: 'post',
+                hearder: {
+                    'Content-Type': "application/json; charset=UTF-8",
+                },
+                data: vm.postListSearch
+            }).then(function (response) {
+                vm.postLogListByDate = response.data
+            }).catch(function (error) {
+                console.log("error - ", error)
+                alert("게시글 별 조회수 조회 오류, 관리자에게 문의하세요.");
+            })
+        },
 
+        /**날짜선택 유효성 검사 */
+        postLogListCheck: function() {
+            if(COMMON_UTIL.isEmpty(this.postListSearch.endDate) === false) {
+                alert("날짜를 선택해주세요.");
+            }
+        },
     },
     watch: {
-
+        'postListSearch.startDate': function(newValue) {
+            let date = COMMON_UTIL.oneMonthLater(newValue);
+            this.postListSearch.endDate = null;
+            if(date > COMMON_UTIL.today()) {
+                this.oneMonthLater = COMMON_UTIL.yesterday();
+            } else {
+                this.oneMonthLater = date;
+            }
+        },
     },
     computed: {
 
     },
     components: {
-        'BarChart': BarChart
+        'BarChart': BarChart,
+        PaginationButton: PaginationButton,
     },
     mounted() {
-
-
+        this.postLogList();
     }
 }
 
client/views/pages/admin/statistics/Visit.vue
--- client/views/pages/admin/statistics/Visit.vue
+++ client/views/pages/admin/statistics/Visit.vue
@@ -7,7 +7,7 @@
                     <span>~</span>
                     <input type="date" name="" id="" :min="visitListSearch.startDate" :max="oneMonthLater"
                         v-model="visitListSearch.endDate" />
-                    <button class="blue-btn">조회</button>
+                    <button class="blue-btn" @click="visitSelectListCheck()">조회</button>
                 </div>
                 <div class="date-check flex-end">
                     <div>
@@ -106,6 +106,13 @@
                 alert("방문자 수 조회 오류, 관리자에게 문의하세요.");
             })
         },
+        
+        /**날짜선택 유효성 검사 */
+        visitSelectListCheck: function() {
+            if(COMMON_UTIL.isEmpty(this.visitListSearch.endDate) === false) {
+                alert("날짜를 선택해주세요.");
+            }
+        },
     },
     watch: {
         'visitListSearch.startDate': function(newValue) {
@@ -116,6 +123,7 @@
             } else {
                 this.oneMonthLater = date;
             }
+            console.log(this.visitListSearch.endDate)
         },
 
     },
client/views/pages/admin/statistics/WgCommunity.vue
--- client/views/pages/admin/statistics/WgCommunity.vue
+++ client/views/pages/admin/statistics/WgCommunity.vue
@@ -3,10 +3,11 @@
         <div class="chart-top">
             <div class="flex">
                 <div class="date-zone flex-start">
-                    <input type="date" name="" id="">
+                    <input type="date" name="" id="" :max="postListSearch.endDate" v-model="postListSearch.startDate">
                     <span>~</span>
-                    <input type="date" name="" id="">
-                    <button class="blue-btn">조회</button>
+                    <input type="date" name="" id="" :min="postListSearch.startDate" :max="oneMonthLater"
+                        v-model="postListSearch.endDate">
+                    <button class="blue-btn" @click="postLogListCheck()">조회</button>
                 </div>
                 <div class="date-check flex-end">
                     <div>
@@ -20,7 +21,7 @@
                 </div>
             </div>
         </div>
-        <BarChart :data="menuVisitData" :mapping="keyMapping" />
+        <BarChart :chartData="postLogListByDate" :mapping="keyMapping" />
         <div class="table-zone">
             <div class="btn-wrap">
                 <button class="blue-border-bnt">Excel 다운로드</button>
@@ -44,8 +45,8 @@
                     </tr>
                 </thead>
                 <tbody>
-                    <tr v-for="(item, index) in menuVisitData" :key="index">
-                        <td>{{ item.date }}</td>
+                    <tr v-for="(item, index) in postLogListByDate" :key="index">
+                        <td>{{ item.post_title }}</td>
                         <td>{{ item.total }}</td>
                         <td>{{ item.company }}</td>
                         <td>{{ item.common }}</td>
@@ -57,8 +58,10 @@
 </template>
  
 <script>
-import BarChart from '../../../component/chart/BarChart.vue'
-
+import axios from 'axios';
+import BarChart from '../../../component/chart/BarChart.vue';
+import COMMON_UTIL from '../../../../resources/js/commonUtil.js';
+import PaginationButton from '../../../component/pagination/PaginationButton.vue';
 
 const App = {
 
@@ -69,64 +72,63 @@
                 company: "기업회원",
                 common: "일반회원",
             },
-            menuVisitData: [
-                {
-                    date: "전문가협의체1",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-
-                }, {
-                    date: "전문가협의체2",
-                    total: 400,
-                    company: 100,
-                    common: 250,
-
-                }, {
-                    date: "전문가협의체3",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-
-                }, {
-                    date: "전문가협의체4",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-                }, {
-                    date: "전문가협의체5",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-                }, {
-                    date: "전문가협의체6",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-                }, {
-                    date: "전문가협의체7",
-                    total: 100,
-                    company: 250,
-                    common: 210,
-                },
-            ]
+            postListSearch: {
+                currentPage: 1,
+                perPage: 7,
+                startDate: COMMON_UTIL.oneMonthAgo(COMMON_UTIL.yesterday()),
+                endDate: COMMON_UTIL.yesterday(),
+                bbs_id: '4'
+            },
+            oneMonthLater: COMMON_UTIL.yesterday(),
+            postLogListByDate: [],
         };
     },
     methods: {
+         /** 권한 별 로그인 수 날짜 별 통계 */
+         postLogList: function () {
+            const vm = this;
+            axios({
+                url: '/statistics/postLogListByDate.json',
+                method: 'post',
+                hearder: {
+                    'Content-Type': "application/json; charset=UTF-8",
+                },
+                data: vm.postListSearch
+            }).then(function (response) {
+                vm.postLogListByDate = response.data
+            }).catch(function (error) {
+                console.log("error - ", error)
+                alert("게시글 별 조회수 조회 오류, 관리자에게 문의하세요.");
+            })
+        },
 
+        /**날짜선택 유효성 검사 */
+        postLogListCheck: function() {
+            if(COMMON_UTIL.isEmpty(this.postListSearch.endDate) === false) {
+                alert("날짜를 선택해주세요.");
+            }
+        },
     },
     watch: {
-
+        'postListSearch.startDate': function(newValue) {
+            let date = COMMON_UTIL.oneMonthLater(newValue);
+            this.postListSearch.endDate = null;
+            if(date > COMMON_UTIL.today()) {
+                this.oneMonthLater = COMMON_UTIL.yesterday();
+            } else {
+                this.oneMonthLater = date;
+            }
+        },
     },
     computed: {
 
     },
     components: {
-        'BarChart': BarChart
+        'BarChart': BarChart,
+        PaginationButton: PaginationButton,
     },
     mounted() {
-
-
+        this.postLogList();
     }
 }
 
Add a comment
List