

240822 정다정 대시보드와 지문 연결
@d76fdd284081f6367fcb6622dde2a7034db1219d
--- client/views/pages/main/Chapter/Chapter1_2.vue
+++ client/views/pages/main/Chapter/Chapter1_2.vue
... | ... | @@ -51,7 +51,6 @@ |
51 | 51 |
export default { |
52 | 52 |
data() { |
53 | 53 |
return { |
54 |
- text_id: "TEXT_000000000000050", |
|
55 | 54 |
text_data: null, // 받아온 지문 정보 |
56 | 55 |
speakerA_name: null, |
57 | 56 |
speakerB_name: null, |
... | ... | @@ -76,7 +75,7 @@ |
76 | 75 |
"Content-Type": "application/json; charset=UTF-8", |
77 | 76 |
}, |
78 | 77 |
data: { |
79 |
- textId: this.text_id, |
|
78 |
+ textId: this.textId, |
|
80 | 79 |
}, |
81 | 80 |
}) |
82 | 81 |
.then((response) => { |
... | ... | @@ -118,6 +117,10 @@ |
118 | 117 |
}, |
119 | 118 |
watch: {}, |
120 | 119 |
computed: { |
120 |
+ textId() { |
|
121 |
+ //console.log("지문 화면 아이디 : ", this.$store.getters.getTextId); |
|
122 |
+ return this.$store.getters.getTextId; |
|
123 |
+ }, |
|
121 | 124 |
combinedLines() { |
122 | 125 |
const maxLength = Math.max(this.speakerA.length, this.speakerB.length); |
123 | 126 |
const lines = []; |
--- client/views/pages/main/Chapter/Chapter1_3.vue
+++ client/views/pages/main/Chapter/Chapter1_3.vue
... | ... | @@ -35,7 +35,6 @@ |
35 | 35 |
export default { |
36 | 36 |
data() { |
37 | 37 |
return { |
38 |
- text_id: "TEXT_000000000000049", |
|
39 | 38 |
text_data: null, |
40 | 39 |
img_src: null, |
41 | 40 |
}; |
... | ... | @@ -57,7 +56,7 @@ |
57 | 56 |
"Content-Type": "application/json; charset=UTF-8", |
58 | 57 |
}, |
59 | 58 |
data: { |
60 |
- textId: this.text_id, |
|
59 |
+ textId: this.textId, |
|
61 | 60 |
}, |
62 | 61 |
}) |
63 | 62 |
.then((response) => { |
... | ... | @@ -75,7 +74,12 @@ |
75 | 74 |
}, |
76 | 75 |
}, |
77 | 76 |
watch: {}, |
78 |
- computed: {}, |
|
77 |
+ computed: { |
|
78 |
+ textId() { |
|
79 |
+ //console.log("지문 화면 아이디 : ", this.$store.getters.getTextId); |
|
80 |
+ return this.$store.getters.getTextId; |
|
81 |
+ }, |
|
82 |
+ }, |
|
79 | 83 |
components: { |
80 | 84 |
TextToImage: TextToImage, |
81 | 85 |
}, |
--- client/views/pages/main/Dashboard.vue
+++ client/views/pages/main/Dashboard.vue
... | ... | @@ -5,165 +5,110 @@ |
5 | 5 |
<div v-else class="main"> |
6 | 6 |
<div class="race-wrap"> |
7 | 7 |
<div class="title-box"> |
8 |
- <p class="title" style="margin-top: 7rem;">{{ titleUnitName }}</p> |
|
8 |
+ <p class="title" style="margin-top: 7rem">{{ titleUnitName }}</p> |
|
9 | 9 |
<p class="subtitle">{{ titleBookName }}</p> |
10 | 10 |
</div> |
11 | 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> |
|
12 |
+ <div class="rabbit-start"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[0] ? 'block' : 'none' }" /></div> |
|
16 | 13 |
<div class="rcon flex justify-end mb5"> |
17 |
- <div class="race-btn" @click="[goToPage('Chapter1'), storeLearningId(labeledItems[0].learning_id)]"> |
|
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="labeledItems[0].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" |
|
24 |
- :style="{ display: !rabbitCompl[1] ? 'block' : 'none' }"> |
|
25 |
- <img :src="labeledItems[0].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" |
|
26 |
- :style="{ display: rabbitCompl[1] ? 'block' : 'none' }"> |
|
14 |
+ <div class="race-btn" @click="[storeLearningId(labeledItems[0])]"> |
|
15 |
+ <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[1] ? 'block' : 'none' }" /></div> |
|
16 |
+ <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="1"> |
|
17 |
+ <img :src="labeledItems[0].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" :style="{ display: !rabbitCompl[1] ? 'block' : 'none' }" /> |
|
18 |
+ <img :src="labeledItems[0].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" :style="{ display: rabbitCompl[1] ? 'block' : 'none' }" /> |
|
27 | 19 |
</button> |
28 | 20 |
<p>{{ labeledItems[0].label }}</p> |
29 | 21 |
</div> |
30 | 22 |
<div class="race-btn" @click="[storeLearningId(labeledItems[1])]"> |
31 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
32 |
- :style="{ display: rabbitPos[2] ? 'block' : 'none' }"></div> |
|
33 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
34 |
- data-num="2"> |
|
35 |
- <img :src="labeledItems[1].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" |
|
36 |
- :style="{ display: !rabbitCompl[2] ? 'block' : 'none' }"> |
|
37 |
- <img :src="labeledItems[1].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" |
|
38 |
- :style="{ display: rabbitCompl[2] ? 'block' : 'none' }"> |
|
23 |
+ <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[2] ? 'block' : 'none' }" /></div> |
|
24 |
+ <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="2"> |
|
25 |
+ <img :src="labeledItems[1].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" :style="{ display: !rabbitCompl[2] ? 'block' : 'none' }" /> |
|
26 |
+ <img :src="labeledItems[1].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" :style="{ display: rabbitCompl[2] ? 'block' : 'none' }" /> |
|
39 | 27 |
</button> |
40 | 28 |
<p>{{ labeledItems[1].label }}</p> |
41 | 29 |
</div> |
42 | 30 |
</div> |
43 | 31 |
<div class="lcon flex justify-between mb5"> |
44 | 32 |
<div class="race-btn" @click="[storeLearningId(labeledItems[6])]"> |
45 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
46 |
- :style="{ display: rabbitPos[7] ? 'block' : 'none' }"></div> |
|
47 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
48 |
- data-num="7"> |
|
49 |
- <img :src="labeledItems[6].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" |
|
50 |
- :style="{ display: !rabbitCompl[7] ? 'block' : 'none' }"> |
|
51 |
- <img :src="labeledItems[6].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" |
|
52 |
- :style="{ display: rabbitCompl[7] ? 'block' : 'none' }"> |
|
33 |
+ <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[7] ? 'block' : 'none' }" /></div> |
|
34 |
+ <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="7"> |
|
35 |
+ <img :src="labeledItems[6].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" :style="{ display: !rabbitCompl[7] ? 'block' : 'none' }" /> |
|
36 |
+ <img :src="labeledItems[6].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" :style="{ display: rabbitCompl[7] ? 'block' : 'none' }" /> |
|
53 | 37 |
</button> |
54 | 38 |
<p>{{ labeledItems[6].label }}</p> |
55 | 39 |
</div> |
56 |
- <div class="race-btn" |
|
57 |
- @click="[goToPage('Chapter2_8'), storeLearningId(labeledItems[5].learning_id)]"> |
|
58 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
59 |
- :style="{ display: rabbitPos[6] ? 'block' : 'none' }"></div> |
|
60 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
61 |
- data-num="6"> |
|
62 |
- <img :src="labeledItems[5].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" |
|
63 |
- :style="{ display: !rabbitCompl[6] ? 'block' : 'none' }"> |
|
64 |
- <img :src="labeledItems[5].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" |
|
65 |
- :style="{ display: rabbitCompl[6] ? 'block' : 'none' }"> |
|
40 |
+ <div class="race-btn" @click="[goToPage('Chapter2_8'), storeLearningId(labeledItems[5].learning_id)]"> |
|
41 |
+ <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[6] ? 'block' : 'none' }" /></div> |
|
42 |
+ <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="6"> |
|
43 |
+ <img :src="labeledItems[5].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" :style="{ display: !rabbitCompl[6] ? 'block' : 'none' }" /> |
|
44 |
+ <img :src="labeledItems[5].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" :style="{ display: rabbitCompl[6] ? 'block' : 'none' }" /> |
|
66 | 45 |
</button> |
67 | 46 |
<p>{{ labeledItems[5].label }}</p> |
68 | 47 |
</div> |
69 |
- <div class="race-btn" |
|
70 |
- @click="[goToPage('Chapter2_8'), storeLearningId(labeledItems[4].learning_id)]"> |
|
71 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
72 |
- :style="{ display: rabbitPos[5] ? 'block' : 'none' }"></div> |
|
73 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
74 |
- data-num="5"> |
|
75 |
- <img :src="labeledItems[4].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" |
|
76 |
- :style="{ display: !rabbitCompl[5] ? 'block' : 'none' }"> |
|
77 |
- <img :src="labeledItems[4].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" |
|
78 |
- :style="{ display: rabbitCompl[5] ? 'block' : 'none' }"> |
|
48 |
+ <div class="race-btn" @click="[storeLearningId(labeledItems[4])]"> |
|
49 |
+ <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[5] ? 'block' : 'none' }" /></div> |
|
50 |
+ <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="5"> |
|
51 |
+ <img :src="labeledItems[4].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" :style="{ display: !rabbitCompl[5] ? 'block' : 'none' }" /> |
|
52 |
+ <img :src="labeledItems[4].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" :style="{ display: rabbitCompl[5] ? 'block' : 'none' }" /> |
|
79 | 53 |
</button> |
80 | 54 |
<p>{{ labeledItems[4].label }}</p> |
81 | 55 |
</div> |
82 | 56 |
<div class="race-btn" @click="[storeLearningId(labeledItems[3])]"> |
83 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
84 |
- :style="{ display: rabbitPos[4] ? 'block' : 'none' }"></div> |
|
85 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
86 |
- data-num="4"> |
|
87 |
- <img :src="labeledItems[3].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" |
|
88 |
- :style="{ display: !rabbitCompl[4] ? 'block' : 'none' }"> |
|
89 |
- <img :src="labeledItems[3].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" |
|
90 |
- :style="{ display: rabbitCompl[4] ? 'block' : 'none' }"> |
|
57 |
+ <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[4] ? 'block' : 'none' }" /></div> |
|
58 |
+ <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="4"> |
|
59 |
+ <img :src="labeledItems[3].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" :style="{ display: !rabbitCompl[4] ? 'block' : 'none' }" /> |
|
60 |
+ <img :src="labeledItems[3].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" :style="{ display: rabbitCompl[4] ? 'block' : 'none' }" /> |
|
91 | 61 |
</button> |
92 | 62 |
<p>{{ labeledItems[3].label }}</p> |
93 | 63 |
</div> |
94 | 64 |
<div class="race-btn" @click="[storeLearningId(labeledItems[2])]"> |
95 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
96 |
- :style="{ display: rabbitPos[3] ? 'block' : 'none' }"></div> |
|
97 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
98 |
- data-num="3"> |
|
99 |
- <img :src="labeledItems[2].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" |
|
100 |
- :style="{ display: !rabbitCompl[3] ? 'block' : 'none' }"> |
|
101 |
- <img :src="labeledItems[2].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" |
|
102 |
- :style="{ display: rabbitCompl[3] ? 'block' : 'none' }"> |
|
65 |
+ <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[3] ? 'block' : 'none' }" /></div> |
|
66 |
+ <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="3"> |
|
67 |
+ <img :src="labeledItems[2].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" :style="{ display: !rabbitCompl[3] ? 'block' : 'none' }" /> |
|
68 |
+ <img :src="labeledItems[2].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" :style="{ display: rabbitCompl[3] ? 'block' : 'none' }" /> |
|
103 | 69 |
</button> |
104 | 70 |
<p>{{ labeledItems[2].label }}</p> |
105 | 71 |
</div> |
106 | 72 |
</div> |
107 | 73 |
<div class="rcon flex"> |
108 | 74 |
<div class="race-btn" @click="[goToPage('Chapter8'), storeLearningId(labeledItems[7].learning_id)]"> |
109 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
110 |
- :style="{ display: rabbitPos[8] ? 'block' : 'none' }"></div> |
|
111 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
112 |
- data-num="8"> |
|
113 |
- <img :src="labeledItems[7].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" |
|
114 |
- :style="{ display: !rabbitCompl[8] ? 'block' : 'none' }"> |
|
115 |
- <img :src="labeledItems[7].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" |
|
116 |
- :style="{ display: rabbitCompl[8] ? 'block' : 'none' }"> |
|
75 |
+ <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[8] ? 'block' : 'none' }" /></div> |
|
76 |
+ <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="8"> |
|
77 |
+ <img :src="labeledItems[7].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" :style="{ display: !rabbitCompl[8] ? 'block' : 'none' }" /> |
|
78 |
+ <img :src="labeledItems[7].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" :style="{ display: rabbitCompl[8] ? 'block' : 'none' }" /> |
|
117 | 79 |
</button> |
118 | 80 |
<p class="long">{{ labeledItems[7].label }}</p> |
119 | 81 |
</div> |
120 |
- <div class="race-btn" |
|
121 |
- @click="[goToPage('Chapter2_8'), storeLearningId(labeledItems[8].learning_id)]"> |
|
122 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
123 |
- :style="{ display: rabbitPos[9] ? 'block' : 'none' }"></div> |
|
124 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
125 |
- data-num="9"> |
|
126 |
- <img :src="labeledItems[8].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" |
|
127 |
- :style="{ display: !rabbitCompl[9] ? 'block' : 'none' }"> |
|
128 |
- <img :src="labeledItems[8].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" |
|
129 |
- :style="{ display: rabbitCompl[9] ? 'block' : 'none' }"> |
|
82 |
+ <div class="race-btn" @click="[storeLearningId(labeledItems[8])]"> |
|
83 |
+ <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[9] ? 'block' : 'none' }" /></div> |
|
84 |
+ <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="9"> |
|
85 |
+ <img :src="labeledItems[8].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" :style="{ display: !rabbitCompl[9] ? 'block' : 'none' }" /> |
|
86 |
+ <img :src="labeledItems[8].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" :style="{ display: rabbitCompl[9] ? 'block' : 'none' }" /> |
|
130 | 87 |
</button> |
131 | 88 |
<p>{{ labeledItems[8].label }}</p> |
132 | 89 |
</div> |
133 |
- <div class="race-btn" |
|
134 |
- @click="[goToPage('Chapter10'), storeLearningId(labeledItems[9].learning_id)]"> |
|
135 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
136 |
- :style="{ display: rabbitPos[10] ? 'block' : 'none' }"></div> |
|
137 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
138 |
- data-num="10"> |
|
139 |
- <img :src="labeledItems[9].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" |
|
140 |
- :style="{ display: !rabbitCompl[10] ? 'block' : 'none' }"> |
|
141 |
- <img :src="labeledItems[9].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" |
|
142 |
- :style="{ display: rabbitCompl[10] ? 'block' : 'none' }"> |
|
90 |
+ <div class="race-btn" @click="[goToPage('Chapter10'), storeLearningId(labeledItems[9].learning_id)]"> |
|
91 |
+ <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[10] ? 'block' : 'none' }" /></div> |
|
92 |
+ <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="10"> |
|
93 |
+ <img :src="labeledItems[9].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" :style="{ display: !rabbitCompl[10] ? 'block' : 'none' }" /> |
|
94 |
+ <img :src="labeledItems[9].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" :style="{ display: rabbitCompl[10] ? 'block' : 'none' }" /> |
|
143 | 95 |
</button> |
144 | 96 |
<p>{{ labeledItems[9].label }}</p> |
145 | 97 |
</div> |
146 | 98 |
|
147 |
- <div class="race-btn" |
|
148 |
- @click="[goToPage('Chapter2_8'), storeLearningId(labeledItems[10].learning_id)]"> |
|
149 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
150 |
- :style="{ display: rabbitPos[11] ? 'block' : 'none' }"></div> |
|
151 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" |
|
152 |
- @click="toggleImageAndShowPopup(index, '11')" data-num="11"> |
|
153 |
- <img :src="labeledItems[10].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" |
|
154 |
- :style="{ display: !rabbitCompl[11] ? 'block' : 'none' }"> |
|
155 |
- <img :src="labeledItems[10].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" |
|
156 |
- :style="{ display: rabbitCompl[11] ? 'block' : 'none' }"> |
|
99 |
+ <div class="race-btn" @click="[goToPage('Chapter2_8'), storeLearningId(labeledItems[10].learning_id)]"> |
|
100 |
+ <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[11] ? 'block' : 'none' }" /></div> |
|
101 |
+ <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImageAndShowPopup(index, '11')" data-num="11"> |
|
102 |
+ <img :src="labeledItems[10].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" :style="{ display: !rabbitCompl[11] ? 'block' : 'none' }" /> |
|
103 |
+ <img :src="labeledItems[10].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" :style="{ display: rabbitCompl[11] ? 'block' : 'none' }" /> |
|
157 | 104 |
</button> |
158 | 105 |
<p class="long">{{ labeledItems[10].label }}</p> |
159 | 106 |
</div> |
160 | 107 |
</div> |
161 | 108 |
<div class="race-btn"> |
162 |
- <div class="rabbit-running" style=" display: flex;"><img class="rabbit-end" |
|
163 |
- src="../../../resources/img/img138_72s.png" alt="" |
|
164 |
- :style="{ display: rabbitEnd ? 'block' : 'none' }"> |
|
165 |
- <img class="fireworks-end" src="../../../resources/img/fireworks.gif" alt="" |
|
166 |
- :style="{ display: rabbitEnd ? 'block' : 'none' }"> |
|
109 |
+ <div class="rabbit-running" style="display: flex"> |
|
110 |
+ <img class="rabbit-end" src="../../../resources/img/img138_72s.png" alt="" :style="{ display: rabbitEnd ? 'block' : 'none' }" /> |
|
111 |
+ <img class="fireworks-end" src="../../../resources/img/fireworks.gif" alt="" :style="{ display: rabbitEnd ? 'block' : 'none' }" /> |
|
167 | 112 |
</div> |
168 | 113 |
</div> |
169 | 114 |
</div> |
... | ... | @@ -171,8 +116,7 @@ |
171 | 116 |
<!-- 팝업 --> |
172 | 117 |
<div v-show="searchOpen2" class="popup-wrap"> |
173 | 118 |
<div class="popup-box"> |
174 |
- <button type="button" class="popup-close-btn" style="position:absolute; top:10px; right: 10px;" |
|
175 |
- @click="closeModal"> |
|
119 |
+ <button type="button" class="popup-close-btn" style="position: absolute; top: 10px; right: 10px" @click="closeModal"> |
|
176 | 120 |
<svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon> |
177 | 121 |
</button> |
178 | 122 |
|
... | ... | @@ -181,15 +125,13 @@ |
181 | 125 |
<p class="title1"><em class="yellow">기념사진</em>을 촬영하러 가요</p> |
182 | 126 |
</div> |
183 | 127 |
<div class="flex justify-center"> |
184 |
- <button type="button" title="사진촬영" class="new-btn" @click="openCameraModal"> |
|
185 |
- 사진 촬영 |
|
186 |
- </button> |
|
128 |
+ <button type="button" title="사진촬영" class="new-btn" @click="openCameraModal">사진 촬영</button> |
|
187 | 129 |
</div> |
188 | 130 |
</div> |
189 | 131 |
</div> |
190 | 132 |
<!-- 카메라 모달 --> |
191 | 133 |
<article v-show="showCameraModal" class="popup-wrap"> |
192 |
- <div class="popup-box" style="top: 500px; left:500px"> |
|
134 |
+ <div class="popup-box" style="top: 500px; left: 500px"> |
|
193 | 135 |
<div class="flex mb10 justify-between"> |
194 | 136 |
<p class="popup-title">사진 촬영</p> |
195 | 137 |
<button type="button" class="popup-close-btn" @click="closeModal"> |
... | ... | @@ -197,14 +139,11 @@ |
197 | 139 |
</button> |
198 | 140 |
</div> |
199 | 141 |
<div class="box"> |
200 |
- <div style="width: 100%;"> |
|
142 |
+ <div style="width: 100%"> |
|
201 | 143 |
<div id="container" ref="container"> |
202 |
- <video v-if="!photoTaken" autoplay="true" ref="modalVideoElement" class="mirrored" |
|
203 |
- @canplay="onVideoLoaded" style="position: absolute; height: 100%;"> |
|
204 |
- </video> |
|
205 |
- <img src="../../../resources/img/camera-rabbit.png" class="camera-rabbit" |
|
206 |
- style="position: absolute; "> |
|
207 |
- <canvas ref="canvas" style="pointer-events: none;"></canvas> |
|
144 |
+ <video v-if="!photoTaken" autoplay="true" ref="modalVideoElement" class="mirrored" @canplay="onVideoLoaded" style="position: absolute; height: 100%"></video> |
|
145 |
+ <img src="../../../resources/img/camera-rabbit.png" class="camera-rabbit" style="position: absolute" /> |
|
146 |
+ <canvas ref="canvas" style="pointer-events: none"></canvas> |
|
208 | 147 |
</div> |
209 | 148 |
</div> |
210 | 149 |
</div> |
... | ... | @@ -215,51 +154,60 @@ |
215 | 154 |
</article> |
216 | 155 |
</div> |
217 | 156 |
|
218 |
- |
|
219 |
- |
|
220 |
- <div class="complete-wrap myphoto"> |
|
221 |
- <button class="login-btn mt10" type="submit" style="width: 100%;" @click="finishSchedule"><img |
|
222 |
- src="../../../resources/img/btn07_s.png" alt="" style="width: 100%; height: 100px;"> |
|
157 |
+ <div class="complete-wrap myphoto"> |
|
158 |
+ <button class="login-btn mt10" type="submit" style="width: 100%" @click="finishSchedule"> |
|
159 |
+ <img src="../../../resources/img/btn07_s.png" alt="" style="width: 100%; height: 100px" /> |
|
223 | 160 |
<p>학습 종료하기</p> |
224 | 161 |
</button> |
225 | 162 |
<h2 class="mb40 mt10">이 단원을 끝낸 친구들</h2> |
226 | 163 |
|
227 | 164 |
<article class="flex-column"> |
228 | 165 |
<div class="flex-row"> |
229 |
- <div class="flex" style="gap: 5px; flex-wrap: wrap;"> |
|
230 |
- <div v-for="(image, index) in images" :key="image.fileId" @click="buttonSearch(image)" |
|
231 |
- class="photo" style="margin-bottom: 5px;"> |
|
232 |
- <img :src="image.url" :alt="image.fileNm" reloadable="true" style="height: 100%;" /> |
|
166 |
+ <div class="flex" style="gap: 5px; flex-wrap: wrap"> |
|
167 |
+ <div v-for="(image, index) in images" :key="image.fileId" @click="buttonSearch(image)" class="photo" style="margin-bottom: 5px"> |
|
168 |
+ <img :src="image.url" :alt="image.fileNm" reloadable="true" style="height: 100%" /> |
|
233 | 169 |
</div> |
234 | 170 |
</div> |
235 | 171 |
</div> |
236 | 172 |
</article> |
237 | 173 |
<article class="popup-wrap" v-show="searchOpen"> |
238 |
- <div class="popup-box " style="top: 50%;"> |
|
239 |
- <div class="flex mb10 justify-between"> |
|
174 |
+ <div class="popup-box" style="top: 50%"> |
|
175 |
+ <div class="flex mb10 justify-between"> |
|
240 | 176 |
<button type="button" class="popup-close-btn" @click="closeModal"> |
241 | 177 |
<svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon> |
242 | 178 |
</button> |
243 | 179 |
</div> |
244 | 180 |
<div class="box"> |
245 |
- <div style="width: 910px; height: 680px;"> |
|
246 |
- <img :src="selectedImage.image" alt="Image" @error="onImageError" reloadable="true"> |
|
181 |
+ <div style="width: 910px; height: 680px"> |
|
182 |
+ <img :src="selectedImage.image" alt="Image" @error="onImageError" reloadable="true" /> |
|
247 | 183 |
</div> |
248 | 184 |
</div> |
249 | 185 |
<div class="flex justify-between mt20"> |
250 |
- <div class="text flex"> |
|
186 |
+ <div class="text flex"> |
|
251 | 187 |
<p class="title2 date ml30">{{ selectedImage.date }}</p> |
252 |
- <span class=" title1 ml30">{{ selectedImage.unit }}을 마친 <em class="yellow">{{ |
|
253 |
- selectedImage.name }}</em>친구</span> |
|
188 |
+ <span class="title1 ml30" |
|
189 |
+ >{{ selectedImage.unit }}을 마친 <em class="yellow">{{ selectedImage.name }}</em |
|
190 |
+ >친구</span |
|
191 |
+ > |
|
254 | 192 |
</div> |
255 |
- <div class="title2 flex align-center" style="gap: 10px;"> |
|
256 |
- <svg-icon v-if="!isHeartFilled" type="mdi" :path="mdiHeartOutline" |
|
193 |
+ <div class="title2 flex align-center" style="gap: 10px"> |
|
194 |
+ <svg-icon |
|
195 |
+ v-if="!isHeartFilled" |
|
196 |
+ type="mdi" |
|
197 |
+ :path="mdiHeartOutline" |
|
257 | 198 |
@click="toggleHeart(selectedImage.heart, selectedImage.fileMngId)" |
258 |
- style="color: #FFBA08; cursor: pointer;"></svg-icon> |
|
259 |
- <svg-icon v-if="isHeartFilled" type="mdi" :path="mdiHeart" |
|
199 |
+ style="color: #ffba08; cursor: pointer" |
|
200 |
+ ></svg-icon> |
|
201 |
+ <svg-icon |
|
202 |
+ v-if="isHeartFilled" |
|
203 |
+ type="mdi" |
|
204 |
+ :path="mdiHeart" |
|
260 | 205 |
@click="toggleHeart(selectedImage.heart, selectedImage.fileMngId)" |
261 |
- style="color: #FFBA08; cursor: pointer;"></svg-icon> |
|
262 |
- <p><em class="yellow">{{ selectedImage.heart }}</em></p> |
|
206 |
+ style="color: #ffba08; cursor: pointer" |
|
207 |
+ ></svg-icon> |
|
208 |
+ <p> |
|
209 |
+ <em class="yellow">{{ selectedImage.heart }}</em> |
|
210 |
+ </p> |
|
263 | 211 |
</div> |
264 | 212 |
</div> |
265 | 213 |
</div> |
... | ... | @@ -269,13 +217,13 @@ |
269 | 217 |
</template> |
270 | 218 |
|
271 | 219 |
<script> |
272 |
-import SvgIcon from '@jamescoyle/vue-icon'; |
|
273 |
-import { mdiMagnify, mdiHeart, mdiWindowClose } from '@mdi/js'; |
|
274 |
-import { mdiHeartOutline } from '@mdi/js'; |
|
275 |
-import axios from 'axios'; |
|
276 |
-import { call } from 'file-loader'; |
|
277 |
-import { name } from 'file-loader'; |
|
278 |
-import { mapGetters } from 'vuex'; |
|
220 |
+import SvgIcon from "@jamescoyle/vue-icon"; |
|
221 |
+import { mdiMagnify, mdiHeart, mdiWindowClose } from "@mdi/js"; |
|
222 |
+import { mdiHeartOutline } from "@mdi/js"; |
|
223 |
+import axios from "axios"; |
|
224 |
+import { call } from "file-loader"; |
|
225 |
+import { name } from "file-loader"; |
|
226 |
+import { mapGetters } from "vuex"; |
|
279 | 227 |
import { mapActions } from "vuex"; |
280 | 228 |
|
281 | 229 |
export default { |
... | ... | @@ -283,11 +231,11 @@ |
283 | 231 |
return { |
284 | 232 |
items: [ |
285 | 233 |
{ |
286 |
- imgSrc1: 'client/resources/img/img11_1_s.png', |
|
287 |
- imgSrc2: 'client/resources/img/img12_1_s.png', |
|
288 |
- imgSrc3: 'client/resources/img/img11_2_s.png', |
|
289 |
- imgSrc4: 'client/resources/img/img12_2_s.png', |
|
290 |
- isSecondImageVisible: false |
|
234 |
+ imgSrc1: "client/resources/img/img11_1_s.png", |
|
235 |
+ imgSrc2: "client/resources/img/img12_1_s.png", |
|
236 |
+ imgSrc3: "client/resources/img/img11_2_s.png", |
|
237 |
+ imgSrc4: "client/resources/img/img12_2_s.png", |
|
238 |
+ isSecondImageVisible: false, |
|
291 | 239 |
}, |
292 | 240 |
], |
293 | 241 |
mdiMagnify: mdiMagnify, |
... | ... | @@ -295,13 +243,12 @@ |
295 | 243 |
mdiHeart: mdiHeart, |
296 | 244 |
mdiHeartOutline: mdiHeartOutline, |
297 | 245 |
showModal: false, |
298 |
- searchOpen: false, // 사진 상세보기 모달창 |
|
246 |
+ searchOpen: false, // 사진 상세보기 모달창 |
|
299 | 247 |
searchOpen2: false, // 단원 마친 후, 사진 촬영 여부 선택 모달창 |
300 |
- showCameraModal: false, // 카메라 모달창 |
|
248 |
+ showCameraModal: false, // 카메라 모달창 |
|
301 | 249 |
photoTaken: false, |
302 |
- photo: null, //캡쳐 사진 |
|
250 |
+ photo: null, //캡쳐 사진 |
|
303 | 251 |
stream: null, |
304 |
- |
|
305 | 252 |
|
306 | 253 |
roadmapData: [], |
307 | 254 |
labeledItems: [], |
... | ... | @@ -315,7 +262,7 @@ |
315 | 262 |
|
316 | 263 |
schedules: [], |
317 | 264 |
nowSchedule: "", |
318 |
- state: '', |
|
265 |
+ state: "", |
|
319 | 266 |
rabbitPos: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], |
320 | 267 |
rabbitCompl: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], |
321 | 268 |
rabbitEnd: false, |
... | ... | @@ -329,12 +276,12 @@ |
329 | 276 |
|
330 | 277 |
selectedImage: [ |
331 | 278 |
{ |
332 |
- image: '', |
|
333 |
- unit: '', |
|
334 |
- date: '', |
|
335 |
- name: '', |
|
336 |
- heart: '', |
|
337 |
- fileMngId: '', |
|
279 |
+ image: "", |
|
280 |
+ unit: "", |
|
281 |
+ date: "", |
|
282 |
+ name: "", |
|
283 |
+ heart: "", |
|
284 |
+ fileMngId: "", |
|
338 | 285 |
}, |
339 | 286 |
], |
340 | 287 |
|
... | ... | @@ -343,24 +290,25 @@ |
343 | 290 |
problemType: null, |
344 | 291 |
wordBookType: null, |
345 | 292 |
wordContentList: [], |
346 |
- } |
|
293 |
+ }; |
|
347 | 294 |
}, |
348 | 295 |
methods: { |
349 | 296 |
toggleHeart(heart, fileMngId) { |
350 | 297 |
this.isHeartFilled = !this.isHeartFilled; // 하트 상태 토글 |
351 | 298 |
|
352 | 299 |
if (this.isHeartFilled) var calHeart = heart + 1; |
353 |
- else var calHeart = heart - 1 |
|
300 |
+ else var calHeart = heart - 1; |
|
354 | 301 |
|
355 | 302 |
// 하트 수를 증가시키기 위한 API 요청 |
356 |
- axios.post('/photo/likeUpdate.json', { |
|
357 |
- "likeData": calHeart, |
|
358 |
- "fileMngId": fileMngId |
|
359 |
- }) |
|
360 |
- .then(response => { |
|
303 |
+ axios |
|
304 |
+ .post("/photo/likeUpdate.json", { |
|
305 |
+ likeData: calHeart, |
|
306 |
+ fileMngId: fileMngId, |
|
307 |
+ }) |
|
308 |
+ .then((response) => { |
|
361 | 309 |
this.selectedImage.heart = calHeart; |
362 | 310 |
}) |
363 |
- .catch(error => { |
|
311 |
+ .catch((error) => { |
|
364 | 312 |
console.error("Error updating heart:", error); |
365 | 313 |
}); |
366 | 314 |
}, |
... | ... | @@ -379,11 +327,11 @@ |
379 | 327 |
this.fetchRoadmapData(unit_id, book_id); |
380 | 328 |
this.fetchRabbit(); |
381 | 329 |
|
382 |
- this.unit_id = unit_id |
|
383 |
- this.book_id = book_id |
|
330 |
+ this.unit_id = unit_id; |
|
331 |
+ this.book_id = book_id; |
|
384 | 332 |
|
385 |
- if (this.$route.query.reCapture == 'true') { |
|
386 |
- this.openCameraModal() |
|
333 |
+ if (this.$route.query.reCapture == "true") { |
|
334 |
+ this.openCameraModal(); |
|
387 | 335 |
} |
388 | 336 |
}, |
389 | 337 |
|
... | ... | @@ -407,36 +355,36 @@ |
407 | 355 |
}, |
408 | 356 |
data: { |
409 | 357 |
unitId: unit_id, |
410 |
- sclsId: "1" |
|
411 |
- } |
|
358 |
+ sclsId: "1", |
|
359 |
+ }, |
|
412 | 360 |
}) |
413 |
- .then(response => { |
|
361 |
+ .then((response) => { |
|
414 | 362 |
this.file = response.data; |
415 | 363 |
|
416 |
- const findFilePromises = this.file.map(f => |
|
417 |
- this.findFile(f.file_mng_id) |
|
418 |
- ); |
|
364 |
+ const findFilePromises = this.file.map((f) => this.findFile(f.file_mng_id)); |
|
419 | 365 |
|
420 | 366 |
return Promise.all(findFilePromises); |
421 | 367 |
}) |
422 |
- .then(fileResults => { |
|
423 |
- this.images = this.file.map((file, index) => { |
|
424 |
- const result = fileResults[index]; |
|
425 |
- if (result) { |
|
426 |
- return { |
|
427 |
- url: "http://localhost:9080/" + `${result.fileRpath}`, |
|
428 |
- fileId: result.fileId, |
|
429 |
- fileNm: result.fileNm, |
|
430 |
- fileRegDate: result.regDt, |
|
431 |
- likeData: file.like_data, |
|
432 |
- stdId: file.user_nm, |
|
433 |
- fileMngId: result.fileMngId, |
|
434 |
- }; |
|
435 |
- } |
|
436 |
- return null; |
|
437 |
- }).filter(image => image !== null); |
|
368 |
+ .then((fileResults) => { |
|
369 |
+ this.images = this.file |
|
370 |
+ .map((file, index) => { |
|
371 |
+ const result = fileResults[index]; |
|
372 |
+ if (result) { |
|
373 |
+ return { |
|
374 |
+ url: "http://localhost:9080/" + `${result.fileRpath}`, |
|
375 |
+ fileId: result.fileId, |
|
376 |
+ fileNm: result.fileNm, |
|
377 |
+ fileRegDate: result.regDt, |
|
378 |
+ likeData: file.like_data, |
|
379 |
+ stdId: file.user_nm, |
|
380 |
+ fileMngId: result.fileMngId, |
|
381 |
+ }; |
|
382 |
+ } |
|
383 |
+ return null; |
|
384 |
+ }) |
|
385 |
+ .filter((image) => image !== null); |
|
438 | 386 |
}) |
439 |
- .catch(error => { |
|
387 |
+ .catch((error) => { |
|
440 | 388 |
console.error("Error fetching images:", error); |
441 | 389 |
}); |
442 | 390 |
}, |
... | ... | @@ -459,33 +407,30 @@ |
459 | 407 |
} |
460 | 408 |
}, |
461 | 409 |
goToPageImg(page) { |
462 |
- const canvas = document.querySelector('canvas'); |
|
463 |
- const dataURL = canvas.toDataURL('image/png'); |
|
410 |
+ const canvas = document.querySelector("canvas"); |
|
411 |
+ const dataURL = canvas.toDataURL("image/png"); |
|
464 | 412 |
|
465 | 413 |
this.$router.push({ name: page, query: { image: encodeURIComponent(dataURL) } }); |
466 | 414 |
}, |
467 | 415 |
|
468 | 416 |
fetchRabbit() { |
469 | 417 |
for (var i = 0; i < 12; i++) { |
470 |
- this.rabbitPos[i] = false |
|
418 |
+ this.rabbitPos[i] = false; |
|
471 | 419 |
} |
472 | 420 |
|
473 | 421 |
if (this.$route.query.value) { |
474 |
- this.rabbitPos[parseInt(this.$route.query.value, 10) + 1] = true |
|
422 |
+ this.rabbitPos[parseInt(this.$route.query.value, 10) + 1] = true; |
|
475 | 423 |
for (var i = 0; i < this.$route.query.value; i++) { |
476 |
- this.rabbitCompl[i + 1] = true |
|
424 |
+ this.rabbitCompl[i + 1] = true; |
|
477 | 425 |
} |
478 | 426 |
|
479 |
- if (this.$route.query.value === '11') { |
|
427 |
+ if (this.$route.query.value === "11") { |
|
480 | 428 |
this.rabbitEnd = true; |
481 | 429 |
setTimeout(() => { |
482 | 430 |
this.searchOpen2 = true; |
483 | 431 |
}, 1000); |
484 | 432 |
} |
485 |
- |
|
486 |
- } |
|
487 |
- else |
|
488 |
- this.rabbitPos[0] = true |
|
433 |
+ } else this.rabbitPos[0] = true; |
|
489 | 434 |
}, |
490 | 435 |
fetchSchedule(unit_id, book_id) { |
491 | 436 |
axios({ |
... | ... | @@ -496,28 +441,29 @@ |
496 | 441 |
}, |
497 | 442 |
data: { |
498 | 443 |
stdId: "2", |
499 |
- } |
|
500 |
- }).then(response => { |
|
501 |
- this.schedules = response.data; |
|
444 |
+ }, |
|
445 |
+ }) |
|
446 |
+ .then((response) => { |
|
447 |
+ this.schedules = response.data; |
|
502 | 448 |
|
503 |
- if (this.schedules.length == 0) { |
|
504 |
- this.state = 'notRegistered'; |
|
505 |
- } else { |
|
506 |
- const allFinished = this.schedules.every(schedule => schedule.finish === "T"); |
|
507 |
- if (allFinished) { |
|
508 |
- this.state = 'finish'; |
|
449 |
+ if (this.schedules.length == 0) { |
|
450 |
+ this.state = "notRegistered"; |
|
509 | 451 |
} else { |
510 |
- this.nowSchedule = this.schedules.find(schedule => schedule.finish === null || schedule.finish === "F"); |
|
511 |
- if (this.nowSchedule) { |
|
512 |
- this.fetchRoadmapData(unit_id, book_id); |
|
513 |
- this.state = 'studying'; |
|
452 |
+ const allFinished = this.schedules.every((schedule) => schedule.finish === "T"); |
|
453 |
+ if (allFinished) { |
|
454 |
+ this.state = "finish"; |
|
514 | 455 |
} else { |
515 |
- this.state = 'notRegistered'; |
|
456 |
+ this.nowSchedule = this.schedules.find((schedule) => schedule.finish === null || schedule.finish === "F"); |
|
457 |
+ if (this.nowSchedule) { |
|
458 |
+ this.fetchRoadmapData(unit_id, book_id); |
|
459 |
+ this.state = "studying"; |
|
460 |
+ } else { |
|
461 |
+ this.state = "notRegistered"; |
|
462 |
+ } |
|
516 | 463 |
} |
517 | 464 |
} |
518 |
- } |
|
519 |
- }) |
|
520 |
- .catch(error => { |
|
465 |
+ }) |
|
466 |
+ .catch((error) => { |
|
521 | 467 |
console.error("Error fetching roadmap data:", error); |
522 | 468 |
}); |
523 | 469 |
}, |
... | ... | @@ -530,24 +476,24 @@ |
530 | 476 |
}, |
531 | 477 |
data: { |
532 | 478 |
scheduleId: this.nowSchedule.schdl_id, |
533 |
- finish: "T" |
|
534 |
- } |
|
479 |
+ finish: "T", |
|
480 |
+ }, |
|
535 | 481 |
}) |
536 |
- .then(response => { |
|
537 |
- const nextSchedule = this.schedules.find(schedule => schedule.schdl_id > this.nowSchedule.schdl_id); |
|
482 |
+ .then((response) => { |
|
483 |
+ const nextSchedule = this.schedules.find((schedule) => schedule.schdl_id > this.nowSchedule.schdl_id); |
|
538 | 484 |
alert("학습을 완료했습니다!"); |
539 | 485 |
|
540 | 486 |
if (nextSchedule) { |
541 | 487 |
this.nowSchedule = nextSchedule; |
542 | 488 |
this.fetchSchedule(nextSchedule.unit_id, nextSchedule.book_id); |
543 | 489 |
this.fetchRoadmapData(nextSchedule.unit_id, nextSchedule.book_id); |
544 |
- this.$router.push({ name: 'Dashboard', query: { unit_id: nextSchedule.unit_id, book_id: nextSchedule.book_id } }); |
|
490 |
+ this.$router.push({ name: "Dashboard", query: { unit_id: nextSchedule.unit_id, book_id: nextSchedule.book_id } }); |
|
545 | 491 |
} else { |
546 | 492 |
alert("모든 학습을 완료했습니다!"); |
547 |
- this.state = 'finish'; |
|
493 |
+ this.state = "finish"; |
|
548 | 494 |
} |
549 | 495 |
}) |
550 |
- .catch(error => { |
|
496 |
+ .catch((error) => { |
|
551 | 497 |
console.error("Error updating schedule:", error); |
552 | 498 |
}); |
553 | 499 |
}, |
... | ... | @@ -560,21 +506,21 @@ |
560 | 506 |
}, |
561 | 507 |
data: { |
562 | 508 |
unit_id: unit_id, |
563 |
- book_id: book_id |
|
564 |
- } |
|
509 |
+ book_id: book_id, |
|
510 |
+ }, |
|
565 | 511 |
}) |
566 |
- .then(response => { |
|
512 |
+ .then((response) => { |
|
567 | 513 |
if (response.data.length != 0) { |
568 | 514 |
this.roadmapData = response.data; |
569 |
- this.titleUnitName = this.roadmapData[0].unit_nm |
|
570 |
- this.titleBookName = this.roadmapData[0].book_nm |
|
515 |
+ this.titleUnitName = this.roadmapData[0].unit_nm; |
|
516 |
+ this.titleBookName = this.roadmapData[0].book_nm; |
|
571 | 517 |
this.labeledItems = this.processedRoadmap; |
572 | 518 |
} else { |
573 |
- this.state = "noProblem" |
|
519 |
+ this.state = "noProblem"; |
|
574 | 520 |
} |
575 | 521 |
}) |
576 |
- .catch(error => { |
|
577 |
- this.state = "noProblem" |
|
522 |
+ .catch((error) => { |
|
523 |
+ this.state = "noProblem"; |
|
578 | 524 |
console.error("Error fetching roadmap data:", error); |
579 | 525 |
}); |
580 | 526 |
}, |
... | ... | @@ -582,7 +528,7 @@ |
582 | 528 |
this.items[index].isSecondImageVisible = !this.items[index].isSecondImageVisible; |
583 | 529 |
}, |
584 | 530 |
ShowPopup() { |
585 |
- this.searchOpen2 = true; // 촬영 여부 묻는 모달창 열기 |
|
531 |
+ this.searchOpen2 = true; // 촬영 여부 묻는 모달창 열기 |
|
586 | 532 |
}, |
587 | 533 |
goToPage(page) { |
588 | 534 |
// const { unit_id, book_id } = this.$route.query; |
... | ... | @@ -590,71 +536,103 @@ |
590 | 536 |
this.$router.push({ name: page }); |
591 | 537 |
}, |
592 | 538 |
storeLearningId(labeledItems) { |
593 |
- this.$store.dispatch('updateLearningData', labeledItems); |
|
594 |
- this.$store.dispatch('updateLearningId', labeledItems.learning_id) // 단어장에 사용중.. |
|
539 |
+ this.$store.dispatch("updateLearningData", labeledItems); |
|
540 |
+ this.$store.dispatch("updateLearningId", labeledItems.learning_id); // 단어장에 사용중.. |
|
595 | 541 |
console.log("레이블된 아이템: ", labeledItems); |
596 |
- if (labeledItems.label.startsWith('문제')) { |
|
597 |
- this.handleProblemDetail(this.$store.getters.currentLearningId) |
|
598 |
- this.goToPage(this.problemType) |
|
599 |
- } else if (labeledItems.label.startsWith('단어장')) { |
|
542 |
+ if (labeledItems.label.startsWith("문제")) { |
|
543 |
+ this.handleProblemDetail(this.$store.getters.currentLearningId); |
|
544 |
+ this.goToPage(this.problemType); |
|
545 |
+ } else if (labeledItems.label.startsWith("단어장")) { |
|
600 | 546 |
this.handleWordBookContent(this.$store.getters.getLearningId); |
547 |
+ } |
|
548 |
+ |
|
549 |
+ if (labeledItems.label.startsWith("지문")) { |
|
550 |
+ //console.log("지문 아이디 : ", labeledItems.learning_id); |
|
551 |
+ this.$store.dispatch("updateTextId", labeledItems.learning_id); |
|
552 |
+ this.fetchTextType(labeledItems.learning_id); |
|
601 | 553 |
} |
602 | 554 |
}, |
603 | 555 |
handleWordBookContent(item) { |
604 | 556 |
console.log("처리할 단어장 콘텐츠 id: ", item); |
605 | 557 |
|
606 | 558 |
// 단어장 ID 가져오기 |
607 |
- axios.post("/wordContent/selectWordContent.json", { |
|
608 |
- wordContentId: item, |
|
609 |
- }) |
|
610 |
- .then((response) => { |
|
611 |
- this.wordContentList = response.data; |
|
559 |
+ axios |
|
560 |
+ .post("/wordContent/selectWordContent.json", { |
|
561 |
+ wordContentId: item, |
|
562 |
+ }) |
|
563 |
+ .then((response) => { |
|
564 |
+ this.wordContentList = response.data; |
|
612 | 565 |
|
613 |
- // 단어장 ID 리스트에서 첫 번째 단어장 ID를 사용 |
|
614 |
- const wdBookId = this.wordContentList[0].wd_book_id; |
|
566 |
+ // 단어장 ID 리스트에서 첫 번째 단어장 ID를 사용 |
|
567 |
+ const wdBookId = this.wordContentList[0].wd_book_id; |
|
615 | 568 |
|
616 |
- // 단어장 정보 가져오기 |
|
617 |
- return axios.post("/wordbook/find.json", { |
|
618 |
- wdBookId: wdBookId, |
|
619 |
- }); |
|
620 |
- }) |
|
621 |
- .then((response) => { |
|
622 |
- const wordbookData = response.data; |
|
623 |
- console.log("wordbookData: ", wordbookData); // 응답 데이터 확인 |
|
569 |
+ // 단어장 정보 가져오기 |
|
570 |
+ return axios.post("/wordbook/find.json", { |
|
571 |
+ wdBookId: wdBookId, |
|
572 |
+ }); |
|
573 |
+ }) |
|
574 |
+ .then((response) => { |
|
575 |
+ const wordbookData = response.data; |
|
576 |
+ console.log("wordbookData: ", wordbookData); // 응답 데이터 확인 |
|
624 | 577 |
|
625 |
- // 단어장 타입에 따라 페이지 설정 |
|
626 |
- if (wordbookData && wordbookData.wdBookTypeId) { |
|
627 |
- switch (wordbookData.wdBookTypeId) { |
|
628 |
- case "1": |
|
629 |
- this.wordBookType = "Chapter2"; |
|
630 |
- break; |
|
631 |
- case "2": |
|
632 |
- this.wordBookType = "Chapter2_3"; |
|
633 |
- break; |
|
634 |
- case "3": |
|
635 |
- this.wordBookType = "Chapter2_2"; |
|
636 |
- break; |
|
637 |
- case "4": |
|
638 |
- this.wordBookType = "Chapter2_9"; |
|
639 |
- break; |
|
640 |
- case "5": |
|
641 |
- this.wordBookType = "Chapter2_4"; |
|
642 |
- break; |
|
643 |
- default: |
|
644 |
- this.wordBookType = null; |
|
578 |
+ // 단어장 타입에 따라 페이지 설정 |
|
579 |
+ if (wordbookData && wordbookData.wdBookTypeId) { |
|
580 |
+ switch (wordbookData.wdBookTypeId) { |
|
581 |
+ case "1": |
|
582 |
+ this.wordBookType = "Chapter2"; |
|
583 |
+ break; |
|
584 |
+ case "2": |
|
585 |
+ this.wordBookType = "Chapter2_3"; |
|
586 |
+ break; |
|
587 |
+ case "3": |
|
588 |
+ this.wordBookType = "Chapter2_2"; |
|
589 |
+ break; |
|
590 |
+ case "4": |
|
591 |
+ this.wordBookType = "Chapter2_9"; |
|
592 |
+ break; |
|
593 |
+ case "5": |
|
594 |
+ this.wordBookType = "Chapter2_4"; |
|
595 |
+ break; |
|
596 |
+ default: |
|
597 |
+ this.wordBookType = null; |
|
598 |
+ } |
|
599 |
+ } else { |
|
600 |
+ console.error("wdBookTypeId가 없습니다."); |
|
601 |
+ this.wordBookType = null; |
|
645 | 602 |
} |
646 |
- } else { |
|
647 |
- console.error("wdBookTypeId가 없습니다."); |
|
648 |
- this.wordBookType = null; |
|
649 |
- } |
|
650 | 603 |
|
651 |
- console.log("현재 단어장 타입: ", this.wordBookType); |
|
652 |
- this.goToPage(this.wordBookType); |
|
604 |
+ console.log("현재 단어장 타입: ", this.wordBookType); |
|
605 |
+ this.goToPage(this.wordBookType); |
|
606 |
+ }) |
|
607 |
+ .catch((error) => { |
|
608 |
+ console.error("단어장 정보를 불러오는 중 오류 발생:", error); |
|
609 |
+ this.wordBookType = null; |
|
610 |
+ }); |
|
611 |
+ }, |
|
612 |
+ // 지문 type 불러오기 |
|
613 |
+ fetchTextType(text_id) { |
|
614 |
+ axios({ |
|
615 |
+ url: "/text/selectOneText.json", |
|
616 |
+ method: "post", |
|
617 |
+ headers: { |
|
618 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
619 |
+ }, |
|
620 |
+ data: { |
|
621 |
+ textId: text_id, |
|
622 |
+ }, |
|
653 | 623 |
}) |
654 |
- .catch((error) => { |
|
655 |
- console.error("단어장 정보를 불러오는 중 오류 발생:", error); |
|
656 |
- this.wordBookType = null; |
|
657 |
- }); |
|
624 |
+ .then((response) => { |
|
625 |
+ const text_type_id = response.data[0].text_type_id; |
|
626 |
+ // console.log("지문 유형 아이디 : ", text_type_id); |
|
627 |
+ if (text_type_id === "2") { |
|
628 |
+ this.goToPage("Chapter1_2"); |
|
629 |
+ } else if (text_type_id === "3") { |
|
630 |
+ this.goToPage("Chapter1_3"); |
|
631 |
+ } |
|
632 |
+ }) |
|
633 |
+ .catch((err) => { |
|
634 |
+ console.log("지문 에러 : ", err); |
|
635 |
+ }); |
|
658 | 636 |
}, |
659 | 637 |
handleProblemDetail(item) { |
660 | 638 |
if (item.prblm_type_id === "prblm_type_001") { |
... | ... | @@ -711,21 +689,20 @@ |
711 | 689 |
this.closeModal(); |
712 | 690 |
|
713 | 691 |
this.showCameraModal = true; |
714 |
- navigator.mediaDevices.getUserMedia({ video: true }) |
|
715 |
- .then(stream => { |
|
692 |
+ navigator.mediaDevices |
|
693 |
+ .getUserMedia({ video: true }) |
|
694 |
+ .then((stream) => { |
|
716 | 695 |
const modalVideo = this.$refs.modalVideoElement; |
717 | 696 |
modalVideo.srcObject = stream; |
718 | 697 |
this.stream = stream; |
719 | 698 |
}) |
720 |
- .catch(error => { |
|
699 |
+ .catch((error) => { |
|
721 | 700 |
console.log("error>>>>>>>>", error); |
722 | 701 |
alert("웹캠이 필요한 기능입니다!"); |
723 | 702 |
this.closeModal(); // 모달창을 닫음 |
724 | 703 |
}); |
725 | 704 |
}, |
726 | 705 |
closeModal() { |
727 |
- |
|
728 |
- |
|
729 | 706 |
this.searchOpen = false; |
730 | 707 |
this.searchOpen2 = false; |
731 | 708 |
this.showCameraModal = false; |
... | ... | @@ -735,7 +712,7 @@ |
735 | 712 |
//스트림 종료 |
736 | 713 |
if (this.stream) { |
737 | 714 |
let tracks = this.stream.getTracks(); |
738 |
- tracks.forEach(track => track.stop()); |
|
715 |
+ tracks.forEach((track) => track.stop()); |
|
739 | 716 |
this.stream = null; |
740 | 717 |
} |
741 | 718 |
}, |
... | ... | @@ -743,14 +720,15 @@ |
743 | 720 |
onVideoLoaded() { |
744 | 721 |
const video = this.$refs.modalVideoElement; |
745 | 722 |
const canvas = this.$refs.canvas; |
746 |
- const ctx = canvas.getContext('2d'); |
|
723 |
+ const ctx = canvas.getContext("2d"); |
|
747 | 724 |
|
748 | 725 |
canvas.width = video.videoWidth; |
749 | 726 |
canvas.height = video.videoHeight; |
750 |
- }, takePhoto() { |
|
727 |
+ }, |
|
728 |
+ takePhoto() { |
|
751 | 729 |
const video = this.$refs.modalVideoElement; |
752 | 730 |
const canvas = this.$refs.canvas; |
753 |
- const ctx = canvas.getContext('2d'); |
|
731 |
+ const ctx = canvas.getContext("2d"); |
|
754 | 732 |
|
755 | 733 |
ctx.save(); // 현재 상태 저장 |
756 | 734 |
|
... | ... | @@ -761,7 +739,7 @@ |
761 | 739 |
ctx.restore(); |
762 | 740 |
|
763 | 741 |
const overlayImg = new Image(); |
764 |
- overlayImg.src = 'client/resources/img/camera-rabbit.png'; |
|
742 |
+ overlayImg.src = "client/resources/img/camera-rabbit.png"; |
|
765 | 743 |
overlayImg.onload = () => { |
766 | 744 |
const overlayWidth = canvas.width * 0.4; |
767 | 745 |
const overlayHeight = (overlayImg.height / overlayImg.width) * overlayWidth; |
... | ... | @@ -772,8 +750,8 @@ |
772 | 750 |
ctx.drawImage(overlayImg, overlayX, overlayY, overlayWidth, overlayHeight); |
773 | 751 |
|
774 | 752 |
// 사진 저장 함수 호출 |
775 |
- const dataURL = canvas.toDataURL('image/png'); |
|
776 |
- this.$router.push({ name: 'PhotoEdit', query: { image: encodeURIComponent(dataURL), unit_id: this.unit_id, book_id: this.book_id } }); |
|
753 |
+ const dataURL = canvas.toDataURL("image/png"); |
|
754 |
+ this.$router.push({ name: "PhotoEdit", query: { image: encodeURIComponent(dataURL), unit_id: this.unit_id, book_id: this.book_id } }); |
|
777 | 755 |
}; |
778 | 756 |
}, |
779 | 757 |
|
... | ... | @@ -788,7 +766,7 @@ |
788 | 766 |
SvgIcon, |
789 | 767 |
}, |
790 | 768 |
mounted() { |
791 |
- console.log('main mounted'); |
|
769 |
+ console.log("main mounted"); |
|
792 | 770 |
this.checkAndFetchData(); |
793 | 771 |
// const { book_id, unit_id } = this.$route.query; |
794 | 772 |
}, |
... | ... | @@ -798,10 +776,10 @@ |
798 | 776 |
}, |
799 | 777 |
getUnitId(newUnitId) { |
800 | 778 |
this.checkAndFetchData(); |
801 |
- } |
|
779 |
+ }, |
|
802 | 780 |
}, |
803 | 781 |
computed: { |
804 |
- ...mapGetters(['getBookId', 'getUnitId']), |
|
782 |
+ ...mapGetters(["getBookId", "getUnitId"]), |
|
805 | 783 |
|
806 | 784 |
processedRoadmap() { |
807 | 785 |
let problemCounter = 0; |
... | ... | @@ -809,7 +787,7 @@ |
809 | 787 |
let textCounter = 0; |
810 | 788 |
let evalCounter = 0; |
811 | 789 |
|
812 |
- return this.roadmapData.map(item => { |
|
790 |
+ return this.roadmapData.map((item) => { |
|
813 | 791 |
if (item.wd_cnt_id !== null) { |
814 | 792 |
wordCounter++; |
815 | 793 |
return { label: `단어장${wordCounter}`, learning_id: item.wd_cnt_id }; |
... | ... | @@ -818,20 +796,20 @@ |
818 | 796 |
return { label: `지문${textCounter}`, learning_id: item.text_id }; |
819 | 797 |
} else if (item.eval_id !== null) { |
820 | 798 |
evalCounter++; |
821 |
- return { label: evalCounter === 1 ? '중간평가' : '최종평가', learning_id: item.eval_id }; |
|
799 |
+ return { label: evalCounter === 1 ? "중간평가" : "최종평가", learning_id: item.eval_id }; |
|
822 | 800 |
} else { |
823 | 801 |
problemCounter++; |
824 | 802 |
return { label: `문제${problemCounter}`, learning_id: item.prblm_id }; |
825 | 803 |
} |
826 | 804 |
}); |
827 |
- } |
|
805 |
+ }, |
|
828 | 806 |
}, |
829 | 807 |
beforeDestroy() { |
830 | 808 |
// 컴포넌트가 파괴되기 전에 리스너 제거 |
831 |
- window.removeEventListener('resize', this.updateCanvasRect); |
|
832 |
- this.$refs.canvas.removeEventListener('click', this.handleCanvasClick); |
|
833 |
- } |
|
834 |
-} |
|
809 |
+ window.removeEventListener("resize", this.updateCanvasRect); |
|
810 |
+ this.$refs.canvas.removeEventListener("click", this.handleCanvasClick); |
|
811 |
+ }, |
|
812 |
+}; |
|
835 | 813 |
</script> |
836 | 814 |
|
837 | 815 |
<style scoped> |
... | ... | @@ -862,7 +840,7 @@ |
862 | 840 |
} |
863 | 841 |
|
864 | 842 |
.new-btn:disabled { |
865 |
- background-color: #FFF3D7; |
|
843 |
+ background-color: #fff3d7; |
|
866 | 844 |
cursor: not-allowed; |
867 | 845 |
} |
868 | 846 |
|
... | ... | @@ -935,7 +913,6 @@ |
935 | 913 |
width: 20rem; |
936 | 914 |
} |
937 | 915 |
|
938 |
- |
|
939 | 916 |
.camera-rabbit { |
940 | 917 |
position: absolute; |
941 | 918 |
right: 0; |
... | ... | @@ -946,4 +923,4 @@ |
946 | 923 |
.race-btn p { |
947 | 924 |
width: auto; |
948 | 925 |
} |
949 |
-</style>(No newline at end of file) |
|
926 |
+</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?