
--- client/views/pages/main/Dashboard.vue
+++ client/views/pages/main/Dashboard.vue
... | ... | @@ -1,741 +1,1021 @@ |
1 | 1 |
<template> |
2 |
- <p class="title1" v-if="state === 'finish'">오늘 공부를 다했어요! 너무 고생했어요!</p> |
|
3 |
- <p class="title1" v-else-if="state === 'notRegistered'">지금은 학습 루트가 등록이 안됐어요! 학습 일정에서 학습루트를 등록해볼까요?</p> |
|
4 |
- <p class="title1" v-else-if="state === 'noProblem'">교재에 등록된 문제가 없습니다.</p> |
|
5 |
- <div v-else class="main"> |
|
6 |
- <div class="race-wrap"> |
|
7 |
- <div class="title-box"> |
|
8 |
- <p class="title" style="margin-top: 7rem;">{{ titleUnitName }}</p> |
|
9 |
- <p class="subtitle">{{ titleBookName }}</p> |
|
10 |
- </div> |
|
11 |
- <div class="race-box"> |
|
12 |
- |
|
13 |
- |
|
14 |
- <div class="rabbit-start"><img src="../../../resources/img/img09_s.png" alt="" |
|
15 |
- :style="{ display: rabbitPos[0] ? 'block' : 'none' }"></div> |
|
16 |
- <div class="rcon flex justify-end mb5"> |
|
17 |
- <div class="race-btn" @click="goToPage('Chapter1')"> |
|
18 |
- |
|
19 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
20 |
- :style="{ display: rabbitPos[1] ? 'block' : 'none' }"></div> |
|
21 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
22 |
- data-num="1"> |
|
23 |
- <img :src="item.imgSrc1" :style="{ display: !rabbitCompl[1] ? 'block' : 'none' }"> |
|
24 |
- <img :src="item.imgSrc2" :style="{ display: rabbitCompl[1] ? 'block' : 'none' }"> |
|
25 |
- </button> |
|
26 |
- <p>{{ labeledItems[0] }}</p> |
|
27 |
- </div> |
|
28 |
- <div class="race-btn" @click="goToPage('Chapter2')"> |
|
29 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
30 |
- :style="{ display: rabbitPos[2] ? 'block' : 'none' }"></div> |
|
31 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
32 |
- data-num="2"> |
|
33 |
- <img :src="item.imgSrc1" :style="{ display: !rabbitCompl[2] ? 'block' : 'none' }"> |
|
34 |
- <img :src="item.imgSrc2" :style="{ display: rabbitCompl[2] ? 'block' : 'none' }"> |
|
35 |
- </button> |
|
36 |
- <p>{{ labeledItems[1] }}</p> |
|
37 |
- </div> |
|
38 |
- </div> |
|
39 |
- <div class="lcon flex justify-between mb5"> |
|
40 |
- <div class="race-btn" @click="goToPage('Chapter2_8')"> |
|
41 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
42 |
- :style="{ display: rabbitPos[7] ? 'block' : 'none' }"></div> |
|
43 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
44 |
- data-num="7"> |
|
45 |
- <img :src="item.imgSrc1" :style="{ display: !rabbitCompl[7] ? 'block' : 'none' }"> |
|
46 |
- <img :src="item.imgSrc2" :style="{ display: rabbitCompl[7] ? 'block' : 'none' }"> |
|
47 |
- </button> |
|
48 |
- <p>{{ labeledItems[6] }}</p> |
|
49 |
- </div> |
|
50 |
- <div class="race-btn" @click="goToPage('Chapter6')"> |
|
51 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
52 |
- :style="{ display: rabbitPos[6] ? 'block' : 'none' }"></div> |
|
53 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
54 |
- data-num="6"> |
|
55 |
- <img :src="item.imgSrc1" :style="{ display: !rabbitCompl[6] ? 'block' : 'none' }"> |
|
56 |
- <img :src="item.imgSrc2" :style="{ display: rabbitCompl[6] ? 'block' : 'none' }"> |
|
57 |
- </button> |
|
58 |
- <p>{{ labeledItems[5] }}</p> |
|
59 |
- </div> |
|
60 |
- <div class="race-btn" @click="goToPage('Chapter2_8')"> |
|
61 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
62 |
- :style="{ display: rabbitPos[5] ? 'block' : 'none' }"></div> |
|
63 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
64 |
- data-num="5"> |
|
65 |
- <img :src="item.imgSrc1" :style="{ display: !rabbitCompl[5] ? 'block' : 'none' }"> |
|
66 |
- <img :src="item.imgSrc2" :style="{ display: rabbitCompl[5] ? 'block' : 'none' }"> |
|
67 |
- </button> |
|
68 |
- <p>{{ labeledItems[4] }}</p> |
|
69 |
- </div> |
|
70 |
- <div class="race-btn" @click="goToPage('Chapter2_7')"> |
|
71 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
72 |
- :style="{ display: rabbitPos[4] ? 'block' : 'none' }"></div> |
|
73 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
74 |
- data-num="4"> |
|
75 |
- <img :src="item.imgSrc1" :style="{ display: !rabbitCompl[4] ? 'block' : 'none' }"> |
|
76 |
- <img :src="item.imgSrc2" :style="{ display: rabbitCompl[4] ? 'block' : 'none' }"> |
|
77 |
- </button> |
|
78 |
- <p>{{ labeledItems[3] }}</p> |
|
79 |
- </div> |
|
80 |
- <div class="race-btn" @click="goToPage('Chapter2_8')"> |
|
81 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
82 |
- :style="{ display: rabbitPos[3] ? 'block' : 'none' }"></div> |
|
83 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
84 |
- data-num="3"> |
|
85 |
- <img :src="item.imgSrc1" :style="{ display: !rabbitCompl[3] ? 'block' : 'none' }"> |
|
86 |
- <img :src="item.imgSrc2" :style="{ display: rabbitCompl[3] ? 'block' : 'none' }"> |
|
87 |
- </button> |
|
88 |
- <p>{{ labeledItems[2] }}</p> |
|
89 |
- </div> |
|
90 |
- </div> |
|
91 |
- <div class="rcon flex"> |
|
92 |
- <div class="race-btn" @click="goToPage('Chapter8')"> |
|
93 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
94 |
- :style="{ display: rabbitPos[8] ? 'block' : 'none' }"></div> |
|
95 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
96 |
- data-num="8"> |
|
97 |
- <img :src="item.imgSrc3" :style="{ display: !rabbitCompl[8] ? 'block' : 'none' }"> |
|
98 |
- <img :src="item.imgSrc4" :style="{ display: rabbitCompl[8] ? 'block' : 'none' }"> |
|
99 |
- </button> |
|
100 |
- <p class="long">{{ labeledItems[7] }}</p> |
|
101 |
- </div> |
|
102 |
- <div class="race-btn" @click="goToPage('Chapter2_8')"> |
|
103 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
104 |
- :style="{ display: rabbitPos[9] ? 'block' : 'none' }"></div> |
|
105 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
106 |
- data-num="9"> |
|
107 |
- <img :src="item.imgSrc1" :style="{ display: !rabbitCompl[9] ? 'block' : 'none' }"> |
|
108 |
- <img :src="item.imgSrc2" :style="{ display: rabbitCompl[9] ? 'block' : 'none' }"> |
|
109 |
- </button> |
|
110 |
- <p>{{ labeledItems[8] }}</p> |
|
111 |
- </div> |
|
112 |
- <div class="race-btn" @click="goToPage('Chapter10')"> |
|
113 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
114 |
- :style="{ display: rabbitPos[10] ? 'block' : 'none' }"></div> |
|
115 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
116 |
- data-num="10"> |
|
117 |
- <img :src="item.imgSrc1" :style="{ display: !rabbitCompl[10] ? 'block' : 'none' }"> |
|
118 |
- <img :src="item.imgSrc2" :style="{ display: rabbitCompl[10] ? 'block' : 'none' }"> |
|
119 |
- </button> |
|
120 |
- <p>{{ labeledItems[9] }}</p> |
|
121 |
- </div> |
|
122 |
- |
|
123 |
- <div class="race-btn" @click="goToPage('Chapter2_8')"> |
|
124 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
125 |
- :style="{ display: rabbitPos[11] ? 'block' : 'none' }"></div> |
|
126 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" |
|
127 |
- @click="toggleImageAndShowPopup(index, '11')" data-num="11"> |
|
128 |
- <img :src="item.imgSrc3" :style="{ display: !rabbitCompl[11] ? 'block' : 'none' }"> |
|
129 |
- <img :src="item.imgSrc4" :style="{ display: rabbitCompl[11] ? 'block' : 'none' }"> |
|
130 |
- </button> |
|
131 |
- <p class="long">{{ labeledItems[10] }}</p> |
|
132 |
- </div> |
|
133 |
- </div> |
|
134 |
- <div class="race-btn"> |
|
135 |
- <div class="rabbit-running" style=" display: flex;"><img class="rabbit-end" |
|
136 |
- src="../../../resources/img/img138_72s.png" alt="" |
|
137 |
- :style="{ display: rabbitEnd ? 'block' : 'none' }"> |
|
138 |
- <img class="fireworks-end" src="../../../resources/img/fireworks.gif" alt="" |
|
139 |
- :style="{ display: rabbitEnd ? 'block' : 'none' }"> |
|
140 |
- </div> |
|
141 |
- </div> |
|
142 |
- </div> |
|
143 |
- |
|
144 |
- <!-- 팝업 --> |
|
145 |
- <div v-show="searchOpen2" class="popup-wrap"> |
|
146 |
- <div class="popup-box"> |
|
147 |
- <button type="button" class="popup-close-btn" style="position:absolute; top:10px; right: 10px;" |
|
148 |
- @click="closeModal"> |
|
149 |
- <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon> |
|
150 |
- </button> |
|
151 |
- |
|
152 |
- <div class="mb30 text-ct"> |
|
153 |
- <p class="title1 mb20">1단원이 끝났습니다!</p> |
|
154 |
- <p class="title1"><em class="yellow">기념사진</em>을 촬영하러 가요</p> |
|
155 |
- </div> |
|
156 |
- <div class="flex justify-center"> |
|
157 |
- <button type="button" title="사진촬영" class="new-btn" @click="openCameraModal"> |
|
158 |
- 사진 촬영 |
|
159 |
- </button> |
|
160 |
- </div> |
|
161 |
- </div> |
|
162 |
- </div> |
|
163 |
- <!-- 카메라 모달 --> |
|
164 |
- <article v-show="showCameraModal" class="popup-wrap"> |
|
165 |
- <div class="popup-box" style="top: 500px; left:500px"> |
|
166 |
- <div class="flex mb10 justify-between"> |
|
167 |
- <p class="popup-title">사진 촬영</p>ㄹ |
|
168 |
- <button type="button" class="popup-close-btn" @click="closeModal"> |
|
169 |
- <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon> |
|
170 |
- </button> |
|
171 |
- </div> |
|
172 |
- <div class="box"> |
|
173 |
- <div style="width: 100%;"> |
|
174 |
- <div id="container" ref="container"> |
|
175 |
- <video v-if="!photoTaken" autoplay="true" ref="modalVideoElement" class="mirrored" |
|
176 |
- @canplay="onVideoLoaded" style="position: absolute;"> |
|
177 |
- </video> |
|
178 |
- <img src="../../../resources/img/camera-rabbit.png" class="camera-rabbit" |
|
179 |
- style="position: absolute; "> |
|
180 |
- <canvas ref="canvas" style="pointer-events: none;"></canvas> |
|
181 |
- </div> |
|
182 |
- </div> |
|
183 |
- </div> |
|
184 |
- <div class="flex justify-center mt20"> |
|
185 |
- <button class="new-btn" @click="takePhoto">사진 찍기</button> |
|
186 |
- </div> |
|
187 |
- </div> |
|
188 |
- </article> |
|
2 |
+ <p class="title1" v-if="state === 'finish'"> |
|
3 |
+ 오늘 공부를 다했어요! 너무 고생했어요! |
|
4 |
+ </p> |
|
5 |
+ <p class="title1" v-else-if="state === 'notRegistered'"> |
|
6 |
+ 지금은 학습 루트가 등록이 안됐어요! 학습 일정에서 학습루트를 등록해볼까요? |
|
7 |
+ </p> |
|
8 |
+ <p class="title1" v-else-if="state === 'noProblem'"> |
|
9 |
+ 교재에 등록된 문제가 없습니다. |
|
10 |
+ </p> |
|
11 |
+ <div v-else class="main"> |
|
12 |
+ <div class="race-wrap"> |
|
13 |
+ <div class="title-box"> |
|
14 |
+ <p class="title" style="margin-top: 7rem">{{ titleUnitName }}</p> |
|
15 |
+ <p class="subtitle">{{ titleBookName }}</p> |
|
16 |
+ </div> |
|
17 |
+ <div class="race-box"> |
|
18 |
+ <div class="rabbit-start"> |
|
19 |
+ <img |
|
20 |
+ src="../../../resources/img/img09_s.png" |
|
21 |
+ alt="" |
|
22 |
+ :style="{ display: rabbitPos[0] ? 'block' : 'none' }" |
|
23 |
+ /> |
|
189 | 24 |
</div> |
190 |
- |
|
191 |
- |
|
192 |
- |
|
193 |
- <div class="complete-wrap myphoto"> |
|
194 |
- <button class="login-btn mt10" type="submit" style="width: 100%;" @click="finishSchedule"><img |
|
195 |
- src="../../../resources/img/btn07_s.png" alt="" style="width: 100%; height: 100px;"> |
|
196 |
- <p>학습 종료하기</p> |
|
25 |
+ <div class="rcon flex justify-end mb5"> |
|
26 |
+ <div class="race-btn" @click="goToPage('Chapter1')"> |
|
27 |
+ <div class="rabbit-running"> |
|
28 |
+ <img |
|
29 |
+ src="../../../resources/img/img09_s.png" |
|
30 |
+ alt="" |
|
31 |
+ :style="{ display: rabbitPos[1] ? 'block' : 'none' }" |
|
32 |
+ /> |
|
33 |
+ </div> |
|
34 |
+ <button |
|
35 |
+ class="popTxt" |
|
36 |
+ v-for="(item, index) in items" |
|
37 |
+ :key="index" |
|
38 |
+ @click="toggleImage(index)" |
|
39 |
+ data-num="1" |
|
40 |
+ > |
|
41 |
+ <img |
|
42 |
+ :src="item.imgSrc1" |
|
43 |
+ :style="{ display: !rabbitCompl[1] ? 'block' : 'none' }" |
|
44 |
+ /> |
|
45 |
+ <img |
|
46 |
+ :src="item.imgSrc2" |
|
47 |
+ :style="{ display: rabbitCompl[1] ? 'block' : 'none' }" |
|
48 |
+ /> |
|
197 | 49 |
</button> |
198 |
- <h2 class="mb40 mt10">이 단원을 끝낸 친구들</h2> |
|
199 |
- |
|
200 |
- <article class="flex-column"> |
|
201 |
- <div class="flex-row"> |
|
202 |
- <div class="flex" style="gap: 5px; flex-wrap: wrap;"> |
|
203 |
- <div v-for="(image, index) in images" :key="image.fileId" @click="buttonSearch(image)" |
|
204 |
- class="photo" style="margin-bottom: 5px;"> |
|
205 |
- <img :src="image.url" :alt="image.fileNm" reloadable="true" style="height: 100%;" /> |
|
206 |
- </div> |
|
207 |
- </div> |
|
208 |
- </div> |
|
209 |
- </article> |
|
210 |
- <article class="popup-wrap" v-show="searchOpen"> |
|
211 |
- <div class="popup-box "> |
|
212 |
- <div class="flex mb10 justify-between"> |
|
213 |
- <p class="popup-title">알림</p> |
|
214 |
- <button type="button" class="popup-close-btn" @click="closeModal"> |
|
215 |
- <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon> |
|
216 |
- </button> |
|
217 |
- </div> |
|
218 |
- <div class="box"> |
|
219 |
- <div style="width: 910px;"><img src="../../../resources/img/img140_747s.png" alt=""></div> |
|
220 |
- </div> |
|
221 |
- <div class="flex justify-between mt20"> |
|
222 |
- <div class="text flex"> |
|
223 |
- <p class="title2 date ml30">2024-08-06</p> |
|
224 |
- <span class=" title1 ml30">1단원을 마친 <em class="yellow">가나다</em>친구</span> |
|
225 |
- </div> |
|
226 |
- <div class="title2 flex align-center" style="gap: 10px;"><svg-icon type="mdi" :path="mdiHeart" |
|
227 |
- style="color: #FFBA08;"></svg-icon> |
|
228 |
- <p><em class="yellow">1</em></p> |
|
229 |
- </div> |
|
230 |
- </div> |
|
231 |
- </div> |
|
232 |
- </article> |
|
50 |
+ <p>{{ labeledItems[0] }}</p> |
|
51 |
+ </div> |
|
52 |
+ <div class="race-btn" @click="goToPage('Chapter2')"> |
|
53 |
+ <div class="rabbit-running"> |
|
54 |
+ <img |
|
55 |
+ src="../../../resources/img/img09_s.png" |
|
56 |
+ alt="" |
|
57 |
+ :style="{ display: rabbitPos[2] ? 'block' : 'none' }" |
|
58 |
+ /> |
|
59 |
+ </div> |
|
60 |
+ <button |
|
61 |
+ class="popTxt" |
|
62 |
+ v-for="(item, index) in items" |
|
63 |
+ :key="index" |
|
64 |
+ @click="toggleImage(index)" |
|
65 |
+ data-num="2" |
|
66 |
+ > |
|
67 |
+ <img |
|
68 |
+ :src="item.imgSrc1" |
|
69 |
+ :style="{ display: !rabbitCompl[2] ? 'block' : 'none' }" |
|
70 |
+ /> |
|
71 |
+ <img |
|
72 |
+ :src="item.imgSrc2" |
|
73 |
+ :style="{ display: rabbitCompl[2] ? 'block' : 'none' }" |
|
74 |
+ /> |
|
75 |
+ </button> |
|
76 |
+ <p>{{ labeledItems[1] }}</p> |
|
77 |
+ </div> |
|
233 | 78 |
</div> |
79 |
+ <div class="lcon flex justify-between mb5"> |
|
80 |
+ <div class="race-btn" @click="goToPage('Chapter2_8')"> |
|
81 |
+ <div class="rabbit-running"> |
|
82 |
+ <img |
|
83 |
+ src="../../../resources/img/img09_s.png" |
|
84 |
+ alt="" |
|
85 |
+ :style="{ display: rabbitPos[7] ? 'block' : 'none' }" |
|
86 |
+ /> |
|
87 |
+ </div> |
|
88 |
+ <button |
|
89 |
+ class="popTxt" |
|
90 |
+ v-for="(item, index) in items" |
|
91 |
+ :key="index" |
|
92 |
+ @click="toggleImage(index)" |
|
93 |
+ data-num="7" |
|
94 |
+ > |
|
95 |
+ <img |
|
96 |
+ :src="item.imgSrc1" |
|
97 |
+ :style="{ display: !rabbitCompl[7] ? 'block' : 'none' }" |
|
98 |
+ /> |
|
99 |
+ <img |
|
100 |
+ :src="item.imgSrc2" |
|
101 |
+ :style="{ display: rabbitCompl[7] ? 'block' : 'none' }" |
|
102 |
+ /> |
|
103 |
+ </button> |
|
104 |
+ <p>{{ labeledItems[6] }}</p> |
|
105 |
+ </div> |
|
106 |
+ <div class="race-btn" @click="goToPage('Chapter6')"> |
|
107 |
+ <div class="rabbit-running"> |
|
108 |
+ <img |
|
109 |
+ src="../../../resources/img/img09_s.png" |
|
110 |
+ alt="" |
|
111 |
+ :style="{ display: rabbitPos[6] ? 'block' : 'none' }" |
|
112 |
+ /> |
|
113 |
+ </div> |
|
114 |
+ <button |
|
115 |
+ class="popTxt" |
|
116 |
+ v-for="(item, index) in items" |
|
117 |
+ :key="index" |
|
118 |
+ @click="toggleImage(index)" |
|
119 |
+ data-num="6" |
|
120 |
+ > |
|
121 |
+ <img |
|
122 |
+ :src="item.imgSrc1" |
|
123 |
+ :style="{ display: !rabbitCompl[6] ? 'block' : 'none' }" |
|
124 |
+ /> |
|
125 |
+ <img |
|
126 |
+ :src="item.imgSrc2" |
|
127 |
+ :style="{ display: rabbitCompl[6] ? 'block' : 'none' }" |
|
128 |
+ /> |
|
129 |
+ </button> |
|
130 |
+ <p>{{ labeledItems[5] }}</p> |
|
131 |
+ </div> |
|
132 |
+ <div class="race-btn" @click="goToPage('Chapter2_8')"> |
|
133 |
+ <div class="rabbit-running"> |
|
134 |
+ <img |
|
135 |
+ src="../../../resources/img/img09_s.png" |
|
136 |
+ alt="" |
|
137 |
+ :style="{ display: rabbitPos[5] ? 'block' : 'none' }" |
|
138 |
+ /> |
|
139 |
+ </div> |
|
140 |
+ <button |
|
141 |
+ class="popTxt" |
|
142 |
+ v-for="(item, index) in items" |
|
143 |
+ :key="index" |
|
144 |
+ @click="toggleImage(index)" |
|
145 |
+ data-num="5" |
|
146 |
+ > |
|
147 |
+ <img |
|
148 |
+ :src="item.imgSrc1" |
|
149 |
+ :style="{ display: !rabbitCompl[5] ? 'block' : 'none' }" |
|
150 |
+ /> |
|
151 |
+ <img |
|
152 |
+ :src="item.imgSrc2" |
|
153 |
+ :style="{ display: rabbitCompl[5] ? 'block' : 'none' }" |
|
154 |
+ /> |
|
155 |
+ </button> |
|
156 |
+ <p>{{ labeledItems[4] }}</p> |
|
157 |
+ </div> |
|
158 |
+ <div class="race-btn" @click="goToPage('Chapter2_7')"> |
|
159 |
+ <div class="rabbit-running"> |
|
160 |
+ <img |
|
161 |
+ src="../../../resources/img/img09_s.png" |
|
162 |
+ alt="" |
|
163 |
+ :style="{ display: rabbitPos[4] ? 'block' : 'none' }" |
|
164 |
+ /> |
|
165 |
+ </div> |
|
166 |
+ <button |
|
167 |
+ class="popTxt" |
|
168 |
+ v-for="(item, index) in items" |
|
169 |
+ :key="index" |
|
170 |
+ @click="toggleImage(index)" |
|
171 |
+ data-num="4" |
|
172 |
+ > |
|
173 |
+ <img |
|
174 |
+ :src="item.imgSrc1" |
|
175 |
+ :style="{ display: !rabbitCompl[4] ? 'block' : 'none' }" |
|
176 |
+ /> |
|
177 |
+ <img |
|
178 |
+ :src="item.imgSrc2" |
|
179 |
+ :style="{ display: rabbitCompl[4] ? 'block' : 'none' }" |
|
180 |
+ /> |
|
181 |
+ </button> |
|
182 |
+ <p>{{ labeledItems[3] }}</p> |
|
183 |
+ </div> |
|
184 |
+ <div class="race-btn" @click="goToPage('Chapter2_8')"> |
|
185 |
+ <div class="rabbit-running"> |
|
186 |
+ <img |
|
187 |
+ src="../../../resources/img/img09_s.png" |
|
188 |
+ alt="" |
|
189 |
+ :style="{ display: rabbitPos[3] ? 'block' : 'none' }" |
|
190 |
+ /> |
|
191 |
+ </div> |
|
192 |
+ <button |
|
193 |
+ class="popTxt" |
|
194 |
+ v-for="(item, index) in items" |
|
195 |
+ :key="index" |
|
196 |
+ @click="toggleImage(index)" |
|
197 |
+ data-num="3" |
|
198 |
+ > |
|
199 |
+ <img |
|
200 |
+ :src="item.imgSrc1" |
|
201 |
+ :style="{ display: !rabbitCompl[3] ? 'block' : 'none' }" |
|
202 |
+ /> |
|
203 |
+ <img |
|
204 |
+ :src="item.imgSrc2" |
|
205 |
+ :style="{ display: rabbitCompl[3] ? 'block' : 'none' }" |
|
206 |
+ /> |
|
207 |
+ </button> |
|
208 |
+ <p>{{ labeledItems[2] }}</p> |
|
209 |
+ </div> |
|
210 |
+ </div> |
|
211 |
+ <div class="rcon flex"> |
|
212 |
+ <div class="race-btn" @click="goToPage('Chapter8')"> |
|
213 |
+ <div class="rabbit-running"> |
|
214 |
+ <img |
|
215 |
+ src="../../../resources/img/img09_s.png" |
|
216 |
+ alt="" |
|
217 |
+ :style="{ display: rabbitPos[8] ? 'block' : 'none' }" |
|
218 |
+ /> |
|
219 |
+ </div> |
|
220 |
+ <button |
|
221 |
+ class="popTxt" |
|
222 |
+ v-for="(item, index) in items" |
|
223 |
+ :key="index" |
|
224 |
+ @click="toggleImage(index)" |
|
225 |
+ data-num="8" |
|
226 |
+ > |
|
227 |
+ <img |
|
228 |
+ :src="item.imgSrc3" |
|
229 |
+ :style="{ display: !rabbitCompl[8] ? 'block' : 'none' }" |
|
230 |
+ /> |
|
231 |
+ <img |
|
232 |
+ :src="item.imgSrc4" |
|
233 |
+ :style="{ display: rabbitCompl[8] ? 'block' : 'none' }" |
|
234 |
+ /> |
|
235 |
+ </button> |
|
236 |
+ <p class="long">{{ labeledItems[7] }}</p> |
|
237 |
+ </div> |
|
238 |
+ <div class="race-btn" @click="goToPage('Chapter2_8')"> |
|
239 |
+ <div class="rabbit-running"> |
|
240 |
+ <img |
|
241 |
+ src="../../../resources/img/img09_s.png" |
|
242 |
+ alt="" |
|
243 |
+ :style="{ display: rabbitPos[9] ? 'block' : 'none' }" |
|
244 |
+ /> |
|
245 |
+ </div> |
|
246 |
+ <button |
|
247 |
+ class="popTxt" |
|
248 |
+ v-for="(item, index) in items" |
|
249 |
+ :key="index" |
|
250 |
+ @click="toggleImage(index)" |
|
251 |
+ data-num="9" |
|
252 |
+ > |
|
253 |
+ <img |
|
254 |
+ :src="item.imgSrc1" |
|
255 |
+ :style="{ display: !rabbitCompl[9] ? 'block' : 'none' }" |
|
256 |
+ /> |
|
257 |
+ <img |
|
258 |
+ :src="item.imgSrc2" |
|
259 |
+ :style="{ display: rabbitCompl[9] ? 'block' : 'none' }" |
|
260 |
+ /> |
|
261 |
+ </button> |
|
262 |
+ <p>{{ labeledItems[8] }}</p> |
|
263 |
+ </div> |
|
264 |
+ <div class="race-btn" @click="goToPage('Chapter10')"> |
|
265 |
+ <div class="rabbit-running"> |
|
266 |
+ <img |
|
267 |
+ src="../../../resources/img/img09_s.png" |
|
268 |
+ alt="" |
|
269 |
+ :style="{ display: rabbitPos[10] ? 'block' : 'none' }" |
|
270 |
+ /> |
|
271 |
+ </div> |
|
272 |
+ <button |
|
273 |
+ class="popTxt" |
|
274 |
+ v-for="(item, index) in items" |
|
275 |
+ :key="index" |
|
276 |
+ @click="toggleImage(index)" |
|
277 |
+ data-num="10" |
|
278 |
+ > |
|
279 |
+ <img |
|
280 |
+ :src="item.imgSrc1" |
|
281 |
+ :style="{ display: !rabbitCompl[10] ? 'block' : 'none' }" |
|
282 |
+ /> |
|
283 |
+ <img |
|
284 |
+ :src="item.imgSrc2" |
|
285 |
+ :style="{ display: rabbitCompl[10] ? 'block' : 'none' }" |
|
286 |
+ /> |
|
287 |
+ </button> |
|
288 |
+ <p>{{ labeledItems[9] }}</p> |
|
289 |
+ </div> |
|
290 |
+ |
|
291 |
+ <div class="race-btn" @click="goToPage('Chapter2_8')"> |
|
292 |
+ <div class="rabbit-running"> |
|
293 |
+ <img |
|
294 |
+ src="../../../resources/img/img09_s.png" |
|
295 |
+ alt="" |
|
296 |
+ :style="{ display: rabbitPos[11] ? 'block' : 'none' }" |
|
297 |
+ /> |
|
298 |
+ </div> |
|
299 |
+ <button |
|
300 |
+ class="popTxt" |
|
301 |
+ v-for="(item, index) in items" |
|
302 |
+ :key="index" |
|
303 |
+ @click="toggleImageAndShowPopup(index, '11')" |
|
304 |
+ data-num="11" |
|
305 |
+ > |
|
306 |
+ <img |
|
307 |
+ :src="item.imgSrc3" |
|
308 |
+ :style="{ display: !rabbitCompl[11] ? 'block' : 'none' }" |
|
309 |
+ /> |
|
310 |
+ <img |
|
311 |
+ :src="item.imgSrc4" |
|
312 |
+ :style="{ display: rabbitCompl[11] ? 'block' : 'none' }" |
|
313 |
+ /> |
|
314 |
+ </button> |
|
315 |
+ <p class="long">{{ labeledItems[10] }}</p> |
|
316 |
+ </div> |
|
317 |
+ </div> |
|
318 |
+ <div class="race-btn"> |
|
319 |
+ <div class="rabbit-running" style="display: flex"> |
|
320 |
+ <img |
|
321 |
+ class="rabbit-end" |
|
322 |
+ src="../../../resources/img/img138_72s.png" |
|
323 |
+ alt="" |
|
324 |
+ :style="{ display: rabbitEnd ? 'block' : 'none' }" |
|
325 |
+ /> |
|
326 |
+ <img |
|
327 |
+ class="fireworks-end" |
|
328 |
+ src="../../../resources/img/fireworks.gif" |
|
329 |
+ alt="" |
|
330 |
+ :style="{ display: rabbitEnd ? 'block' : 'none' }" |
|
331 |
+ /> |
|
332 |
+ </div> |
|
333 |
+ </div> |
|
334 |
+ </div> |
|
335 |
+ |
|
336 |
+ <!-- 팝업 --> |
|
337 |
+ <div v-show="searchOpen2" class="popup-wrap"> |
|
338 |
+ <div class="popup-box"> |
|
339 |
+ <button |
|
340 |
+ type="button" |
|
341 |
+ class="popup-close-btn" |
|
342 |
+ style="position: absolute; top: 10px; right: 10px" |
|
343 |
+ @click="closeModal" |
|
344 |
+ > |
|
345 |
+ <svg-icon |
|
346 |
+ type="mdi" |
|
347 |
+ :path="mdiWindowClose" |
|
348 |
+ class="close-btn" |
|
349 |
+ ></svg-icon> |
|
350 |
+ </button> |
|
351 |
+ |
|
352 |
+ <div class="mb30 text-ct"> |
|
353 |
+ <p class="title1 mb20">1단원이 끝났습니다!</p> |
|
354 |
+ <p class="title1"> |
|
355 |
+ <em class="yellow">기념사진</em>을 촬영하러 가요 |
|
356 |
+ </p> |
|
357 |
+ </div> |
|
358 |
+ <div class="flex justify-center"> |
|
359 |
+ <button |
|
360 |
+ type="button" |
|
361 |
+ title="사진촬영" |
|
362 |
+ class="new-btn" |
|
363 |
+ @click="openCameraModal" |
|
364 |
+ > |
|
365 |
+ 사진 촬영 |
|
366 |
+ </button> |
|
367 |
+ </div> |
|
368 |
+ </div> |
|
369 |
+ </div> |
|
370 |
+ <!-- 카메라 모달 --> |
|
371 |
+ <article v-show="showCameraModal" class="popup-wrap"> |
|
372 |
+ <div class="popup-box" style="top: 500px; left: 500px"> |
|
373 |
+ <div class="flex mb10 justify-between"> |
|
374 |
+ <p class="popup-title">사진 촬영</p> |
|
375 |
+ <button type="button" class="popup-close-btn" @click="closeModal"> |
|
376 |
+ <svg-icon |
|
377 |
+ type="mdi" |
|
378 |
+ :path="mdiWindowClose" |
|
379 |
+ class="close-btn" |
|
380 |
+ ></svg-icon> |
|
381 |
+ </button> |
|
382 |
+ </div> |
|
383 |
+ <div class="box"> |
|
384 |
+ <div style="width: 100%"> |
|
385 |
+ <div id="container" ref="container"> |
|
386 |
+ <video |
|
387 |
+ v-if="!photoTaken" |
|
388 |
+ autoplay="true" |
|
389 |
+ ref="modalVideoElement" |
|
390 |
+ class="mirrored" |
|
391 |
+ @canplay="onVideoLoaded" |
|
392 |
+ style="position: absolute" |
|
393 |
+ ></video> |
|
394 |
+ <img |
|
395 |
+ src="../../../resources/img/camera-rabbit.png" |
|
396 |
+ class="camera-rabbit" |
|
397 |
+ style="position: absolute" |
|
398 |
+ /> |
|
399 |
+ <canvas ref="canvas" style="pointer-events: none"></canvas> |
|
400 |
+ </div> |
|
401 |
+ </div> |
|
402 |
+ </div> |
|
403 |
+ <div class="flex justify-center mt20"> |
|
404 |
+ <button class="new-btn" @click="takePhoto">사진 찍기</button> |
|
405 |
+ </div> |
|
406 |
+ </div> |
|
407 |
+ </article> |
|
234 | 408 |
</div> |
409 |
+ |
|
410 |
+ <div class="complete-wrap myphoto"> |
|
411 |
+ <button |
|
412 |
+ class="login-btn mt10" |
|
413 |
+ type="submit" |
|
414 |
+ style="width: 100%" |
|
415 |
+ @click="finishSchedule" |
|
416 |
+ > |
|
417 |
+ <img |
|
418 |
+ src="../../../resources/img/btn07_s.png" |
|
419 |
+ alt="" |
|
420 |
+ style="width: 100%; height: 100px" |
|
421 |
+ /> |
|
422 |
+ <p>학습 종료하기</p> |
|
423 |
+ </button> |
|
424 |
+ <h2 class="mb40 mt10">이 단원을 끝낸 친구들</h2> |
|
425 |
+ |
|
426 |
+ <article class="flex-column"> |
|
427 |
+ <div class="flex-row"> |
|
428 |
+ <div class="flex" style="gap: 5px; flex-wrap: wrap"> |
|
429 |
+ <div |
|
430 |
+ v-for="(image, index) in images" |
|
431 |
+ :key="image.fileId" |
|
432 |
+ @click="buttonSearch(image)" |
|
433 |
+ class="photo" |
|
434 |
+ style="margin-bottom: 5px" |
|
435 |
+ > |
|
436 |
+ <img |
|
437 |
+ :src="image.url" |
|
438 |
+ :alt="image.fileNm" |
|
439 |
+ reloadable="true" |
|
440 |
+ style="height: 100%" |
|
441 |
+ /> |
|
442 |
+ </div> |
|
443 |
+ </div> |
|
444 |
+ </div> |
|
445 |
+ </article> |
|
446 |
+ <article class="popup-wrap" v-show="searchOpen"> |
|
447 |
+ <div class="popup-box"> |
|
448 |
+ <div class="flex mb10 justify-between"> |
|
449 |
+ <p class="popup-title">알림</p> |
|
450 |
+ <button type="button" class="popup-close-btn" @click="closeModal"> |
|
451 |
+ <svg-icon |
|
452 |
+ type="mdi" |
|
453 |
+ :path="mdiWindowClose" |
|
454 |
+ class="close-btn" |
|
455 |
+ ></svg-icon> |
|
456 |
+ </button> |
|
457 |
+ </div> |
|
458 |
+ <div class="box"> |
|
459 |
+ <div style="width: 910px"> |
|
460 |
+ <img src="../../../resources/img/img140_747s.png" alt="" /> |
|
461 |
+ </div> |
|
462 |
+ </div> |
|
463 |
+ <div class="flex justify-between mt20"> |
|
464 |
+ <div class="text flex"> |
|
465 |
+ <p class="title2 date ml30">2024-08-06</p> |
|
466 |
+ <span class="title1 ml30" |
|
467 |
+ >1단원을 마친 <em class="yellow">가나다</em>친구</span |
|
468 |
+ > |
|
469 |
+ </div> |
|
470 |
+ <div class="title2 flex align-center" style="gap: 10px"> |
|
471 |
+ <svg-icon |
|
472 |
+ type="mdi" |
|
473 |
+ :path="mdiHeart" |
|
474 |
+ style="color: #ffba08" |
|
475 |
+ ></svg-icon> |
|
476 |
+ <p><em class="yellow">1</em></p> |
|
477 |
+ </div> |
|
478 |
+ </div> |
|
479 |
+ </div> |
|
480 |
+ </article> |
|
481 |
+ </div> |
|
482 |
+ </div> |
|
235 | 483 |
</template> |
236 | 484 |
|
237 | 485 |
<script> |
238 |
-import SvgIcon from '@jamescoyle/vue-icon'; |
|
239 |
-import { mdiMagnify, mdiHeart, mdiWindowClose } from '@mdi/js'; |
|
240 |
-import axios from 'axios'; |
|
241 |
-import { mapGetters } from 'vuex'; |
|
486 |
+import SvgIcon from "@jamescoyle/vue-icon"; |
|
487 |
+import { mdiMagnify, mdiHeart, mdiWindowClose } from "@mdi/js"; |
|
488 |
+import axios from "axios"; |
|
489 |
+import { mapGetters } from "vuex"; |
|
242 | 490 |
|
243 | 491 |
export default { |
244 |
- data() { |
|
245 |
- return { |
|
246 |
- items: [ |
|
247 |
- { |
|
248 |
- imgSrc1: 'client/resources/img/img11_1_s.png', |
|
249 |
- imgSrc2: 'client/resources/img/img12_1_s.png', |
|
250 |
- imgSrc3: 'client/resources/img/img11_2_s.png', |
|
251 |
- imgSrc4: 'client/resources/img/img12_2_s.png', |
|
252 |
- isSecondImageVisible: false |
|
253 |
- }, |
|
254 |
- ], |
|
255 |
- mdiMagnify: mdiMagnify, |
|
256 |
- mdiWindowClose: mdiWindowClose, |
|
257 |
- mdiHeart: mdiHeart, |
|
258 |
- showModal: false, |
|
259 |
- searchOpen: false, // 사진 상세보기 모달창 |
|
260 |
- searchOpen2: false, // 단원 마친 후, 사진 촬영 여부 선택 모달창 |
|
261 |
- showCameraModal: false, // 카메라 모달창 |
|
262 |
- photoTaken: false, |
|
263 |
- photo: null, //캡쳐 사진 |
|
264 |
- stream: null, |
|
492 |
+ data() { |
|
493 |
+ return { |
|
494 |
+ items: [ |
|
495 |
+ { |
|
496 |
+ imgSrc1: "client/resources/img/img11_1_s.png", |
|
497 |
+ imgSrc2: "client/resources/img/img12_1_s.png", |
|
498 |
+ imgSrc3: "client/resources/img/img11_2_s.png", |
|
499 |
+ imgSrc4: "client/resources/img/img12_2_s.png", |
|
500 |
+ isSecondImageVisible: false, |
|
501 |
+ }, |
|
502 |
+ ], |
|
503 |
+ mdiMagnify: mdiMagnify, |
|
504 |
+ mdiWindowClose: mdiWindowClose, |
|
505 |
+ mdiHeart: mdiHeart, |
|
506 |
+ showModal: false, |
|
507 |
+ searchOpen: false, // 사진 상세보기 모달창 |
|
508 |
+ searchOpen2: false, // 단원 마친 후, 사진 촬영 여부 선택 모달창 |
|
509 |
+ showCameraModal: false, // 카메라 모달창 |
|
510 |
+ photoTaken: false, |
|
511 |
+ photo: null, //캡쳐 사진 |
|
512 |
+ stream: null, |
|
265 | 513 |
|
514 |
+ roadmapData: [], |
|
515 |
+ labeledItems: [], |
|
266 | 516 |
|
267 |
- roadmapData: [], |
|
268 |
- labeledItems: [], |
|
517 |
+ problemCounter: 0, |
|
518 |
+ wordCounter: 0, |
|
519 |
+ textCounter: 0, |
|
520 |
+ evalCounter: 0, |
|
521 |
+ book_id: null, |
|
522 |
+ unit_id: null, |
|
269 | 523 |
|
270 |
- problemCounter: 0, |
|
271 |
- wordCounter: 0, |
|
272 |
- textCounter: 0, |
|
273 |
- evalCounter: 0, |
|
274 |
- book_id: null, |
|
275 |
- unit_id: null, |
|
524 |
+ schedules: [], |
|
525 |
+ nowSchedule: "", |
|
526 |
+ state: "", |
|
527 |
+ rabbitPos: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], |
|
528 |
+ rabbitCompl: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], |
|
529 |
+ rabbitEnd: false, |
|
276 | 530 |
|
277 |
- schedules: [], |
|
278 |
- nowSchedule: "", |
|
279 |
- state: '', |
|
280 |
- rabbitPos: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], |
|
281 |
- rabbitCompl: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], |
|
282 |
- rabbitEnd: false, |
|
531 |
+ titleUnitName: "", |
|
532 |
+ titleBookName: "", |
|
283 | 533 |
|
284 |
- titleUnitName: "", |
|
285 |
- titleBookName: "", |
|
534 |
+ images: [], |
|
535 |
+ unit_id: "", |
|
536 |
+ book_id: "", |
|
537 |
+ }; |
|
538 |
+ }, |
|
539 |
+ methods: { |
|
540 |
+ checkAndFetchData() { |
|
541 |
+ console.log("받은 Book ID:", this.getBookId); |
|
542 |
+ console.log("받은 Unit ID:", this.getUnitId); |
|
543 |
+ const book_id = this.getBookId; |
|
544 |
+ const unit_id = this.getUnitId; |
|
286 | 545 |
|
287 |
- images: [], |
|
288 |
- unit_id: "", |
|
289 |
- book_id: "", |
|
290 |
- } |
|
546 |
+ if (!book_id || !unit_id) { |
|
547 |
+ console.error("book_id 또는 unit_id가 설정되지 않았습니다."); |
|
548 |
+ return; |
|
549 |
+ } |
|
550 |
+ this.fetchImage(unit_id); |
|
551 |
+ this.fetchSchedule(unit_id, book_id); |
|
552 |
+ this.fetchRoadmapData(unit_id, book_id); |
|
553 |
+ this.fetchRabbit(); |
|
554 |
+ |
|
555 |
+ this.unit_id = unit_id; |
|
556 |
+ this.book_id = book_id; |
|
557 |
+ |
|
558 |
+ if (this.$route.query.reCapture == "true") { |
|
559 |
+ this.openCameraModal(); |
|
560 |
+ } |
|
291 | 561 |
}, |
292 |
- methods: { |
|
293 |
- checkAndFetchData() { |
|
294 |
- console.log("받은 Book ID:", this.getBookId); |
|
295 |
- console.log("받은 Unit ID:", this.getUnitId); |
|
296 |
- const book_id = this.getBookId; |
|
297 |
- const unit_id = this.getUnitId; |
|
298 | 562 |
|
299 |
- if (!book_id || !unit_id) { |
|
300 |
- console.error("book_id 또는 unit_id가 설정되지 않았습니다."); |
|
301 |
- return; |
|
302 |
- } |
|
303 |
- this.fetchImage(unit_id); |
|
304 |
- this.fetchSchedule(unit_id, book_id); |
|
305 |
- this.fetchRoadmapData(unit_id, book_id); |
|
306 |
- this.fetchRabbit(); |
|
307 |
- |
|
308 |
- this.unit_id = unit_id |
|
309 |
- this.book_id = book_id |
|
310 |
- |
|
311 |
- if (this.$route.query.reCapture == 'true') { |
|
312 |
- this.openCameraModal() |
|
313 |
- } |
|
563 |
+ //은진 |
|
564 |
+ async findFile(file_mng_id) { |
|
565 |
+ try { |
|
566 |
+ const res = await axios({ |
|
567 |
+ url: "/file/find.json", |
|
568 |
+ method: "post", |
|
569 |
+ headers: { |
|
570 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
571 |
+ }, |
|
572 |
+ data: { |
|
573 |
+ file_mng_id: file_mng_id, |
|
574 |
+ }, |
|
575 |
+ }); |
|
576 |
+ return res.data.list[0]; |
|
577 |
+ } catch (error) { |
|
578 |
+ console.log("result - error : ", error); |
|
579 |
+ return null; |
|
580 |
+ } |
|
581 |
+ }, |
|
582 |
+ fetchImage(unit_id) { |
|
583 |
+ axios({ |
|
584 |
+ url: "/photo/photoUnitList.json", |
|
585 |
+ method: "post", |
|
586 |
+ headers: { |
|
587 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
314 | 588 |
}, |
315 |
- |
|
316 |
- //은진 |
|
317 |
- async findFile(file_mng_id) { |
|
318 |
- try { |
|
319 |
- const res = await axios({ |
|
320 |
- url: "/file/find.json", |
|
321 |
- method: "post", |
|
322 |
- headers: { |
|
323 |
- "Content-Type": "application/json; charset=UTF-8", |
|
324 |
- }, |
|
325 |
- data: { |
|
326 |
- file_mng_id: file_mng_id, |
|
327 |
- }, |
|
328 |
- }); |
|
329 |
- return res.data.list[0]; |
|
330 |
- } catch (error) { |
|
331 |
- console.log("result - error : ", error); |
|
332 |
- return null; |
|
333 |
- } |
|
589 |
+ data: { |
|
590 |
+ unitId: unit_id, |
|
591 |
+ sclsId: "1", |
|
334 | 592 |
}, |
335 |
- fetchImage(unit_id) { |
|
336 |
- axios({ |
|
337 |
- url: "/photo/photoUnitList.json", |
|
338 |
- method: "post", |
|
339 |
- headers: { |
|
340 |
- "Content-Type": "application/json; charset=UTF-8", |
|
341 |
- }, |
|
342 |
- data: { |
|
343 |
- unitId: unit_id, |
|
344 |
- sclsId: "1" |
|
345 |
- } |
|
593 |
+ }) |
|
594 |
+ .then((response) => { |
|
595 |
+ this.file_mng_id = response.data; |
|
596 |
+ |
|
597 |
+ const findFilePromises = this.file_mng_id.map((id) => |
|
598 |
+ this.findFile(id.file_mng_id) |
|
599 |
+ ); |
|
600 |
+ |
|
601 |
+ return Promise.all(findFilePromises); |
|
602 |
+ }) |
|
603 |
+ .then((fileResults) => { |
|
604 |
+ // Format file results to include image URL |
|
605 |
+ this.images = fileResults |
|
606 |
+ .map((file) => { |
|
607 |
+ if (file) { |
|
608 |
+ return { |
|
609 |
+ url: "http://localhost:9080/" + `${file.fileRpath}`, |
|
610 |
+ fileId: file.fileId, |
|
611 |
+ fileNm: file.fileNm, |
|
612 |
+ // Add any other properties you need here |
|
613 |
+ }; |
|
614 |
+ } |
|
615 |
+ return null; |
|
346 | 616 |
}) |
347 |
- .then(response => { |
|
348 |
- this.file_mng_id = response.data; |
|
617 |
+ .filter((image) => image !== null); |
|
618 |
+ }) |
|
619 |
+ .catch((error) => { |
|
620 |
+ console.error("Error fetching images:", error); |
|
621 |
+ }); |
|
622 |
+ }, |
|
623 |
+ goToPageImg(page) { |
|
624 |
+ const canvas = document.querySelector("canvas"); |
|
625 |
+ const dataURL = canvas.toDataURL("image/png"); |
|
349 | 626 |
|
350 |
- const findFilePromises = this.file_mng_id.map(id => |
|
351 |
- this.findFile(id.file_mng_id) |
|
352 |
- ); |
|
627 |
+ this.$router.push({ |
|
628 |
+ name: page, |
|
629 |
+ query: { image: encodeURIComponent(dataURL) }, |
|
630 |
+ }); |
|
631 |
+ }, |
|
353 | 632 |
|
354 |
- return Promise.all(findFilePromises); |
|
355 |
- }) |
|
356 |
- .then(fileResults => { |
|
357 |
- // Format file results to include image URL |
|
358 |
- this.images = fileResults.map(file => { |
|
359 |
- if (file) { |
|
360 |
- return { |
|
361 |
- url: "http://localhost:9080/" + `${file.fileRpath}`, |
|
362 |
- fileId: file.fileId, |
|
363 |
- fileNm: file.fileNm, |
|
364 |
- // Add any other properties you need here |
|
365 |
- }; |
|
366 |
- } |
|
367 |
- return null; |
|
368 |
- }).filter(image => image !== null); |
|
369 |
- }) |
|
370 |
- .catch(error => { |
|
371 |
- console.error("Error fetching images:", error); |
|
372 |
- }); |
|
373 |
- }, |
|
374 |
- goToPageImg(page) { |
|
375 |
- const canvas = document.querySelector('canvas'); |
|
376 |
- const dataURL = canvas.toDataURL('image/png'); |
|
633 |
+ fetchRabbit() { |
|
634 |
+ for (var i = 0; i < 12; i++) { |
|
635 |
+ this.rabbitPos[i] = false; |
|
636 |
+ } |
|
377 | 637 |
|
378 |
- this.$router.push({ name: page, query: { image: encodeURIComponent(dataURL) } }); |
|
379 |
- }, |
|
638 |
+ if (this.$route.query.value) { |
|
639 |
+ this.rabbitPos[parseInt(this.$route.query.value, 10) + 1] = true; |
|
640 |
+ for (var i = 0; i < this.$route.query.value; i++) { |
|
641 |
+ this.rabbitCompl[i + 1] = true; |
|
642 |
+ } |
|
380 | 643 |
|
381 |
- fetchRabbit() { |
|
382 |
- for (var i = 0; i < 12; i++) { |
|
383 |
- this.rabbitPos[i] = false |
|
384 |
- } |
|
385 |
- |
|
386 |
- if (this.$route.query.value) { |
|
387 |
- this.rabbitPos[parseInt(this.$route.query.value, 10) + 1] = true |
|
388 |
- for (var i = 0; i < this.$route.query.value; i++) { |
|
389 |
- this.rabbitCompl[i + 1] = true |
|
390 |
- } |
|
391 |
- |
|
392 |
- if (this.$route.query.value === '11') { |
|
393 |
- this.rabbitEnd = true; |
|
394 |
- setTimeout(() => { |
|
395 |
- this.searchOpen2 = true; |
|
396 |
- }, 1000); |
|
397 |
- } |
|
398 |
- |
|
399 |
- } |
|
400 |
- else |
|
401 |
- this.rabbitPos[0] = true |
|
402 |
- }, |
|
403 |
- fetchSchedule(unit_id, book_id) { |
|
404 |
- axios({ |
|
405 |
- url: "/schedule/selectSchedule.json", |
|
406 |
- method: "post", |
|
407 |
- headers: { |
|
408 |
- "Content-Type": "application/json; charset=UTF-8", |
|
409 |
- }, |
|
410 |
- data: { |
|
411 |
- stdId: "2", |
|
412 |
- } |
|
413 |
- }).then(response => { |
|
414 |
- this.schedules = response.data; |
|
415 |
- |
|
416 |
- if (this.schedules.length == 0) { |
|
417 |
- this.state = 'notRegistered'; |
|
418 |
- } else { |
|
419 |
- const allFinished = this.schedules.every(schedule => schedule.finish === "T"); |
|
420 |
- if (allFinished) { |
|
421 |
- this.state = 'finish'; |
|
422 |
- } else { |
|
423 |
- this.nowSchedule = this.schedules.find(schedule => schedule.finish === null || schedule.finish === "F"); |
|
424 |
- if (this.nowSchedule) { |
|
425 |
- this.fetchRoadmapData(unit_id, book_id); |
|
426 |
- this.state = 'studying'; |
|
427 |
- } else { |
|
428 |
- this.state = 'notRegistered'; |
|
429 |
- } |
|
430 |
- } |
|
431 |
- } |
|
432 |
- }) |
|
433 |
- .catch(error => { |
|
434 |
- console.error("Error fetching roadmap data:", error); |
|
435 |
- }); |
|
436 |
- }, |
|
437 |
- finishSchedule() { |
|
438 |
- axios({ |
|
439 |
- url: "/schedule/scheduleUpdate.json", |
|
440 |
- method: "post", |
|
441 |
- headers: { |
|
442 |
- "Content-Type": "application/json; charset=UTF-8", |
|
443 |
- }, |
|
444 |
- data: { |
|
445 |
- scheduleId: this.nowSchedule.schdl_id, |
|
446 |
- finish: "T" |
|
447 |
- } |
|
448 |
- }) |
|
449 |
- .then(response => { |
|
450 |
- const nextSchedule = this.schedules.find(schedule => schedule.schdl_id > this.nowSchedule.schdl_id); |
|
451 |
- alert("학습을 완료했습니다!"); |
|
452 |
- |
|
453 |
- if (nextSchedule) { |
|
454 |
- this.nowSchedule = nextSchedule; |
|
455 |
- this.fetchSchedule(nextSchedule.unit_id, nextSchedule.book_id); |
|
456 |
- this.fetchRoadmapData(nextSchedule.unit_id, nextSchedule.book_id); |
|
457 |
- this.$router.push({ name: 'Dashboard', query: { unit_id: nextSchedule.unit_id, book_id: nextSchedule.book_id } }); |
|
458 |
- } else { |
|
459 |
- alert("모든 학습을 완료했습니다!"); |
|
460 |
- this.state = 'finish'; |
|
461 |
- } |
|
462 |
- }) |
|
463 |
- .catch(error => { |
|
464 |
- console.error("Error updating schedule:", error); |
|
465 |
- }); |
|
466 |
- }, |
|
467 |
- fetchRoadmapData(unit_id, book_id) { |
|
468 |
- axios({ |
|
469 |
- url: "/unitLearning/find.json", |
|
470 |
- method: "post", |
|
471 |
- headers: { |
|
472 |
- "Content-Type": "application/json; charset=UTF-8", |
|
473 |
- }, |
|
474 |
- data: { |
|
475 |
- unit_id: unit_id, |
|
476 |
- book_id: book_id |
|
477 |
- } |
|
478 |
- }) |
|
479 |
- .then(response => { |
|
480 |
- if (response.data.length != 0) { |
|
481 |
- this.roadmapData = response.data; |
|
482 |
- this.titleUnitName = this.roadmapData[0].unit_nm |
|
483 |
- this.titleBookName = this.roadmapData[0].book_nm |
|
484 |
- this.labeledItems = this.processedRoadmap; |
|
485 |
- } else { |
|
486 |
- this.state = "noProblem" |
|
487 |
- } |
|
488 |
- }) |
|
489 |
- .catch(error => { |
|
490 |
- this.state = "noProblem" |
|
491 |
- console.error("Error fetching roadmap data:", error); |
|
492 |
- }); |
|
493 |
- }, |
|
494 |
- toggleImage(index) { |
|
495 |
- this.items[index].isSecondImageVisible = !this.items[index].isSecondImageVisible; |
|
496 |
- }, |
|
497 |
- ShowPopup() { |
|
498 |
- this.searchOpen2 = true; // 촬영 여부 묻는 모달창 열기 |
|
499 |
- }, |
|
500 |
- goToPage(page) { |
|
501 |
- const { unit_id, book_id } = this.$route.query; |
|
502 |
- this.$router.push({ name: page, query: { unit_id, book_id } }); |
|
503 |
- }, |
|
504 |
- openCameraModal() { |
|
505 |
- this.closeModal(); |
|
506 |
- |
|
507 |
- this.showCameraModal = true; |
|
508 |
- navigator.mediaDevices.getUserMedia({ video: true }) |
|
509 |
- .then(stream => { |
|
510 |
- const modalVideo = this.$refs.modalVideoElement; |
|
511 |
- modalVideo.srcObject = stream; |
|
512 |
- this.stream = stream; |
|
513 |
- }) |
|
514 |
- .catch(error => { |
|
515 |
- console.log("error>>>>>>>>", error); |
|
516 |
- }); |
|
517 |
- }, |
|
518 |
- closeModal() { //웹캠 및 모든 팝업 닫기 |
|
519 |
- // this.showModal = false; |
|
520 |
- this.searchOpen = false; |
|
521 |
- this.searchOpen2 = false; |
|
522 |
- this.showCameraModal = false; |
|
523 |
- this.photoTaken = false; |
|
524 |
- this.photo = null; |
|
525 |
- |
|
526 |
- //스트림 종료 |
|
527 |
- if (this.stream) { |
|
528 |
- let tracks = this.stream.getTracks(); |
|
529 |
- tracks.forEach(track => track.stop()); |
|
530 |
- this.stream = null; |
|
531 |
- } |
|
532 |
- }, |
|
533 |
- |
|
534 |
- onVideoLoaded() { |
|
535 |
- const video = this.$refs.modalVideoElement; |
|
536 |
- const canvas = this.$refs.canvas; |
|
537 |
- const ctx = canvas.getContext('2d'); |
|
538 |
- |
|
539 |
- canvas.width = video.videoWidth; |
|
540 |
- canvas.height = video.videoHeight; |
|
541 |
- }, takePhoto() { |
|
542 |
- const video = this.$refs.modalVideoElement; |
|
543 |
- const canvas = this.$refs.canvas; |
|
544 |
- const ctx = canvas.getContext('2d'); |
|
545 |
- |
|
546 |
- ctx.save(); // 현재 상태 저장 |
|
547 |
- |
|
548 |
- // 캔버스 좌우 반전 |
|
549 |
- ctx.scale(-1, 1); |
|
550 |
- ctx.drawImage(video, -canvas.width, 0, canvas.width, canvas.height); |
|
551 |
- |
|
552 |
- ctx.restore(); |
|
553 |
- |
|
554 |
- const overlayImg = new Image(); |
|
555 |
- overlayImg.src = 'client/resources/img/camera-rabbit.png'; |
|
556 |
- overlayImg.onload = () => { |
|
557 |
- const overlayWidth = canvas.width * 0.4; |
|
558 |
- const overlayHeight = (overlayImg.height / overlayImg.width) * overlayWidth; |
|
559 |
- const overlayX = canvas.width - overlayWidth; |
|
560 |
- const overlayY = canvas.height - overlayHeight; |
|
561 |
- |
|
562 |
- // 오버레이 이미지 그리기 |
|
563 |
- ctx.drawImage(overlayImg, overlayX, overlayY, overlayWidth, overlayHeight); |
|
564 |
- |
|
565 |
- // 사진 저장 함수 호출 |
|
566 |
- const dataURL = canvas.toDataURL('image/png'); |
|
567 |
- this.$router.push({ name: 'PhotoEdit', query: { image: encodeURIComponent(dataURL), unit_id: this.unit_id, book_id: this.book_id } }); |
|
568 |
- }; |
|
569 |
- }, |
|
570 |
- |
|
571 |
- |
|
572 |
- |
|
573 |
- buttonSearch() { |
|
574 |
- this.searchOpen = true; |
|
575 |
- }, |
|
576 |
- buttonSearch2() { |
|
644 |
+ if (this.$route.query.value === "11") { |
|
645 |
+ this.rabbitEnd = true; |
|
646 |
+ setTimeout(() => { |
|
577 | 647 |
this.searchOpen2 = true; |
578 |
- }, |
|
579 |
- closeBtn() { |
|
580 |
- this.searchOpen = false; |
|
581 |
- }, |
|
582 |
- }, |
|
583 |
- components: { |
|
584 |
- SvgIcon, |
|
585 |
- }, |
|
586 |
- mounted() { |
|
587 |
- console.log('main mounted'); |
|
588 |
- this.checkAndFetchData(); |
|
589 |
- // const { book_id, unit_id } = this.$route.query; |
|
590 |
- }, |
|
591 |
- watch: { |
|
592 |
- getBookId(newBookId) { |
|
593 |
- this.checkAndFetchData(); |
|
594 |
- }, |
|
595 |
- getUnitId(newUnitId) { |
|
596 |
- this.checkAndFetchData(); |
|
648 |
+ }, 1000); |
|
597 | 649 |
} |
650 |
+ } else this.rabbitPos[0] = true; |
|
598 | 651 |
}, |
599 |
- computed: { |
|
600 |
- ...mapGetters(['getBookId', 'getUnitId']), |
|
652 |
+ fetchSchedule(unit_id, book_id) { |
|
653 |
+ axios({ |
|
654 |
+ url: "/schedule/selectSchedule.json", |
|
655 |
+ method: "post", |
|
656 |
+ headers: { |
|
657 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
658 |
+ }, |
|
659 |
+ data: { |
|
660 |
+ stdId: "2", |
|
661 |
+ }, |
|
662 |
+ }) |
|
663 |
+ .then((response) => { |
|
664 |
+ this.schedules = response.data; |
|
601 | 665 |
|
602 |
- processedRoadmap() { |
|
603 |
- let problemCounter = 0; |
|
604 |
- let wordCounter = 0; |
|
605 |
- let textCounter = 0; |
|
606 |
- let evalCounter = 0; |
|
666 |
+ if (this.schedules.length == 0) { |
|
667 |
+ this.state = "notRegistered"; |
|
668 |
+ } else { |
|
669 |
+ const allFinished = this.schedules.every( |
|
670 |
+ (schedule) => schedule.finish === "T" |
|
671 |
+ ); |
|
672 |
+ if (allFinished) { |
|
673 |
+ this.state = "finish"; |
|
674 |
+ } else { |
|
675 |
+ this.nowSchedule = this.schedules.find( |
|
676 |
+ (schedule) => |
|
677 |
+ schedule.finish === null || schedule.finish === "F" |
|
678 |
+ ); |
|
679 |
+ if (this.nowSchedule) { |
|
680 |
+ this.fetchRoadmapData(unit_id, book_id); |
|
681 |
+ this.state = "studying"; |
|
682 |
+ } else { |
|
683 |
+ this.state = "notRegistered"; |
|
684 |
+ } |
|
685 |
+ } |
|
686 |
+ } |
|
687 |
+ }) |
|
688 |
+ .catch((error) => { |
|
689 |
+ console.error("Error fetching roadmap data:", error); |
|
690 |
+ }); |
|
691 |
+ }, |
|
692 |
+ finishSchedule() { |
|
693 |
+ axios({ |
|
694 |
+ url: "/schedule/scheduleUpdate.json", |
|
695 |
+ method: "post", |
|
696 |
+ headers: { |
|
697 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
698 |
+ }, |
|
699 |
+ data: { |
|
700 |
+ scheduleId: this.nowSchedule.schdl_id, |
|
701 |
+ finish: "T", |
|
702 |
+ }, |
|
703 |
+ }) |
|
704 |
+ .then((response) => { |
|
705 |
+ const nextSchedule = this.schedules.find( |
|
706 |
+ (schedule) => schedule.schdl_id > this.nowSchedule.schdl_id |
|
707 |
+ ); |
|
708 |
+ alert("학습을 완료했습니다!"); |
|
607 | 709 |
|
608 |
- return this.roadmapData.map(item => { |
|
609 |
- if (item.wd_book_id !== null) { |
|
610 |
- wordCounter++; |
|
611 |
- return `단어장${wordCounter}`; |
|
612 |
- } else if (item.text_id !== null) { |
|
613 |
- textCounter++; |
|
614 |
- return `지문${textCounter}`; |
|
615 |
- } else if (item.eval_id !== null) { |
|
616 |
- evalCounter++; |
|
617 |
- return evalCounter === 1 ? '중간평가' : '최종평가'; |
|
618 |
- } else { |
|
619 |
- problemCounter++; |
|
620 |
- return `문제${problemCounter}`; |
|
621 |
- } |
|
710 |
+ if (nextSchedule) { |
|
711 |
+ this.nowSchedule = nextSchedule; |
|
712 |
+ this.fetchSchedule(nextSchedule.unit_id, nextSchedule.book_id); |
|
713 |
+ this.fetchRoadmapData(nextSchedule.unit_id, nextSchedule.book_id); |
|
714 |
+ this.$router.push({ |
|
715 |
+ name: "Dashboard", |
|
716 |
+ query: { |
|
717 |
+ unit_id: nextSchedule.unit_id, |
|
718 |
+ book_id: nextSchedule.book_id, |
|
719 |
+ }, |
|
622 | 720 |
}); |
623 |
- } |
|
721 |
+ } else { |
|
722 |
+ alert("모든 학습을 완료했습니다!"); |
|
723 |
+ this.state = "finish"; |
|
724 |
+ } |
|
725 |
+ }) |
|
726 |
+ .catch((error) => { |
|
727 |
+ console.error("Error updating schedule:", error); |
|
728 |
+ }); |
|
624 | 729 |
}, |
625 |
- beforeDestroy() { |
|
626 |
- // 컴포넌트가 파괴되기 전에 리스너 제거 |
|
627 |
- window.removeEventListener('resize', this.updateCanvasRect); |
|
628 |
- this.$refs.canvas.removeEventListener('click', this.handleCanvasClick); |
|
629 |
- } |
|
630 |
-} |
|
730 |
+ fetchRoadmapData(unit_id, book_id) { |
|
731 |
+ axios({ |
|
732 |
+ url: "/unitLearning/find.json", |
|
733 |
+ method: "post", |
|
734 |
+ headers: { |
|
735 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
736 |
+ }, |
|
737 |
+ data: { |
|
738 |
+ unit_id: unit_id, |
|
739 |
+ book_id: book_id, |
|
740 |
+ }, |
|
741 |
+ }) |
|
742 |
+ .then((response) => { |
|
743 |
+ if (response.data.length != 0) { |
|
744 |
+ this.roadmapData = response.data; |
|
745 |
+ this.titleUnitName = this.roadmapData[0].unit_nm; |
|
746 |
+ this.titleBookName = this.roadmapData[0].book_nm; |
|
747 |
+ this.labeledItems = this.processedRoadmap; |
|
748 |
+ } else { |
|
749 |
+ this.state = "noProblem"; |
|
750 |
+ } |
|
751 |
+ }) |
|
752 |
+ .catch((error) => { |
|
753 |
+ this.state = "noProblem"; |
|
754 |
+ console.error("Error fetching roadmap data:", error); |
|
755 |
+ }); |
|
756 |
+ }, |
|
757 |
+ toggleImage(index) { |
|
758 |
+ this.items[index].isSecondImageVisible = |
|
759 |
+ !this.items[index].isSecondImageVisible; |
|
760 |
+ }, |
|
761 |
+ ShowPopup() { |
|
762 |
+ this.searchOpen2 = true; // 촬영 여부 묻는 모달창 열기 |
|
763 |
+ }, |
|
764 |
+ goToPage(page) { |
|
765 |
+ const { unit_id, book_id } = this.$route.query; |
|
766 |
+ this.$router.push({ name: page, query: { unit_id, book_id } }); |
|
767 |
+ }, |
|
768 |
+ openCameraModal() { |
|
769 |
+ this.closeModal(); |
|
770 |
+ |
|
771 |
+ this.showCameraModal = true; |
|
772 |
+ navigator.mediaDevices |
|
773 |
+ .getUserMedia({ video: true }) |
|
774 |
+ .then((stream) => { |
|
775 |
+ const modalVideo = this.$refs.modalVideoElement; |
|
776 |
+ modalVideo.srcObject = stream; |
|
777 |
+ this.stream = stream; |
|
778 |
+ }) |
|
779 |
+ .catch((error) => { |
|
780 |
+ console.log("error>>>>>>>>", error); |
|
781 |
+ alert("웹캠이 필요한 기능입니다!"); |
|
782 |
+ this.closeModal(); // 모달창을 닫음 |
|
783 |
+ }); |
|
784 |
+ }, |
|
785 |
+ closeModal() { |
|
786 |
+ //웹캠 및 모든 팝업 닫기 |
|
787 |
+ // this.showModal = false; |
|
788 |
+ this.searchOpen = false; |
|
789 |
+ this.searchOpen2 = false; |
|
790 |
+ this.showCameraModal = false; |
|
791 |
+ this.photoTaken = false; |
|
792 |
+ this.photo = null; |
|
793 |
+ |
|
794 |
+ //스트림 종료 |
|
795 |
+ if (this.stream) { |
|
796 |
+ let tracks = this.stream.getTracks(); |
|
797 |
+ tracks.forEach((track) => track.stop()); |
|
798 |
+ this.stream = null; |
|
799 |
+ } |
|
800 |
+ }, |
|
801 |
+ |
|
802 |
+ onVideoLoaded() { |
|
803 |
+ const video = this.$refs.modalVideoElement; |
|
804 |
+ const canvas = this.$refs.canvas; |
|
805 |
+ const ctx = canvas.getContext("2d"); |
|
806 |
+ |
|
807 |
+ canvas.width = video.videoWidth; |
|
808 |
+ canvas.height = video.videoHeight; |
|
809 |
+ }, |
|
810 |
+ takePhoto() { |
|
811 |
+ const video = this.$refs.modalVideoElement; |
|
812 |
+ const canvas = this.$refs.canvas; |
|
813 |
+ const ctx = canvas.getContext("2d"); |
|
814 |
+ |
|
815 |
+ ctx.save(); // 현재 상태 저장 |
|
816 |
+ |
|
817 |
+ // 캔버스 좌우 반전 |
|
818 |
+ ctx.scale(-1, 1); |
|
819 |
+ ctx.drawImage(video, -canvas.width, 0, canvas.width, canvas.height); |
|
820 |
+ |
|
821 |
+ ctx.restore(); |
|
822 |
+ |
|
823 |
+ const overlayImg = new Image(); |
|
824 |
+ overlayImg.src = "client/resources/img/camera-rabbit.png"; |
|
825 |
+ overlayImg.onload = () => { |
|
826 |
+ const overlayWidth = canvas.width * 0.4; |
|
827 |
+ const overlayHeight = |
|
828 |
+ (overlayImg.height / overlayImg.width) * overlayWidth; |
|
829 |
+ const overlayX = canvas.width - overlayWidth; |
|
830 |
+ const overlayY = canvas.height - overlayHeight; |
|
831 |
+ |
|
832 |
+ // 오버레이 이미지 그리기 |
|
833 |
+ ctx.drawImage( |
|
834 |
+ overlayImg, |
|
835 |
+ overlayX, |
|
836 |
+ overlayY, |
|
837 |
+ overlayWidth, |
|
838 |
+ overlayHeight |
|
839 |
+ ); |
|
840 |
+ |
|
841 |
+ // 사진 저장 함수 호출 |
|
842 |
+ const dataURL = canvas.toDataURL("image/png"); |
|
843 |
+ this.$router.push({ |
|
844 |
+ name: "PhotoEdit", |
|
845 |
+ query: { |
|
846 |
+ image: encodeURIComponent(dataURL), |
|
847 |
+ unit_id: this.unit_id, |
|
848 |
+ book_id: this.book_id, |
|
849 |
+ }, |
|
850 |
+ }); |
|
851 |
+ }; |
|
852 |
+ }, |
|
853 |
+ |
|
854 |
+ buttonSearch() { |
|
855 |
+ this.searchOpen = true; |
|
856 |
+ }, |
|
857 |
+ buttonSearch2() { |
|
858 |
+ this.searchOpen2 = true; |
|
859 |
+ }, |
|
860 |
+ closeBtn() { |
|
861 |
+ this.searchOpen = false; |
|
862 |
+ }, |
|
863 |
+ }, |
|
864 |
+ components: { |
|
865 |
+ SvgIcon, |
|
866 |
+ }, |
|
867 |
+ mounted() { |
|
868 |
+ console.log("main mounted"); |
|
869 |
+ this.checkAndFetchData(); |
|
870 |
+ // const { book_id, unit_id } = this.$route.query; |
|
871 |
+ }, |
|
872 |
+ watch: { |
|
873 |
+ getBookId(newBookId) { |
|
874 |
+ this.checkAndFetchData(); |
|
875 |
+ }, |
|
876 |
+ getUnitId(newUnitId) { |
|
877 |
+ this.checkAndFetchData(); |
|
878 |
+ }, |
|
879 |
+ }, |
|
880 |
+ computed: { |
|
881 |
+ ...mapGetters(["getBookId", "getUnitId"]), |
|
882 |
+ |
|
883 |
+ processedRoadmap() { |
|
884 |
+ let problemCounter = 0; |
|
885 |
+ let wordCounter = 0; |
|
886 |
+ let textCounter = 0; |
|
887 |
+ let evalCounter = 0; |
|
888 |
+ |
|
889 |
+ return this.roadmapData.map((item) => { |
|
890 |
+ if (item.wd_book_id !== null) { |
|
891 |
+ wordCounter++; |
|
892 |
+ return `단어장${wordCounter}`; |
|
893 |
+ } else if (item.text_id !== null) { |
|
894 |
+ textCounter++; |
|
895 |
+ return `지문${textCounter}`; |
|
896 |
+ } else if (item.eval_id !== null) { |
|
897 |
+ evalCounter++; |
|
898 |
+ return evalCounter === 1 ? "중간평가" : "최종평가"; |
|
899 |
+ } else { |
|
900 |
+ problemCounter++; |
|
901 |
+ return `문제${problemCounter}`; |
|
902 |
+ } |
|
903 |
+ }); |
|
904 |
+ }, |
|
905 |
+ }, |
|
906 |
+ beforeDestroy() { |
|
907 |
+ // 컴포넌트가 파괴되기 전에 리스너 제거 |
|
908 |
+ window.removeEventListener("resize", this.updateCanvasRect); |
|
909 |
+ this.$refs.canvas.removeEventListener("click", this.handleCanvasClick); |
|
910 |
+ }, |
|
911 |
+}; |
|
631 | 912 |
</script> |
632 | 913 |
|
633 | 914 |
<style scoped> |
634 | 915 |
.body { |
635 |
- width: 1435px; |
|
636 |
- height: auto; |
|
637 |
- margin: 0 auto; |
|
916 |
+ width: 1435px; |
|
917 |
+ height: auto; |
|
918 |
+ margin: 0 auto; |
|
638 | 919 |
} |
639 | 920 |
|
640 | 921 |
#container { |
641 |
- position: relative; |
|
642 |
- margin: auto; |
|
643 |
- border: 10px #333 solid; |
|
644 |
- display: flex; |
|
645 |
- justify-content: center; |
|
646 |
- align-items: center; |
|
647 |
- z-index: 100; |
|
922 |
+ position: relative; |
|
923 |
+ margin: auto; |
|
924 |
+ border: 10px #333 solid; |
|
925 |
+ display: flex; |
|
926 |
+ justify-content: center; |
|
927 |
+ align-items: center; |
|
928 |
+ z-index: 100; |
|
648 | 929 |
} |
649 | 930 |
|
650 | 931 |
video { |
651 |
- width: 100%; |
|
652 |
- height: auto; |
|
653 |
- background-color: #666; |
|
932 |
+ width: 100%; |
|
933 |
+ height: 100%; |
|
934 |
+ background-color: #666; |
|
654 | 935 |
} |
655 | 936 |
|
656 | 937 |
.mirrored { |
657 |
- transform: scaleX(-1); |
|
938 |
+ transform: scaleX(-1); |
|
658 | 939 |
} |
659 | 940 |
|
660 | 941 |
.new-btn:disabled { |
661 |
- background-color: #FFF3D7; |
|
662 |
- cursor: not-allowed; |
|
942 |
+ background-color: #fff3d7; |
|
943 |
+ cursor: not-allowed; |
|
663 | 944 |
} |
664 | 945 |
|
665 | 946 |
.sticker { |
666 |
- position: absolute; |
|
667 |
- cursor: move; |
|
947 |
+ position: absolute; |
|
948 |
+ cursor: move; |
|
668 | 949 |
} |
669 | 950 |
|
670 | 951 |
.sticker-handle { |
671 |
- width: 15px; |
|
672 |
- height: 15px; |
|
673 |
- background: rgba(255, 255, 255, 0.521); |
|
674 |
- position: absolute; |
|
675 |
- bottom: 0; |
|
676 |
- right: 0; |
|
677 |
- cursor: nwse-resize; |
|
678 |
- font-size: 13px; |
|
679 |
- font-weight: bolder; |
|
680 |
- color: rgb(63, 63, 63); |
|
952 |
+ width: 15px; |
|
953 |
+ height: 15px; |
|
954 |
+ background: rgba(255, 255, 255, 0.521); |
|
955 |
+ position: absolute; |
|
956 |
+ bottom: 0; |
|
957 |
+ right: 0; |
|
958 |
+ cursor: nwse-resize; |
|
959 |
+ font-size: 13px; |
|
960 |
+ font-weight: bolder; |
|
961 |
+ color: rgb(63, 63, 63); |
|
681 | 962 |
} |
682 | 963 |
|
683 | 964 |
.sticker-delete { |
684 |
- position: absolute; |
|
685 |
- top: 0; |
|
686 |
- right: 0; |
|
687 |
- background: rgba(255, 0, 0, 0.425); |
|
688 |
- color: white; |
|
689 |
- padding: 5px; |
|
690 |
- cursor: pointer; |
|
965 |
+ position: absolute; |
|
966 |
+ top: 0; |
|
967 |
+ right: 0; |
|
968 |
+ background: rgba(255, 0, 0, 0.425); |
|
969 |
+ color: white; |
|
970 |
+ padding: 5px; |
|
971 |
+ cursor: pointer; |
|
691 | 972 |
} |
692 | 973 |
|
693 | 974 |
.toolbar { |
694 |
- display: flex; |
|
695 |
- justify-content: center; |
|
696 |
- margin-top: 10px; |
|
975 |
+ display: flex; |
|
976 |
+ justify-content: center; |
|
977 |
+ margin-top: 10px; |
|
697 | 978 |
} |
698 | 979 |
|
699 | 980 |
.toolbar button { |
700 |
- margin: 5px; |
|
701 |
- padding: 5px 10px; |
|
702 |
- cursor: pointer; |
|
981 |
+ margin: 5px; |
|
982 |
+ padding: 5px 10px; |
|
983 |
+ cursor: pointer; |
|
703 | 984 |
} |
704 | 985 |
|
705 | 986 |
.toolbar input { |
706 |
- margin: 5px; |
|
987 |
+ margin: 5px; |
|
707 | 988 |
} |
708 | 989 |
|
709 | 990 |
.rabbit-end { |
710 |
- cursor: pointer; |
|
711 |
- display: block; |
|
712 |
- position: absolute; |
|
713 |
- bottom: 0px; |
|
714 |
- left: -15px; |
|
715 |
- z-index: 10000; |
|
991 |
+ cursor: pointer; |
|
992 |
+ display: block; |
|
993 |
+ position: absolute; |
|
994 |
+ bottom: 0px; |
|
995 |
+ left: -15px; |
|
996 |
+ z-index: 10000; |
|
716 | 997 |
} |
717 | 998 |
|
718 | 999 |
.rabbit-running { |
719 |
- position: absolute; |
|
720 |
- bottom: 40px; |
|
721 |
- right: 110px; |
|
722 |
- z-index: 10000; |
|
723 |
- transform: scaleX(-1); |
|
724 |
- transition: all 0.5s ease-in-out; |
|
1000 |
+ position: absolute; |
|
1001 |
+ bottom: 40px; |
|
1002 |
+ right: 110px; |
|
1003 |
+ z-index: 10000; |
|
1004 |
+ transform: scaleX(-1); |
|
1005 |
+ transition: all 0.5s ease-in-out; |
|
725 | 1006 |
} |
726 | 1007 |
|
727 | 1008 |
.fireworks-end { |
728 |
- position: absolute; |
|
729 |
- bottom: 70px; |
|
730 |
- left: -40px; |
|
731 |
- width: 20rem; |
|
1009 |
+ position: absolute; |
|
1010 |
+ bottom: 70px; |
|
1011 |
+ left: -40px; |
|
1012 |
+ width: 20rem; |
|
732 | 1013 |
} |
733 |
- |
|
734 | 1014 |
|
735 | 1015 |
.camera-rabbit { |
736 |
- position: absolute; |
|
737 |
- right: 0; |
|
738 |
- bottom: 0; |
|
739 |
- width: 40%; |
|
1016 |
+ position: absolute; |
|
1017 |
+ right: 0; |
|
1018 |
+ bottom: 0; |
|
1019 |
+ width: 40%; |
|
740 | 1020 |
} |
741 |
-</style>(파일 끝에 줄바꿈 문자 없음) |
|
1021 |
+</style> |
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?