--- client/resources/css/style.css
+++ client/resources/css/style.css
... | ... | @@ -134,7 +134,17 @@ |
134 | 134 |
top: 179px; |
135 | 135 |
z-index: 1; |
136 | 136 |
} |
137 |
- |
|
137 |
+.main-wrap-plan { |
|
138 |
+ width: 134rem; |
|
139 |
+ height: 70rem; |
|
140 |
+ background-color: #fff; |
|
141 |
+ border-radius: 10px; |
|
142 |
+ position: absolute; |
|
143 |
+ right: 60px; |
|
144 |
+ top: 179px; |
|
145 |
+ z-index: 1; |
|
146 |
+ background-image: url("../img/new_img/plan/background.png"); |
|
147 |
+} |
|
138 | 148 |
.header img { |
139 | 149 |
margin-left: 20px; |
140 | 150 |
object-fit: contain; |
... | ... | @@ -338,6 +348,22 @@ |
338 | 348 |
background-color: #9528b7; |
339 | 349 |
} |
340 | 350 |
|
351 |
+.mypage .book-green > .text { |
|
352 |
+ background-color: #38a867; |
|
353 |
+} |
|
354 |
+ |
|
355 |
+.purple-scroll::-webkit-scrollbar-thumb { |
|
356 |
+ border-radius: 5px; |
|
357 |
+ background-color: #9628b7a2; |
|
358 |
+} |
|
359 |
+ |
|
360 |
+.green-scroll::-webkit-scrollbar-thumb { |
|
361 |
+ border-radius: 5px; |
|
362 |
+ background-color: #38a867ad; |
|
363 |
+} |
|
364 |
+.mypage .book-green { |
|
365 |
+ border: #38a867 solid 6px; |
|
366 |
+} |
|
341 | 367 |
.mypage .textbook .box { |
342 | 368 |
text-align: center; |
343 | 369 |
padding: 10px; |
--- client/views/pages/main/Main.vue
+++ client/views/pages/main/Main.vue
... | ... | @@ -2,15 +2,19 @@ |
2 | 2 |
<div> |
3 | 3 |
<Header></Header> |
4 | 4 |
<div style="padding: 40px 60px 90px"> |
5 |
+ |
|
5 | 6 |
<div class="flex justify-between"> |
6 | 7 |
<Side></Side> |
7 | 8 |
<div> |
8 |
- <!-- <Menu :currentRoute="$route.path"></Menu> --> |
|
9 |
- <div class="main-wrap"> |
|
9 |
+ <div v-if="$route.name === 'MyPlan'" class="main-wrap-plan"> |
|
10 |
+ <router-view /> |
|
11 |
+ </div> |
|
12 |
+ <div v-else class="main-wrap"> |
|
10 | 13 |
<router-view /> |
11 | 14 |
</div> |
12 | 15 |
</div> |
13 | 16 |
</div> |
17 |
+ |
|
14 | 18 |
</div> |
15 | 19 |
</div> |
16 | 20 |
</template> |
--- client/views/pages/main/MyPlan.vue
+++ client/views/pages/main/MyPlan.vue
... | ... | @@ -1,69 +1,170 @@ |
1 | 1 |
<template> |
2 |
- <div class="main"> |
|
3 |
- <div class="myplan"> |
|
4 |
- <div class="title-box flex justify-between mb40"> |
|
5 |
- <p class="title">오늘 공부할 내용을 확인해봅시다.</p> |
|
6 |
- </div> |
|
7 |
- <div class="wrap" style="border-radius: 0; min-height: 197px"> |
|
8 |
- <p class="title1" v-if="!schedules || schedules.length === 0">오늘 학습할 내용이 없습니다.</p> |
|
2 |
+ <div style="height: 100%;"> |
|
3 |
+ <div class="myplan mypage flex" style="height: 100%; padding: 50px;"> |
|
4 |
+ <div class="textbook book-purple" |
|
5 |
+ style="background-color: white; width: 50%; height: 100%; text-align: center;"> |
|
6 |
+ <div class="text"> |
|
7 |
+ <p class="title1" style="color: #fff;">스케줄</p> |
|
8 |
+ </div> |
|
9 |
+ <div class="purple-scroll" style="overflow: auto; height: 85%;"> |
|
10 |
+ <div style="padding: 10px 20px;"> |
|
11 |
+ <p style="text-align: right;cursor: pointer;text-decoration: underline;padding-bottom: 5px;" |
|
12 |
+ class="title2" @click="goToPage2('MyPlan2')">학습 일정 변경하기</p> |
|
13 |
+ <p class="title1" v-if="!schedules || schedules.length === 0">오늘 학습할 내용이 없습니다.</p> |
|
9 | 14 |
|
10 |
- <div class="flex-column" style="gap: 20px" v-else v-for="(schedule, index) in schedules" :key="index"> |
|
11 |
- <div class="flex justify-between align-center" style="gap: 70px"> |
|
12 |
- <div><img src="../../../resources/img/img217_22s.png" alt="" /></div> |
|
13 |
- <div class="wrap cs-pt planBox" :class="{ 'cs-pt-clicked': isClicked }" style="width: 100%"> |
|
14 |
- <div class="text-lf flex justify-between align-center"> |
|
15 |
- <div style="flex-basis: 40rem"> |
|
16 |
- <p class="title2" s>grade 3</p> |
|
17 |
- <div class="flex align-center mb10" style="gap: 10px; margin-top: 1.5em"> |
|
18 |
- <p class="title2"> |
|
19 |
- <em class="gray-bd">{{ schedule.schdl_unit }}교시</em> |
|
20 |
- </p> |
|
21 |
- <p class="title1">{{ schedule.schedule_time }}</p> |
|
15 |
+ <div class="flex-column " style="gap: 20px" v-else v-for="(schedule, index) in schedules" |
|
16 |
+ :key="index"> |
|
17 |
+ <div class="flex justify-between align-center" style="gap: 70px"> |
|
18 |
+ <div class="wrap cs-pt planBox" :class="{ 'cs-pt-clicked': isClicked }" |
|
19 |
+ style="width: 100%; background-color: #f1eaff;" |
|
20 |
+ @click="goToPage('Dashboard', schedule.schdl_id)"> |
|
21 |
+ <div class="text-lf flex justify-between align-center" style="width: 100%;"> |
|
22 |
+ <p class="title2" s>grade 3</p><button type="button" class="popup-close-btn" |
|
23 |
+ @click="deleteSchedule(schedule.schdl_id)" style="flex-basis: 25px"> |
|
24 |
+ <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon> |
|
25 |
+ </button> |
|
22 | 26 |
</div> |
23 |
- <div class="title-box mb10"> |
|
24 |
- <span class="title">{{ schedule.unit_nm }}</span> |
|
27 |
+ <div class="text-lf flex justify-between align-center"> |
|
28 |
+ <div style="flex-basis: 40rem"> |
|
29 |
+ <div class="flex align-center mb10" style="gap: 10px;"> |
|
30 |
+ <p class="title2"> |
|
31 |
+ <em class="gray-bd" |
|
32 |
+ style="background-color: #9528b7; color: white; font-size: 18px;">{{ |
|
33 |
+ schedule.schdl_unit }}교시</em> |
|
34 |
+ </p> |
|
35 |
+ <p class="title1">{{ schedule.schedule_time }}</p> |
|
36 |
+ </div> |
|
37 |
+ <div class="title-box mb10" style="display: flex;"> |
|
38 |
+ <span class="title" style="font-size: 28px;">{{ schedule.unit_nm |
|
39 |
+ }}</span> |
|
40 |
+ <p class="title2" style="margin: auto 0;margin-left: 1em;">{{ |
|
41 |
+ schedule.book_nm }}</p> |
|
42 |
+ </div> |
|
43 |
+ </div> |
|
44 |
+ <!-- <button v-if="schedule.finish == 'T'" type="button" title="바로가기" class="yellow-btn" |
|
45 |
+ @click="goToPage('Dashboard', schedule.schdl_id)">학습완료</button> |
|
46 |
+ <button v-else type="button" title="바로가기" class="yellow-btn" |
|
47 |
+ @click="goToPage('Dashboard', schedule.schdl_id)" |
|
48 |
+ style="flex-basis: 18rem">바로가기</button> --> |
|
49 |
+ <div style="flex-basis: 100px"><img src="../../../resources/img/img214_19s.png" |
|
50 |
+ alt="" style="height: 100px; width: 100px" /></div> |
|
51 |
+ |
|
25 | 52 |
</div> |
26 |
- <p class="title2">{{ schedule.book_nm }}</p> |
|
27 |
- <!-- <p class="title2">wirte a</p> --> |
|
28 | 53 |
</div> |
29 |
- <button v-if="schedule.finish == 'T'" type="button" title="바로가기" class="yellow-btn" @click="goToPage('Dashboard', schedule.schdl_id)">학습완료</button> |
|
30 |
- <button v-else type="button" title="바로가기" class="yellow-btn" @click="goToPage('Dashboard', schedule.schdl_id)" style="flex-basis: 18rem">바로가기</button> |
|
31 |
- <div style="flex-basis: 100px"><img src="../../../resources/img/img214_19s.png" alt="" style="height: 130px; width: 100px" /></div> |
|
32 |
- <button type="button" class="popup-close-btn" @click="deleteSchedule(schedule.schdl_id)" style="flex-basis: 25px"> |
|
33 |
- <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon> |
|
34 |
- </button> |
|
54 |
+ </div> |
|
55 |
+ </div> |
|
56 |
+ </div> |
|
57 |
+ |
|
58 |
+ </div> |
|
59 |
+ </div> |
|
60 |
+ <!-- <div class="yellow-box mt30"> |
|
61 |
+ <div class="title-box flex justify-between align-center"> |
|
62 |
+ <div> |
|
63 |
+ <p class="title">오늘 공부를 계획해봅시다.</p> |
|
64 |
+ <p class="title1 mt20">스스로 학습 일정을 바꿔볼까요?</p> |
|
65 |
+ </div> |
|
66 |
+ <button type="button" title="바로가기" class="yellow-btn" |
|
67 |
+ @click="goToPage2('MyPlan2')">바로가기</button> |
|
68 |
+ </div> |
|
69 |
+ </div> --> |
|
70 |
+ |
|
71 |
+ <div style="width: 50%;margin-left: 3em;"> |
|
72 |
+ <div class="flex"> |
|
73 |
+ <div style="display: flex;"> |
|
74 |
+ <img src="../../../resources/img/new_img/plan/course_text.png" style="margin: auto 0;"> |
|
75 |
+ </div> |
|
76 |
+ <div style="justify-content: right; width: 100%; display: flex;" |
|
77 |
+ v-for="(ai_learning, index) in aiLearningList" :key="index"> |
|
78 |
+ <div style="margin-right: 2em;" |
|
79 |
+ @click="goToPage2('AIDashboard', aiLearningList[index].unit_id)"> |
|
80 |
+ <img src="../../../resources/img/new_img/plan/ai_course_1.png"> |
|
81 |
+ </div> |
|
82 |
+ <div style="margin-right: 2em;" |
|
83 |
+ @click="goToPage2('AIDashboard', aiLearningList[index].unit_id)"> |
|
84 |
+ <img src="../../../resources/img/new_img/plan/ai_course_2.png"> |
|
85 |
+ </div> |
|
86 |
+ <div @click="goToPage2('AIDashboard', aiLearningList[index].unit_id)"> |
|
87 |
+ <img src="../../../resources/img/new_img/plan/ai_course_3.png"> |
|
88 |
+ </div> |
|
89 |
+ </div> |
|
90 |
+ |
|
91 |
+ </div> |
|
92 |
+ |
|
93 |
+ <div class="flex" style="margin-top: 3em;"> |
|
94 |
+ <div style="display: flex;"> |
|
95 |
+ <img src="../../../resources/img/new_img/plan/menu_text.png" style="margin: auto 0;"> |
|
96 |
+ </div> |
|
97 |
+ <div class="mpcontainer"> |
|
98 |
+ <div class="mpbox" style="margin-right: 2em;"> |
|
99 |
+ <img src="../../../resources/img/new_img/icon/correct_icon.png"> |
|
100 |
+ <p>채점결과</p> |
|
101 |
+ </div> |
|
102 |
+ |
|
103 |
+ <div class="mpbox" style="margin-right: 2em;"> |
|
104 |
+ <img src="../../../resources/img/new_img/icon/mypage_icon.png"> |
|
105 |
+ <p>생활기록부</p> |
|
106 |
+ </div> |
|
107 |
+ |
|
108 |
+ <div class="mpbox" style="margin-right: 2em;"> |
|
109 |
+ <img src="../../../resources/img/new_img/icon/qNa_icon.png"> |
|
110 |
+ <p>내문제질문</p> |
|
111 |
+ </div> |
|
112 |
+ |
|
113 |
+ <div class="mpbox"> |
|
114 |
+ <img src="../../../resources/img/new_img/icon/photobook_icon.png"> |
|
115 |
+ <p>포토북</p> |
|
116 |
+ </div> |
|
117 |
+ </div> |
|
118 |
+ </div> |
|
119 |
+ <!-- <div class="wrap mt30"> |
|
120 |
+ <p class="title1 mb20">AI 맞춤형 학습 코스는 어떨까요?</p> |
|
121 |
+ <div class="imgGroup flex justify-between"> |
|
122 |
+ <div class="text-lf aiClick" v-for="(ai_learning, index) in aiLearningList" :key="index" |
|
123 |
+ @click="goToPage2('AIDashboard', aiLearningList[index].unit_id)"> |
|
124 |
+ <img src="../../../resources/img/img215_22s.png" alt="" /> |
|
125 |
+ <p class="title2 mt10">추천 학습 단원</p> |
|
126 |
+ </div> |
|
127 |
+ </div> |
|
128 |
+ </div> --> |
|
129 |
+ |
|
130 |
+ |
|
131 |
+ |
|
132 |
+ <div class="mypage" style="display:flex;height: 50%;gap: 10px;margin-top: 4em;"> |
|
133 |
+ <div class="textbook book-green" |
|
134 |
+ style="background-color: white; width: 50%; height: 100%; text-align: center;"> |
|
135 |
+ <div class="text"> |
|
136 |
+ <p class="title1" style="color: #fff;">오늘의 뉴스</p> |
|
137 |
+ </div> |
|
138 |
+ <div class="green-scroll" style="overflow: auto; height: 75%;"> |
|
139 |
+ <div style=" padding: 10px;"> |
|
140 |
+ <div v-for="(news, index) in schedules" :key="index"> |
|
141 |
+ <div style="display: flex;"> |
|
142 |
+ <div> |
|
143 |
+ <img src="../../../resources/img/img16_s.png" alt="" /> |
|
144 |
+ </div> |
|
145 |
+ <p style="margin-left: 5px; font-size: 18px;">{{ name }}님이 {{ unit }}을 다 끝냈습니다. |
|
146 |
+ </p> |
|
147 |
+ </div> |
|
148 |
+ <hr style="margin: 10px 0;"> |
|
149 |
+ </div> |
|
150 |
+ </div> |
|
151 |
+ </div> |
|
152 |
+ </div> |
|
153 |
+ |
|
154 |
+ <div class="textbook book-blue" |
|
155 |
+ style="background-color: white; width: 50%; height: 100%; text-align: center;"> |
|
156 |
+ <div class="text "> |
|
157 |
+ <p class="title1" style="color: #fff;">학습 현황</p> |
|
158 |
+ </div> |
|
159 |
+ <div style="overflow: hidden; height: 75%;"> |
|
160 |
+ <div class="flex justify-center"> |
|
161 |
+ <Dounutchart /> |
|
35 | 162 |
</div> |
36 | 163 |
</div> |
37 | 164 |
</div> |
38 | 165 |
</div> |
39 | 166 |
</div> |
40 | 167 |
|
41 |
- <div class="yellow-box mt30"> |
|
42 |
- <div class="title-box flex justify-between align-center"> |
|
43 |
- <div> |
|
44 |
- <p class="title">오늘 공부를 계획해봅시다.</p> |
|
45 |
- <p class="title1 mt20">스스로 학습 일정을 바꿔볼까요?</p> |
|
46 |
- </div> |
|
47 |
- <button type="button" title="바로가기" class="yellow-btn" @click="goToPage2('MyPlan2')">바로가기</button> |
|
48 |
- </div> |
|
49 |
- </div> |
|
50 |
- <div class="wrap mt30"> |
|
51 |
- <p class="title1 mb20">AI 맞춤형 학습 코스는 어떨까요?</p> |
|
52 |
- <div class="imgGroup flex justify-between"> |
|
53 |
- <div class="text-lf aiClick" v-for="(ai_learning, index) in aiLearningList" :key="index" @click="goToPage2('AIDashboard', aiLearningList[index].unit_id)"> |
|
54 |
- <img src="../../../resources/img/img215_22s.png" alt="" /> |
|
55 |
- <p class="title2 mt10">추천 학습 단원</p> |
|
56 |
- </div> |
|
57 |
- <!-- <div class="text-lf aiClick" @click="goToPage2('AIDashboard')"> |
|
58 |
- <img src="../../../resources/img/img215_22s.png" alt="" /> |
|
59 |
- <p class="title2 mt10">추천 학습 단원</p> |
|
60 |
- </div> |
|
61 |
- <div class="text-lf aiClick" @click="goToPage2('AIDashboard')"> |
|
62 |
- <img src="../../../resources/img/img215_22s.png" alt="" /> |
|
63 |
- <p class="title2 mt10">추천 학습 단원</p> |
|
64 |
- </div> --> |
|
65 |
- </div> |
|
66 |
- </div> |
|
67 | 168 |
</div> |
68 | 169 |
</div> |
69 | 170 |
</template> |
... | ... | @@ -74,7 +175,7 @@ |
74 | 175 |
import { mdiMagnify, mdiWindowClose } from "@mdi/js"; |
75 | 176 |
import { mapActions } from "vuex"; |
76 | 177 |
import { mapGetters } from "vuex"; |
77 |
- |
|
178 |
+import Dounutchart from './chDounutchart.vue'; |
|
78 | 179 |
export default { |
79 | 180 |
data() { |
80 | 181 |
return { |
... | ... | @@ -94,11 +195,16 @@ |
94 | 195 |
], |
95 | 196 |
|
96 | 197 |
aiLearningList: [], |
198 |
+ |
|
199 |
+ news: [], |
|
97 | 200 |
}; |
98 | 201 |
}, |
99 | 202 |
methods: { |
100 | 203 |
...mapActions(["updateSchdlId", "updateBookId", "updateUnitId"]), |
101 | 204 |
|
205 |
+ fetchNews() { |
|
206 |
+ |
|
207 |
+ }, |
|
102 | 208 |
goToPage(page, scheduleId) { |
103 | 209 |
const startScheduleIndex = this.schedules.findIndex((schedule) => schedule.schdl_id === scheduleId); |
104 | 210 |
|
... | ... | @@ -169,9 +275,10 @@ |
169 | 275 |
}); |
170 | 276 |
}, |
171 | 277 |
goToPage2(page, unit_id) { |
172 |
- this.$router.push({ name: page, query: { |
|
173 |
- unit_id: unit_id, |
|
174 |
- }, |
|
278 |
+ this.$router.push({ |
|
279 |
+ name: page, query: { |
|
280 |
+ unit_id: unit_id, |
|
281 |
+ }, |
|
175 | 282 |
}); |
176 | 283 |
}, |
177 | 284 |
showConfirm(type) { |
... | ... | @@ -273,6 +380,7 @@ |
273 | 380 |
}, |
274 | 381 |
components: { |
275 | 382 |
SvgIcon, |
383 |
+ Dounutchart: Dounutchart, |
|
276 | 384 |
}, |
277 | 385 |
mounted() { |
278 | 386 |
console.log("Main2 mounted"); |
... | ... | @@ -283,7 +391,7 @@ |
283 | 391 |
</script> |
284 | 392 |
<style> |
285 | 393 |
.planBox { |
286 |
- box-shadow: rgba(0, 0, 0, 0.1) 0px 10px 20px, rgba(0, 0, 0, 0.096) 0px 6px 6px; |
|
394 |
+ /* box-shadow: rgba(0, 0, 0, 0.1) 0px 10px 20px, rgba(0, 0, 0, 0.096) 0px 6px 6px; */ |
|
287 | 395 |
border: none; |
288 | 396 |
margin: 0px 0px 20px; |
289 | 397 |
} |
... | ... | @@ -291,4 +399,35 @@ |
291 | 399 |
.aiClick { |
292 | 400 |
cursor: pointer; |
293 | 401 |
} |
402 |
+ |
|
403 |
+.mypgBack { |
|
404 |
+ background-image: url("../../../resources/img/new_img/plan/background.png"); |
|
405 |
+} |
|
406 |
+ |
|
407 |
+.mpcontainer { |
|
408 |
+ display: flex; |
|
409 |
+ justify-content: right; |
|
410 |
+ width: 100%; |
|
411 |
+} |
|
412 |
+ |
|
413 |
+.mpbox { |
|
414 |
+ background-color: white; |
|
415 |
+ border-radius: 20px; |
|
416 |
+ text-align: center; |
|
417 |
+ aspect-ratio: 1 / 1; |
|
418 |
+ width: 100px; |
|
419 |
+ display: grid; |
|
420 |
+ align-items: center; |
|
421 |
+} |
|
422 |
+ |
|
423 |
+.mpbox img { |
|
424 |
+ width: 4.5em; |
|
425 |
+ margin: 10px auto 0 auto; |
|
426 |
+} |
|
427 |
+ |
|
428 |
+.mpbox p { |
|
429 |
+ margin-top: 0.5em; |
|
430 |
+ font-size: 16px; |
|
431 |
+ font-family: 'ONEMobilePOPOTF'; |
|
432 |
+} |
|
294 | 433 |
</style> |
+++ client/views/pages/main/chDounutchart.vue
... | ... | @@ -0,0 +1,128 @@ |
1 | +<template> | |
2 | + <div ref="Dounutchart" style="position: relative;left: 29px;top: -5px;width: 500px;height: 300px;"></div> | |
3 | +</template> | |
4 | + | |
5 | +<script> | |
6 | +import * as am5 from "@amcharts/amcharts5"; | |
7 | +import * as am5percent from "@amcharts/amcharts5/percent"; | |
8 | +import am5themes_Animated from "@amcharts/amcharts5/themes/Animated"; | |
9 | +import axios from "axios"; | |
10 | + | |
11 | +export default { | |
12 | + name: "Dounutchart", | |
13 | + | |
14 | + data() { | |
15 | + return { | |
16 | + chartData: {}, | |
17 | + currentDate: "2024-08-14", | |
18 | + currentStdId: "1", | |
19 | + root: null, | |
20 | + chart: null | |
21 | + }; | |
22 | + }, | |
23 | + | |
24 | + mounted() { | |
25 | + this.getStdProgressData(); | |
26 | + }, | |
27 | + | |
28 | + methods: { | |
29 | + | |
30 | + // 현재 날짜의 학생 학습률 데이터 가져오기 | |
31 | + getStdProgressData() { | |
32 | + const vm = this; | |
33 | + axios.post('/dashboard/stdProgressData.json', { | |
34 | + std_id: vm.currentStdId, | |
35 | + current_date: vm.currentDate | |
36 | + }) | |
37 | + .then(response => { | |
38 | + vm.chartData = response.data; | |
39 | + vm.createChart(); | |
40 | + }) | |
41 | + .catch(error => { | |
42 | + console.error('오늘의 학생 학습 현황 데이터를 가져오는 중 오류 발생:', error); | |
43 | + }) | |
44 | + }, | |
45 | + | |
46 | + createChart() { | |
47 | + // 차트 중복 생성 방지 | |
48 | + if (this.root) { | |
49 | + this.root.dispose(); | |
50 | + } | |
51 | + | |
52 | + // Initialize root | |
53 | + const root = am5.Root.new(this.$refs.Dounutchart); | |
54 | + | |
55 | + // Apply themes | |
56 | + root.setThemes([ | |
57 | + am5themes_Animated.new(root) | |
58 | + ]); | |
59 | + | |
60 | + // Create chart | |
61 | + const chart = root.container.children.push(am5percent.PieChart.new(root, { | |
62 | + layout: root.verticalLayout, | |
63 | + radius: am5.percent(80), | |
64 | + innerRadius: am5.percent(40) // Adjusted innerRadius for a donut chart | |
65 | + })); | |
66 | + | |
67 | + if (chart.logo) { | |
68 | + chart.logo.disabled = true; | |
69 | + }; | |
70 | + | |
71 | + // Create series | |
72 | + const series = chart.series.push(am5percent.PieSeries.new(root, { | |
73 | + valueField: "value", | |
74 | + categoryField: "category", | |
75 | + alignLabels: false | |
76 | + })); | |
77 | + | |
78 | + // 색깔 설정 | |
79 | + series.slices.template.setAll({ | |
80 | + fill: am5.color(0x008000), // green for completed units | |
81 | + strokeWidth: 0, | |
82 | + strokeOpacity: 0 | |
83 | + }); | |
84 | + | |
85 | + // 카테고리 별 색깔 설정 | |
86 | + series.slices.template.adapters.add("fill", (fill, target) => { | |
87 | + if (target.dataItem.get("category") === "완료한 단원") { | |
88 | + return am5.color(0xafe589); // 초록 | |
89 | + } else if (target.dataItem.get("category") === "남은 단원") { | |
90 | + return am5.color(0xf7cece); // 빨강 | |
91 | + } | |
92 | + return fill; | |
93 | + }); | |
94 | + | |
95 | + series.labels.template.setAll({ | |
96 | + textType: "circular", | |
97 | + centerX: am5.p50, | |
98 | + centerY: am5.p50, | |
99 | + fontSize: 14 | |
100 | + }); | |
101 | + | |
102 | + // Set data | |
103 | + series.data.setAll([ | |
104 | + { value: this.chartData.clearUnitNum, category: "완료한 단원" }, | |
105 | + { value: this.chartData.totalScheduleUnitNum - this.chartData.clearUnitNum, category: "남은 단원" }, | |
106 | + ]); | |
107 | + | |
108 | + // Create legend | |
109 | + // const legend = chart.children.push(am5.Legend.new(root, { | |
110 | + // centerX: am5.p50, | |
111 | + // x: am5.p50, | |
112 | + // marginTop: -100, | |
113 | + // })); | |
114 | + | |
115 | + legend.data.setAll(series.dataItems); | |
116 | + | |
117 | + // Play initial series animation | |
118 | + series.appear(1000, 100); | |
119 | + | |
120 | + } | |
121 | + } | |
122 | + | |
123 | +}; | |
124 | +</script> | |
125 | + | |
126 | +<style scoped> | |
127 | +/* Add necessary styles here */ | |
128 | +</style>(파일 끝에 줄바꿈 문자 없음) |
--- client/views/pages/parents/Dounutchart.vue
+++ client/views/pages/parents/Dounutchart.vue
... | ... | @@ -31,16 +31,16 @@ |
31 | 31 |
getStdProgressData() { |
32 | 32 |
const vm = this; |
33 | 33 |
axios.post('/dashboard/stdProgressData.json', { |
34 |
- std_id: vm.currentStdId, |
|
35 |
- current_date: vm.currentDate |
|
34 |
+ std_id: vm.currentStdId, |
|
35 |
+ current_date: vm.currentDate |
|
36 | 36 |
}) |
37 |
- .then(response => { |
|
38 |
- vm.chartData = response.data; |
|
39 |
- vm.createChart(); |
|
40 |
- }) |
|
41 |
- .catch(error => { |
|
37 |
+ .then(response => { |
|
38 |
+ vm.chartData = response.data; |
|
39 |
+ vm.createChart(); |
|
40 |
+ }) |
|
41 |
+ .catch(error => { |
|
42 | 42 |
console.error('오늘의 학생 학습 현황 데이터를 가져오는 중 오류 발생:', error); |
43 |
- }) |
|
43 |
+ }) |
|
44 | 44 |
}, |
45 | 45 |
|
46 | 46 |
createChart() { |
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?