

20231127 김성훈 게시글 권한 별 조회 수 통계 추가
@5f52ee99431df0f1669bc5f9dac73321b93640b7
--- client/views/pages/AppRouter.js
+++ client/views/pages/AppRouter.js
... | ... | @@ -68,7 +68,7 @@ |
68 | 68 |
import AdminNotice from "../pages/admin/statistics/Notice.vue"; |
69 | 69 |
import AdminTech from "../pages/admin/statistics/Tech.vue"; |
70 | 70 |
import AdminWgCommunity from "../pages/admin/statistics/WgCommunity.vue"; |
71 |
-import AdminMatching from "../pages/admin/statistics/matchingStatistics.vue"; |
|
71 |
+import AdminMatching from "../pages/admin/statistics/MatchingStatistics.vue"; |
|
72 | 72 |
|
73 | 73 |
|
74 | 74 |
const routes = [ |
--- client/views/pages/admin/statistics/Data.vue
+++ client/views/pages/admin/statistics/Data.vue
... | ... | @@ -3,10 +3,11 @@ |
3 | 3 |
<div class="chart-top"> |
4 | 4 |
<div class="flex"> |
5 | 5 |
<div class="date-zone flex-start"> |
6 |
- <input type="date" name="" id=""> |
|
6 |
+ <input type="date" name="" id="" :max="postListSearch.endDate" v-model="postListSearch.startDate"> |
|
7 | 7 |
<span>~</span> |
8 |
- <input type="date" name="" id=""> |
|
9 |
- <button class="blue-btn">조회</button> |
|
8 |
+ <input type="date" name="" id="" :min="postListSearch.startDate" :max="oneMonthLater" |
|
9 |
+ v-model="postListSearch.endDate"> |
|
10 |
+ <button class="blue-btn" @click="postLogListCheck()">조회</button> |
|
10 | 11 |
</div> |
11 | 12 |
<div class="date-check flex-end"> |
12 | 13 |
<div> |
... | ... | @@ -20,7 +21,7 @@ |
20 | 21 |
</div> |
21 | 22 |
</div> |
22 | 23 |
</div> |
23 |
- <BarChart :data="menuVisitData" :mapping="keyMapping" /> |
|
24 |
+ <BarChart :chartData="postLogListByDate" :mapping="keyMapping" /> |
|
24 | 25 |
<div class="table-zone"> |
25 | 26 |
<div class="btn-wrap"> |
26 | 27 |
<button class="blue-border-bnt">Excel 다운로드</button> |
... | ... | @@ -44,8 +45,8 @@ |
44 | 45 |
</tr> |
45 | 46 |
</thead> |
46 | 47 |
<tbody> |
47 |
- <tr v-for="(item, index) in menuVisitData" :key="index"> |
|
48 |
- <td>{{ item.date }}</td> |
|
48 |
+ <tr v-for="(item, index) in postLogListByDate" :key="index"> |
|
49 |
+ <td>{{ item.post_title }}</td> |
|
49 | 50 |
<td>{{ item.total }}</td> |
50 | 51 |
<td>{{ item.company }}</td> |
51 | 52 |
<td>{{ item.common }}</td> |
... | ... | @@ -57,8 +58,10 @@ |
57 | 58 |
</template> |
58 | 59 |
|
59 | 60 |
<script> |
60 |
-import BarChart from '../../../component/chart/BarChart.vue' |
|
61 |
- |
|
61 |
+import axios from 'axios'; |
|
62 |
+import BarChart from '../../../component/chart/BarChart.vue'; |
|
63 |
+import COMMON_UTIL from '../../../../resources/js/commonUtil.js'; |
|
64 |
+import PaginationButton from '../../../component/pagination/PaginationButton.vue'; |
|
62 | 65 |
|
63 | 66 |
const App = { |
64 | 67 |
|
... | ... | @@ -69,65 +72,63 @@ |
69 | 72 |
company: "기업회원", |
70 | 73 |
common: "일반회원", |
71 | 74 |
}, |
72 |
- menuVisitData: [ |
|
73 |
- { |
|
74 |
- date: "자료집1", |
|
75 |
- total: 100, |
|
76 |
- company: 250, |
|
77 |
- common: 210, |
|
78 |
- |
|
79 |
- }, { |
|
80 |
- date: "자료집2", |
|
81 |
- total: 400, |
|
82 |
- company: 100, |
|
83 |
- common: 250, |
|
84 |
- |
|
85 |
- }, { |
|
86 |
- date: "자료집3", |
|
87 |
- total: 100, |
|
88 |
- company: 250, |
|
89 |
- common: 210, |
|
90 |
- |
|
91 |
- }, { |
|
92 |
- date: "자료집4", |
|
93 |
- total: 100, |
|
94 |
- company: 250, |
|
95 |
- common: 210, |
|
96 |
- }, { |
|
97 |
- date: "자료집5", |
|
98 |
- total: 100, |
|
99 |
- company: 250, |
|
100 |
- common: 210, |
|
101 |
- }, { |
|
102 |
- date: "자료집6", |
|
103 |
- total: 100, |
|
104 |
- company: 250, |
|
105 |
- common: 210, |
|
106 |
- }, { |
|
107 |
- date: "자료집7", |
|
108 |
- total: 100, |
|
109 |
- company: 250, |
|
110 |
- common: 210, |
|
111 |
- }, |
|
112 |
- |
|
113 |
- ] |
|
75 |
+ postListSearch: { |
|
76 |
+ currentPage: 1, |
|
77 |
+ perPage: 7, |
|
78 |
+ startDate: COMMON_UTIL.oneMonthAgo(COMMON_UTIL.yesterday()), |
|
79 |
+ endDate: COMMON_UTIL.yesterday(), |
|
80 |
+ bbs_id: '0' |
|
81 |
+ }, |
|
82 |
+ oneMonthLater: COMMON_UTIL.yesterday(), |
|
83 |
+ postLogListByDate: [], |
|
114 | 84 |
}; |
115 | 85 |
}, |
116 | 86 |
methods: { |
87 |
+ /** 권한 별 로그인 수 날짜 별 통계 */ |
|
88 |
+ postLogList: function () { |
|
89 |
+ const vm = this; |
|
90 |
+ axios({ |
|
91 |
+ url: '/statistics/postLogListByDate.json', |
|
92 |
+ method: 'post', |
|
93 |
+ hearder: { |
|
94 |
+ 'Content-Type': "application/json; charset=UTF-8", |
|
95 |
+ }, |
|
96 |
+ data: vm.postListSearch |
|
97 |
+ }).then(function (response) { |
|
98 |
+ vm.postLogListByDate = response.data |
|
99 |
+ }).catch(function (error) { |
|
100 |
+ console.log("error - ", error) |
|
101 |
+ alert("게시글 별 조회수 조회 오류, 관리자에게 문의하세요."); |
|
102 |
+ }) |
|
103 |
+ }, |
|
117 | 104 |
|
105 |
+ /**날짜선택 유효성 검사 */ |
|
106 |
+ postLogListCheck: function() { |
|
107 |
+ if(COMMON_UTIL.isEmpty(this.postListSearch.endDate) === false) { |
|
108 |
+ alert("날짜를 선택해주세요."); |
|
109 |
+ } |
|
110 |
+ }, |
|
118 | 111 |
}, |
119 | 112 |
watch: { |
120 |
- |
|
113 |
+ 'postListSearch.startDate': function(newValue) { |
|
114 |
+ let date = COMMON_UTIL.oneMonthLater(newValue); |
|
115 |
+ this.postListSearch.endDate = null; |
|
116 |
+ if(date > COMMON_UTIL.today()) { |
|
117 |
+ this.oneMonthLater = COMMON_UTIL.yesterday(); |
|
118 |
+ } else { |
|
119 |
+ this.oneMonthLater = date; |
|
120 |
+ } |
|
121 |
+ }, |
|
121 | 122 |
}, |
122 | 123 |
computed: { |
123 | 124 |
|
124 | 125 |
}, |
125 | 126 |
components: { |
126 |
- 'BarChart': BarChart |
|
127 |
+ 'BarChart': BarChart, |
|
128 |
+ PaginationButton: PaginationButton, |
|
127 | 129 |
}, |
128 | 130 |
mounted() { |
129 |
- |
|
130 |
- |
|
131 |
+ this.postLogList(); |
|
131 | 132 |
} |
132 | 133 |
} |
133 | 134 |
|
--- client/views/pages/admin/statistics/Member.vue
+++ client/views/pages/admin/statistics/Member.vue
... | ... | @@ -3,10 +3,11 @@ |
3 | 3 |
<div class="chart-top"> |
4 | 4 |
<div class="flex"> |
5 | 5 |
<div class="date-zone flex-start"> |
6 |
- <input type="date" name="" id=""> |
|
6 |
+ <input type="date" name="" id="" :max="loginListSearch.endDate" v-model="loginListSearch.startDate"> |
|
7 | 7 |
<span>~</span> |
8 |
- <input type="date" name="" id=""> |
|
9 |
- <button class="blue-btn">조회</button> |
|
8 |
+ <input type="date" name="" id="" :min="loginListSearch.startDate" :max="oneMonthLater" |
|
9 |
+ v-model="loginListSearch.endDate"> |
|
10 |
+ <button class="blue-btn" @click="loginLogListCheck()">조회</button> |
|
10 | 11 |
</div> |
11 | 12 |
<div class="date-check flex-end"> |
12 | 13 |
<div> |
... | ... | @@ -42,11 +43,11 @@ |
42 | 43 |
</tr> |
43 | 44 |
</thead> |
44 | 45 |
<tbody> |
45 |
- <tr v-for="(item, index) in visitData" :key="index"> |
|
46 |
- <td>{{ item.date }}</td> |
|
47 |
- <td>{{ item.total_value }}</td> |
|
48 |
- <td>{{ item.value1 }}</td> |
|
49 |
- <td>{{ item.value2 }}</td> |
|
46 |
+ <tr v-for="(item, index) in loginLogListByDate" :key="index"> |
|
47 |
+ <td>{{ item.stats_date }}</td> |
|
48 |
+ <td>{{ item.total }}</td> |
|
49 |
+ <td>{{ item.cpn_login_cnt }}</td> |
|
50 |
+ <td>{{ item.cmmn_login_cnt }}</td> |
|
50 | 51 |
</tr> |
51 | 52 |
</tbody> |
52 | 53 |
</table> |
... | ... | @@ -55,67 +56,73 @@ |
55 | 56 |
</template> |
56 | 57 |
|
57 | 58 |
<script> |
59 |
+import axios from 'axios'; |
|
58 | 60 |
import LineChart from '../../../component/chart/LineChart.vue' |
61 |
+import COMMON_UTIL from '../../../../resources/js/commonUtil.js'; |
|
62 |
+import PaginationButton from '../../../component/pagination/PaginationButton.vue'; |
|
59 | 63 |
|
60 | 64 |
|
61 | 65 |
const App = { |
62 | 66 |
|
63 | 67 |
data() { |
64 | 68 |
return { |
65 |
- visitData: [{ |
|
66 |
- date: "2023-11-01", |
|
67 |
- total_value: 100, |
|
68 |
- value1: 50, |
|
69 |
- value2: 48, |
|
70 |
- |
|
71 |
- }, { |
|
72 |
- date: "2023-11-02", |
|
73 |
- total_value: 100, |
|
74 |
- value1: 53, |
|
75 |
- value2: 51, |
|
76 |
- }, { |
|
77 |
- date: "2023-11-03", |
|
78 |
- total_value: 100, |
|
79 |
- value1: 56, |
|
80 |
- value2: 58, |
|
81 |
- }, { |
|
82 |
- date: "2023-11-04", |
|
83 |
- total_value: 100, |
|
84 |
- value1: 52, |
|
85 |
- value2: 53, |
|
86 |
- }, { |
|
87 |
- date: "2023-11-05", |
|
88 |
- total_value: 100, |
|
89 |
- value1: 48, |
|
90 |
- value2: 44, |
|
91 |
- }, { |
|
92 |
- date: "2023-11-06", |
|
93 |
- total_value: 100, |
|
94 |
- value1: 47, |
|
95 |
- value2: 42, |
|
96 |
- }, { |
|
97 |
- date: "2023-11-07", |
|
98 |
- total_value: 100, |
|
99 |
- value1: 59, |
|
100 |
- value2: 55, |
|
101 |
- }] |
|
69 |
+ loginListSearch: { |
|
70 |
+ currentPage: 1, |
|
71 |
+ perPage: 7, |
|
72 |
+ startDate: COMMON_UTIL.oneMonthAgo(COMMON_UTIL.yesterday()), |
|
73 |
+ endDate: COMMON_UTIL.yesterday(), |
|
74 |
+ type: 'day' |
|
75 |
+ }, |
|
76 |
+ oneMonthLater: COMMON_UTIL.yesterday(), |
|
77 |
+ loginLogListByDate: [], |
|
102 | 78 |
}; |
103 | 79 |
}, |
104 | 80 |
methods: { |
81 |
+ /** 권한 별 로그인 수 날짜 별 통계 */ |
|
82 |
+ loginLogList: function () { |
|
83 |
+ const vm = this; |
|
84 |
+ axios({ |
|
85 |
+ url: '/statistics/loginLogListByDate.json', |
|
86 |
+ method: 'post', |
|
87 |
+ hearder: { |
|
88 |
+ 'Content-Type': "application/json; charset=UTF-8", |
|
89 |
+ }, |
|
90 |
+ data: vm.loginListSearch |
|
91 |
+ }).then(function (response) { |
|
92 |
+ vm.loginLogListByDate = response.data |
|
93 |
+ }).catch(function (error) { |
|
94 |
+ console.log("error - ", error) |
|
95 |
+ alert("권한별 로그인 수 조회 오류, 관리자에게 문의하세요."); |
|
96 |
+ }) |
|
97 |
+ }, |
|
105 | 98 |
|
99 |
+ /**날짜선택 유효성 검사 */ |
|
100 |
+ loginLogListCheck: function() { |
|
101 |
+ if(COMMON_UTIL.isEmpty(this.loginListSearch.endDate) === false) { |
|
102 |
+ alert("날짜를 선택해주세요."); |
|
103 |
+ } |
|
104 |
+ }, |
|
106 | 105 |
}, |
107 | 106 |
watch: { |
108 |
- |
|
107 |
+ 'loginListSearch.startDate': function(newValue) { |
|
108 |
+ let date = COMMON_UTIL.oneMonthLater(newValue); |
|
109 |
+ this.loginListSearch.endDate = null; |
|
110 |
+ if(date > COMMON_UTIL.today()) { |
|
111 |
+ this.oneMonthLater = COMMON_UTIL.yesterday(); |
|
112 |
+ } else { |
|
113 |
+ this.oneMonthLater = date; |
|
114 |
+ } |
|
115 |
+ }, |
|
109 | 116 |
}, |
110 | 117 |
computed: { |
111 | 118 |
|
112 | 119 |
}, |
113 | 120 |
components: { |
114 |
- 'LineChart': LineChart |
|
121 |
+ 'LineChart': LineChart, |
|
122 |
+ PaginationButton: PaginationButton, |
|
115 | 123 |
}, |
116 | 124 |
mounted() { |
117 |
- |
|
118 |
- |
|
125 |
+ this.loginLogList(); |
|
119 | 126 |
} |
120 | 127 |
} |
121 | 128 |
|
--- client/views/pages/admin/statistics/NewsAndPr.vue
+++ client/views/pages/admin/statistics/NewsAndPr.vue
... | ... | @@ -3,10 +3,11 @@ |
3 | 3 |
<div class="chart-top"> |
4 | 4 |
<div class="flex"> |
5 | 5 |
<div class="date-zone flex-start"> |
6 |
- <input type="date" name="" id=""> |
|
6 |
+ <input type="date" name="" id="" :max="postListSearch.endDate" v-model="postListSearch.startDate"> |
|
7 | 7 |
<span>~</span> |
8 |
- <input type="date" name="" id=""> |
|
9 |
- <button class="blue-btn">조회</button> |
|
8 |
+ <input type="date" name="" id="" :min="postListSearch.startDate" :max="oneMonthLater" |
|
9 |
+ v-model="postListSearch.endDate"> |
|
10 |
+ <button class="blue-btn" @click="postLogListCheck()">조회</button> |
|
10 | 11 |
</div> |
11 | 12 |
<div class="date-check flex-end"> |
12 | 13 |
<div> |
... | ... | @@ -20,7 +21,7 @@ |
20 | 21 |
</div> |
21 | 22 |
</div> |
22 | 23 |
</div> |
23 |
- <BarChart :data="menuVisitData" :mapping="keyMapping" /> |
|
24 |
+ <BarChart :chartData="postLogListByDate" :mapping="keyMapping" /> |
|
24 | 25 |
<div class="table-zone"> |
25 | 26 |
<div class="btn-wrap"> |
26 | 27 |
<button class="blue-border-bnt">Excel 다운로드</button> |
... | ... | @@ -44,8 +45,8 @@ |
44 | 45 |
</tr> |
45 | 46 |
</thead> |
46 | 47 |
<tbody> |
47 |
- <tr v-for="(item, index) in menuVisitData" :key="index"> |
|
48 |
- <td>{{ item.date }}</td> |
|
48 |
+ <tr v-for="(item, index) in postLogListByDate" :key="index"> |
|
49 |
+ <td>{{ item.post_title }}</td> |
|
49 | 50 |
<td>{{ item.total }}</td> |
50 | 51 |
<td>{{ item.company }}</td> |
51 | 52 |
<td>{{ item.common }}</td> |
... | ... | @@ -57,8 +58,10 @@ |
57 | 58 |
</template> |
58 | 59 |
|
59 | 60 |
<script> |
60 |
-import BarChart from '../../../component/chart/BarChart.vue' |
|
61 |
- |
|
61 |
+import axios from 'axios'; |
|
62 |
+import BarChart from '../../../component/chart/BarChart.vue'; |
|
63 |
+import COMMON_UTIL from '../../../../resources/js/commonUtil.js'; |
|
64 |
+import PaginationButton from '../../../component/pagination/PaginationButton.vue'; |
|
62 | 65 |
|
63 | 66 |
const App = { |
64 | 67 |
|
... | ... | @@ -69,64 +72,63 @@ |
69 | 72 |
company: "기업회원", |
70 | 73 |
common: "일반회원", |
71 | 74 |
}, |
72 |
- menuVisitData: [ |
|
73 |
- { |
|
74 |
- date: "홍보&뉴스1", |
|
75 |
- total: 100, |
|
76 |
- company: 250, |
|
77 |
- common: 210, |
|
78 |
- |
|
79 |
- }, { |
|
80 |
- date: "홍보&뉴스2", |
|
81 |
- total: 400, |
|
82 |
- company: 100, |
|
83 |
- common: 250, |
|
84 |
- |
|
85 |
- }, { |
|
86 |
- date: "홍보&뉴스3", |
|
87 |
- total: 100, |
|
88 |
- company: 250, |
|
89 |
- common: 210, |
|
90 |
- |
|
91 |
- }, { |
|
92 |
- date: "홍보&뉴스4", |
|
93 |
- total: 100, |
|
94 |
- company: 250, |
|
95 |
- common: 210, |
|
96 |
- }, { |
|
97 |
- date: "홍보&뉴스5", |
|
98 |
- total: 100, |
|
99 |
- company: 250, |
|
100 |
- common: 210, |
|
101 |
- }, { |
|
102 |
- date: "홍보&뉴스6", |
|
103 |
- total: 100, |
|
104 |
- company: 250, |
|
105 |
- common: 210, |
|
106 |
- }, { |
|
107 |
- date: "홍보&뉴스7", |
|
108 |
- total: 100, |
|
109 |
- company: 250, |
|
110 |
- common: 210, |
|
111 |
- }, |
|
112 |
- ] |
|
75 |
+ postListSearch: { |
|
76 |
+ currentPage: 1, |
|
77 |
+ perPage: 7, |
|
78 |
+ startDate: COMMON_UTIL.oneMonthAgo(COMMON_UTIL.yesterday()), |
|
79 |
+ endDate: COMMON_UTIL.yesterday(), |
|
80 |
+ bbs_id: '1' |
|
81 |
+ }, |
|
82 |
+ oneMonthLater: COMMON_UTIL.yesterday(), |
|
83 |
+ postLogListByDate: [], |
|
113 | 84 |
}; |
114 | 85 |
}, |
115 | 86 |
methods: { |
87 |
+ /** 권한 별 로그인 수 날짜 별 통계 */ |
|
88 |
+ postLogList: function () { |
|
89 |
+ const vm = this; |
|
90 |
+ axios({ |
|
91 |
+ url: '/statistics/postLogListByDate.json', |
|
92 |
+ method: 'post', |
|
93 |
+ hearder: { |
|
94 |
+ 'Content-Type': "application/json; charset=UTF-8", |
|
95 |
+ }, |
|
96 |
+ data: vm.postListSearch |
|
97 |
+ }).then(function (response) { |
|
98 |
+ vm.postLogListByDate = response.data |
|
99 |
+ }).catch(function (error) { |
|
100 |
+ console.log("error - ", error) |
|
101 |
+ alert("게시글 별 조회수 조회 오류, 관리자에게 문의하세요."); |
|
102 |
+ }) |
|
103 |
+ }, |
|
116 | 104 |
|
105 |
+ /**날짜선택 유효성 검사 */ |
|
106 |
+ postLogListCheck: function() { |
|
107 |
+ if(COMMON_UTIL.isEmpty(this.postListSearch.endDate) === false) { |
|
108 |
+ alert("날짜를 선택해주세요."); |
|
109 |
+ } |
|
110 |
+ }, |
|
117 | 111 |
}, |
118 | 112 |
watch: { |
119 |
- |
|
113 |
+ 'postListSearch.startDate': function(newValue) { |
|
114 |
+ let date = COMMON_UTIL.oneMonthLater(newValue); |
|
115 |
+ this.postListSearch.endDate = null; |
|
116 |
+ if(date > COMMON_UTIL.today()) { |
|
117 |
+ this.oneMonthLater = COMMON_UTIL.yesterday(); |
|
118 |
+ } else { |
|
119 |
+ this.oneMonthLater = date; |
|
120 |
+ } |
|
121 |
+ }, |
|
120 | 122 |
}, |
121 | 123 |
computed: { |
122 | 124 |
|
123 | 125 |
}, |
124 | 126 |
components: { |
125 |
- 'BarChart': BarChart |
|
127 |
+ 'BarChart': BarChart, |
|
128 |
+ PaginationButton: PaginationButton, |
|
126 | 129 |
}, |
127 | 130 |
mounted() { |
128 |
- |
|
129 |
- |
|
131 |
+ this.postLogList(); |
|
130 | 132 |
} |
131 | 133 |
} |
132 | 134 |
|
--- client/views/pages/admin/statistics/Notice.vue
+++ client/views/pages/admin/statistics/Notice.vue
... | ... | @@ -3,10 +3,11 @@ |
3 | 3 |
<div class="chart-top"> |
4 | 4 |
<div class="flex"> |
5 | 5 |
<div class="date-zone flex-start"> |
6 |
- <input type="date" name="" id=""> |
|
6 |
+ <input type="date" name="" id="" :max="postListSearch.endDate" v-model="postListSearch.startDate"> |
|
7 | 7 |
<span>~</span> |
8 |
- <input type="date" name="" id=""> |
|
9 |
- <button class="blue-btn">조회</button> |
|
8 |
+ <input type="date" name="" id="" :min="postListSearch.startDate" :max="oneMonthLater" |
|
9 |
+ v-model="postListSearch.endDate"> |
|
10 |
+ <button class="blue-btn" @click="postLogListCheck()">조회</button> |
|
10 | 11 |
</div> |
11 | 12 |
<div class="date-check flex-end"> |
12 | 13 |
<div> |
... | ... | @@ -20,7 +21,7 @@ |
20 | 21 |
</div> |
21 | 22 |
</div> |
22 | 23 |
</div> |
23 |
- <BarChart :data="menuVisitData" :mapping="keyMapping" /> |
|
24 |
+ <BarChart :chartData="postLogListByDate" :mapping="keyMapping" /> |
|
24 | 25 |
<div class="table-zone"> |
25 | 26 |
<div class="btn-wrap"> |
26 | 27 |
<button class="blue-border-bnt">Excel 다운로드</button> |
... | ... | @@ -44,8 +45,8 @@ |
44 | 45 |
</tr> |
45 | 46 |
</thead> |
46 | 47 |
<tbody> |
47 |
- <tr v-for="(item, index) in menuVisitData" :key="index"> |
|
48 |
- <td>{{ item.date }}</td> |
|
48 |
+ <tr v-for="(item, index) in postLogListByDate" :key="index"> |
|
49 |
+ <td>{{ item.post_title }}</td> |
|
49 | 50 |
<td>{{ item.total }}</td> |
50 | 51 |
<td>{{ item.company }}</td> |
51 | 52 |
<td>{{ item.common }}</td> |
... | ... | @@ -57,8 +58,10 @@ |
57 | 58 |
</template> |
58 | 59 |
|
59 | 60 |
<script> |
60 |
-import BarChart from '../../../component/chart/BarChart.vue' |
|
61 |
- |
|
61 |
+import axios from 'axios'; |
|
62 |
+import BarChart from '../../../component/chart/BarChart.vue'; |
|
63 |
+import COMMON_UTIL from '../../../../resources/js/commonUtil.js'; |
|
64 |
+import PaginationButton from '../../../component/pagination/PaginationButton.vue'; |
|
62 | 65 |
|
63 | 66 |
const App = { |
64 | 67 |
|
... | ... | @@ -69,65 +72,63 @@ |
69 | 72 |
company: "기업회원", |
70 | 73 |
common: "일반회원", |
71 | 74 |
}, |
72 |
- menuVisitData: [ |
|
73 |
- { |
|
74 |
- date: "공지사항1", |
|
75 |
- total: 100, |
|
76 |
- company: 250, |
|
77 |
- common: 210, |
|
78 |
- |
|
79 |
- }, { |
|
80 |
- date: "공지사항2", |
|
81 |
- total: 400, |
|
82 |
- company: 100, |
|
83 |
- common: 250, |
|
84 |
- |
|
85 |
- }, { |
|
86 |
- date: "공지사항3", |
|
87 |
- total: 100, |
|
88 |
- company: 250, |
|
89 |
- common: 210, |
|
90 |
- |
|
91 |
- }, { |
|
92 |
- date: "공지사항4", |
|
93 |
- total: 100, |
|
94 |
- company: 250, |
|
95 |
- common: 210, |
|
96 |
- }, { |
|
97 |
- date: "공지사항5", |
|
98 |
- total: 100, |
|
99 |
- company: 250, |
|
100 |
- common: 210, |
|
101 |
- }, { |
|
102 |
- date: "공지사항6", |
|
103 |
- total: 100, |
|
104 |
- company: 250, |
|
105 |
- common: 210, |
|
106 |
- }, { |
|
107 |
- date: "공지사항7", |
|
108 |
- total: 100, |
|
109 |
- company: 250, |
|
110 |
- common: 210, |
|
111 |
- }, |
|
112 |
- |
|
113 |
- ] |
|
75 |
+ postListSearch: { |
|
76 |
+ currentPage: 1, |
|
77 |
+ perPage: 7, |
|
78 |
+ startDate: COMMON_UTIL.oneMonthAgo(COMMON_UTIL.yesterday()), |
|
79 |
+ endDate: COMMON_UTIL.yesterday(), |
|
80 |
+ bbs_id: '2' |
|
81 |
+ }, |
|
82 |
+ oneMonthLater: COMMON_UTIL.yesterday(), |
|
83 |
+ postLogListByDate: [], |
|
114 | 84 |
}; |
115 | 85 |
}, |
116 | 86 |
methods: { |
87 |
+ /** 권한 별 로그인 수 날짜 별 통계 */ |
|
88 |
+ postLogList: function () { |
|
89 |
+ const vm = this; |
|
90 |
+ axios({ |
|
91 |
+ url: '/statistics/postLogListByDate.json', |
|
92 |
+ method: 'post', |
|
93 |
+ hearder: { |
|
94 |
+ 'Content-Type': "application/json; charset=UTF-8", |
|
95 |
+ }, |
|
96 |
+ data: vm.postListSearch |
|
97 |
+ }).then(function (response) { |
|
98 |
+ vm.postLogListByDate = response.data |
|
99 |
+ }).catch(function (error) { |
|
100 |
+ console.log("error - ", error) |
|
101 |
+ alert("게시글 별 조회수 조회 오류, 관리자에게 문의하세요."); |
|
102 |
+ }) |
|
103 |
+ }, |
|
117 | 104 |
|
105 |
+ /**날짜선택 유효성 검사 */ |
|
106 |
+ postLogListCheck: function() { |
|
107 |
+ if(COMMON_UTIL.isEmpty(this.postListSearch.endDate) === false) { |
|
108 |
+ alert("날짜를 선택해주세요."); |
|
109 |
+ } |
|
110 |
+ }, |
|
118 | 111 |
}, |
119 | 112 |
watch: { |
120 |
- |
|
113 |
+ 'postListSearch.startDate': function(newValue) { |
|
114 |
+ let date = COMMON_UTIL.oneMonthLater(newValue); |
|
115 |
+ this.postListSearch.endDate = null; |
|
116 |
+ if(date > COMMON_UTIL.today()) { |
|
117 |
+ this.oneMonthLater = COMMON_UTIL.yesterday(); |
|
118 |
+ } else { |
|
119 |
+ this.oneMonthLater = date; |
|
120 |
+ } |
|
121 |
+ }, |
|
121 | 122 |
}, |
122 | 123 |
computed: { |
123 | 124 |
|
124 | 125 |
}, |
125 | 126 |
components: { |
126 |
- 'BarChart': BarChart |
|
127 |
+ 'BarChart': BarChart, |
|
128 |
+ PaginationButton: PaginationButton, |
|
127 | 129 |
}, |
128 | 130 |
mounted() { |
129 |
- |
|
130 |
- |
|
131 |
+ this.postLogList(); |
|
131 | 132 |
} |
132 | 133 |
} |
133 | 134 |
|
--- client/views/pages/admin/statistics/Tech.vue
+++ client/views/pages/admin/statistics/Tech.vue
... | ... | @@ -3,10 +3,11 @@ |
3 | 3 |
<div class="chart-top"> |
4 | 4 |
<div class="flex"> |
5 | 5 |
<div class="date-zone flex-start"> |
6 |
- <input type="date" name="" id=""> |
|
6 |
+ <input type="date" name="" id="" :max="postListSearch.endDate" v-model="postListSearch.startDate"> |
|
7 | 7 |
<span>~</span> |
8 |
- <input type="date" name="" id=""> |
|
9 |
- <button class="blue-btn">조회</button> |
|
8 |
+ <input type="date" name="" id="" :min="postListSearch.startDate" :max="oneMonthLater" |
|
9 |
+ v-model="postListSearch.endDate"> |
|
10 |
+ <button class="blue-btn" @click="postLogListCheck()">조회</button> |
|
10 | 11 |
</div> |
11 | 12 |
<div class="date-check flex-end"> |
12 | 13 |
<div> |
... | ... | @@ -20,7 +21,7 @@ |
20 | 21 |
</div> |
21 | 22 |
</div> |
22 | 23 |
</div> |
23 |
- <BarChart :data="menuVisitData" :mapping="keyMapping" /> |
|
24 |
+ <BarChart :chartData="postLogListByDate" :mapping="keyMapping" /> |
|
24 | 25 |
<div class="table-zone"> |
25 | 26 |
<div class="btn-wrap"> |
26 | 27 |
<button class="blue-border-bnt">Excel 다운로드</button> |
... | ... | @@ -44,8 +45,8 @@ |
44 | 45 |
</tr> |
45 | 46 |
</thead> |
46 | 47 |
<tbody> |
47 |
- <tr v-for="(item, index) in menuVisitData" :key="index"> |
|
48 |
- <td>{{ item.date }}</td> |
|
48 |
+ <tr v-for="(item, index) in postLogListByDate" :key="index"> |
|
49 |
+ <td>{{ item.post_title }}</td> |
|
49 | 50 |
<td>{{ item.total }}</td> |
50 | 51 |
<td>{{ item.company }}</td> |
51 | 52 |
<td>{{ item.common }}</td> |
... | ... | @@ -57,7 +58,10 @@ |
57 | 58 |
</template> |
58 | 59 |
|
59 | 60 |
<script> |
60 |
-import BarChart from '../../../component/chart/BarChart.vue' |
|
61 |
+import axios from 'axios'; |
|
62 |
+import BarChart from '../../../component/chart/BarChart.vue'; |
|
63 |
+import COMMON_UTIL from '../../../../resources/js/commonUtil.js'; |
|
64 |
+import PaginationButton from '../../../component/pagination/PaginationButton.vue'; |
|
61 | 65 |
|
62 | 66 |
|
63 | 67 |
const App = { |
... | ... | @@ -69,65 +73,64 @@ |
69 | 73 |
company: "기업회원", |
70 | 74 |
common: "일반회원", |
71 | 75 |
}, |
72 |
- menuVisitData: [ |
|
73 |
- { |
|
74 |
- date: "기술문서1", |
|
75 |
- total: 100, |
|
76 |
- company: 250, |
|
77 |
- common: 210, |
|
78 |
- |
|
79 |
- }, { |
|
80 |
- date: "기술문서2", |
|
81 |
- total: 400, |
|
82 |
- company: 100, |
|
83 |
- common: 250, |
|
84 |
- |
|
85 |
- }, { |
|
86 |
- date: "기술문서3", |
|
87 |
- total: 100, |
|
88 |
- company: 250, |
|
89 |
- common: 210, |
|
90 |
- |
|
91 |
- }, { |
|
92 |
- date: "기술문서4", |
|
93 |
- total: 100, |
|
94 |
- company: 250, |
|
95 |
- common: 210, |
|
96 |
- }, { |
|
97 |
- date: "기술문서5", |
|
98 |
- total: 100, |
|
99 |
- company: 250, |
|
100 |
- common: 210, |
|
101 |
- }, { |
|
102 |
- date: "기술문서6", |
|
103 |
- total: 100, |
|
104 |
- company: 250, |
|
105 |
- common: 210, |
|
106 |
- }, { |
|
107 |
- date: "기술문서7", |
|
108 |
- total: 100, |
|
109 |
- company: 250, |
|
110 |
- common: 210, |
|
111 |
- }, |
|
112 |
- |
|
113 |
- ] |
|
76 |
+ |
|
77 |
+ postListSearch: { |
|
78 |
+ currentPage: 1, |
|
79 |
+ perPage: 7, |
|
80 |
+ startDate: COMMON_UTIL.oneMonthAgo(COMMON_UTIL.yesterday()), |
|
81 |
+ endDate: COMMON_UTIL.yesterday(), |
|
82 |
+ bbs_id: '3' |
|
83 |
+ }, |
|
84 |
+ oneMonthLater: COMMON_UTIL.yesterday(), |
|
85 |
+ postLogListByDate: [], |
|
114 | 86 |
}; |
115 | 87 |
}, |
116 | 88 |
methods: { |
89 |
+ /** 권한 별 로그인 수 날짜 별 통계 */ |
|
90 |
+ postLogList: function () { |
|
91 |
+ const vm = this; |
|
92 |
+ axios({ |
|
93 |
+ url: '/statistics/postLogListByDate.json', |
|
94 |
+ method: 'post', |
|
95 |
+ hearder: { |
|
96 |
+ 'Content-Type': "application/json; charset=UTF-8", |
|
97 |
+ }, |
|
98 |
+ data: vm.postListSearch |
|
99 |
+ }).then(function (response) { |
|
100 |
+ vm.postLogListByDate = response.data |
|
101 |
+ }).catch(function (error) { |
|
102 |
+ console.log("error - ", error) |
|
103 |
+ alert("게시글 별 조회수 조회 오류, 관리자에게 문의하세요."); |
|
104 |
+ }) |
|
105 |
+ }, |
|
117 | 106 |
|
107 |
+ /**날짜선택 유효성 검사 */ |
|
108 |
+ postLogListCheck: function() { |
|
109 |
+ if(COMMON_UTIL.isEmpty(this.postListSearch.endDate) === false) { |
|
110 |
+ alert("날짜를 선택해주세요."); |
|
111 |
+ } |
|
112 |
+ }, |
|
118 | 113 |
}, |
119 | 114 |
watch: { |
120 |
- |
|
115 |
+ 'postListSearch.startDate': function(newValue) { |
|
116 |
+ let date = COMMON_UTIL.oneMonthLater(newValue); |
|
117 |
+ this.postListSearch.endDate = null; |
|
118 |
+ if(date > COMMON_UTIL.today()) { |
|
119 |
+ this.oneMonthLater = COMMON_UTIL.yesterday(); |
|
120 |
+ } else { |
|
121 |
+ this.oneMonthLater = date; |
|
122 |
+ } |
|
123 |
+ }, |
|
121 | 124 |
}, |
122 | 125 |
computed: { |
123 | 126 |
|
124 | 127 |
}, |
125 | 128 |
components: { |
126 |
- 'BarChart': BarChart |
|
129 |
+ 'BarChart': BarChart, |
|
130 |
+ PaginationButton: PaginationButton, |
|
127 | 131 |
}, |
128 | 132 |
mounted() { |
129 |
- |
|
130 |
- |
|
133 |
+ this.postLogList(); |
|
131 | 134 |
} |
132 | 135 |
} |
133 | 136 |
|
--- client/views/pages/admin/statistics/Visit.vue
+++ client/views/pages/admin/statistics/Visit.vue
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 |
<span>~</span> |
8 | 8 |
<input type="date" name="" id="" :min="visitListSearch.startDate" :max="oneMonthLater" |
9 | 9 |
v-model="visitListSearch.endDate" /> |
10 |
- <button class="blue-btn">조회</button> |
|
10 |
+ <button class="blue-btn" @click="visitSelectListCheck()">조회</button> |
|
11 | 11 |
</div> |
12 | 12 |
<div class="date-check flex-end"> |
13 | 13 |
<div> |
... | ... | @@ -106,6 +106,13 @@ |
106 | 106 |
alert("방문자 수 조회 오류, 관리자에게 문의하세요."); |
107 | 107 |
}) |
108 | 108 |
}, |
109 |
+ |
|
110 |
+ /**날짜선택 유효성 검사 */ |
|
111 |
+ visitSelectListCheck: function() { |
|
112 |
+ if(COMMON_UTIL.isEmpty(this.visitListSearch.endDate) === false) { |
|
113 |
+ alert("날짜를 선택해주세요."); |
|
114 |
+ } |
|
115 |
+ }, |
|
109 | 116 |
}, |
110 | 117 |
watch: { |
111 | 118 |
'visitListSearch.startDate': function(newValue) { |
... | ... | @@ -116,6 +123,7 @@ |
116 | 123 |
} else { |
117 | 124 |
this.oneMonthLater = date; |
118 | 125 |
} |
126 |
+ console.log(this.visitListSearch.endDate) |
|
119 | 127 |
}, |
120 | 128 |
|
121 | 129 |
}, |
--- client/views/pages/admin/statistics/WgCommunity.vue
+++ client/views/pages/admin/statistics/WgCommunity.vue
... | ... | @@ -3,10 +3,11 @@ |
3 | 3 |
<div class="chart-top"> |
4 | 4 |
<div class="flex"> |
5 | 5 |
<div class="date-zone flex-start"> |
6 |
- <input type="date" name="" id=""> |
|
6 |
+ <input type="date" name="" id="" :max="postListSearch.endDate" v-model="postListSearch.startDate"> |
|
7 | 7 |
<span>~</span> |
8 |
- <input type="date" name="" id=""> |
|
9 |
- <button class="blue-btn">조회</button> |
|
8 |
+ <input type="date" name="" id="" :min="postListSearch.startDate" :max="oneMonthLater" |
|
9 |
+ v-model="postListSearch.endDate"> |
|
10 |
+ <button class="blue-btn" @click="postLogListCheck()">조회</button> |
|
10 | 11 |
</div> |
11 | 12 |
<div class="date-check flex-end"> |
12 | 13 |
<div> |
... | ... | @@ -20,7 +21,7 @@ |
20 | 21 |
</div> |
21 | 22 |
</div> |
22 | 23 |
</div> |
23 |
- <BarChart :data="menuVisitData" :mapping="keyMapping" /> |
|
24 |
+ <BarChart :chartData="postLogListByDate" :mapping="keyMapping" /> |
|
24 | 25 |
<div class="table-zone"> |
25 | 26 |
<div class="btn-wrap"> |
26 | 27 |
<button class="blue-border-bnt">Excel 다운로드</button> |
... | ... | @@ -44,8 +45,8 @@ |
44 | 45 |
</tr> |
45 | 46 |
</thead> |
46 | 47 |
<tbody> |
47 |
- <tr v-for="(item, index) in menuVisitData" :key="index"> |
|
48 |
- <td>{{ item.date }}</td> |
|
48 |
+ <tr v-for="(item, index) in postLogListByDate" :key="index"> |
|
49 |
+ <td>{{ item.post_title }}</td> |
|
49 | 50 |
<td>{{ item.total }}</td> |
50 | 51 |
<td>{{ item.company }}</td> |
51 | 52 |
<td>{{ item.common }}</td> |
... | ... | @@ -57,8 +58,10 @@ |
57 | 58 |
</template> |
58 | 59 |
|
59 | 60 |
<script> |
60 |
-import BarChart from '../../../component/chart/BarChart.vue' |
|
61 |
- |
|
61 |
+import axios from 'axios'; |
|
62 |
+import BarChart from '../../../component/chart/BarChart.vue'; |
|
63 |
+import COMMON_UTIL from '../../../../resources/js/commonUtil.js'; |
|
64 |
+import PaginationButton from '../../../component/pagination/PaginationButton.vue'; |
|
62 | 65 |
|
63 | 66 |
const App = { |
64 | 67 |
|
... | ... | @@ -69,64 +72,63 @@ |
69 | 72 |
company: "기업회원", |
70 | 73 |
common: "일반회원", |
71 | 74 |
}, |
72 |
- menuVisitData: [ |
|
73 |
- { |
|
74 |
- date: "전문가협의체1", |
|
75 |
- total: 100, |
|
76 |
- company: 250, |
|
77 |
- common: 210, |
|
78 |
- |
|
79 |
- }, { |
|
80 |
- date: "전문가협의체2", |
|
81 |
- total: 400, |
|
82 |
- company: 100, |
|
83 |
- common: 250, |
|
84 |
- |
|
85 |
- }, { |
|
86 |
- date: "전문가협의체3", |
|
87 |
- total: 100, |
|
88 |
- company: 250, |
|
89 |
- common: 210, |
|
90 |
- |
|
91 |
- }, { |
|
92 |
- date: "전문가협의체4", |
|
93 |
- total: 100, |
|
94 |
- company: 250, |
|
95 |
- common: 210, |
|
96 |
- }, { |
|
97 |
- date: "전문가협의체5", |
|
98 |
- total: 100, |
|
99 |
- company: 250, |
|
100 |
- common: 210, |
|
101 |
- }, { |
|
102 |
- date: "전문가협의체6", |
|
103 |
- total: 100, |
|
104 |
- company: 250, |
|
105 |
- common: 210, |
|
106 |
- }, { |
|
107 |
- date: "전문가협의체7", |
|
108 |
- total: 100, |
|
109 |
- company: 250, |
|
110 |
- common: 210, |
|
111 |
- }, |
|
112 |
- ] |
|
75 |
+ postListSearch: { |
|
76 |
+ currentPage: 1, |
|
77 |
+ perPage: 7, |
|
78 |
+ startDate: COMMON_UTIL.oneMonthAgo(COMMON_UTIL.yesterday()), |
|
79 |
+ endDate: COMMON_UTIL.yesterday(), |
|
80 |
+ bbs_id: '4' |
|
81 |
+ }, |
|
82 |
+ oneMonthLater: COMMON_UTIL.yesterday(), |
|
83 |
+ postLogListByDate: [], |
|
113 | 84 |
}; |
114 | 85 |
}, |
115 | 86 |
methods: { |
87 |
+ /** 권한 별 로그인 수 날짜 별 통계 */ |
|
88 |
+ postLogList: function () { |
|
89 |
+ const vm = this; |
|
90 |
+ axios({ |
|
91 |
+ url: '/statistics/postLogListByDate.json', |
|
92 |
+ method: 'post', |
|
93 |
+ hearder: { |
|
94 |
+ 'Content-Type': "application/json; charset=UTF-8", |
|
95 |
+ }, |
|
96 |
+ data: vm.postListSearch |
|
97 |
+ }).then(function (response) { |
|
98 |
+ vm.postLogListByDate = response.data |
|
99 |
+ }).catch(function (error) { |
|
100 |
+ console.log("error - ", error) |
|
101 |
+ alert("게시글 별 조회수 조회 오류, 관리자에게 문의하세요."); |
|
102 |
+ }) |
|
103 |
+ }, |
|
116 | 104 |
|
105 |
+ /**날짜선택 유효성 검사 */ |
|
106 |
+ postLogListCheck: function() { |
|
107 |
+ if(COMMON_UTIL.isEmpty(this.postListSearch.endDate) === false) { |
|
108 |
+ alert("날짜를 선택해주세요."); |
|
109 |
+ } |
|
110 |
+ }, |
|
117 | 111 |
}, |
118 | 112 |
watch: { |
119 |
- |
|
113 |
+ 'postListSearch.startDate': function(newValue) { |
|
114 |
+ let date = COMMON_UTIL.oneMonthLater(newValue); |
|
115 |
+ this.postListSearch.endDate = null; |
|
116 |
+ if(date > COMMON_UTIL.today()) { |
|
117 |
+ this.oneMonthLater = COMMON_UTIL.yesterday(); |
|
118 |
+ } else { |
|
119 |
+ this.oneMonthLater = date; |
|
120 |
+ } |
|
121 |
+ }, |
|
120 | 122 |
}, |
121 | 123 |
computed: { |
122 | 124 |
|
123 | 125 |
}, |
124 | 126 |
components: { |
125 |
- 'BarChart': BarChart |
|
127 |
+ 'BarChart': BarChart, |
|
128 |
+ PaginationButton: PaginationButton, |
|
126 | 129 |
}, |
127 | 130 |
mounted() { |
128 |
- |
|
129 |
- |
|
131 |
+ this.postLogList(); |
|
130 | 132 |
} |
131 | 133 |
} |
132 | 134 |
|
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?