

240820 권민수 대시보드 페이지 아이디 전달방식 변경
@6b8bb1c536ff530fa9c9b199bebb9d86a0b84ba6
--- client/views/pages/main/Dashboard.vue
+++ client/views/pages/main/Dashboard.vue
... | ... | @@ -238,6 +238,7 @@ |
238 | 238 |
import SvgIcon from '@jamescoyle/vue-icon'; |
239 | 239 |
import { mdiMagnify, mdiHeart, mdiWindowClose } from '@mdi/js'; |
240 | 240 |
import axios from 'axios'; |
241 |
+import { mapGetters } from 'vuex'; |
|
241 | 242 |
|
242 | 243 |
export default { |
243 | 244 |
data() { |
... | ... | @@ -289,6 +290,29 @@ |
289 | 290 |
} |
290 | 291 |
}, |
291 | 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 |
+ |
|
299 |
+ if (!book_id || !unit_id) { |
|
300 |
+ console.error("book_id 또는 unit_id가 설정되지 않았습니다."); |
|
301 |
+ return; |
|
302 |
+ } |
|
303 |
+ this.fetchImage(); |
|
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 |
+ } |
|
314 |
+ }, |
|
315 |
+ |
|
292 | 316 |
//은진 |
293 | 317 |
async findFile(file_mng_id) { |
294 | 318 |
try { |
... | ... | @@ -560,22 +584,21 @@ |
560 | 584 |
SvgIcon, |
561 | 585 |
}, |
562 | 586 |
mounted() { |
563 |
- this.fetchImage(); |
|
564 |
- const { book_id, unit_id } = this.$route.query; |
|
565 |
- |
|
566 | 587 |
console.log('main mounted'); |
567 |
- this.fetchSchedule(unit_id, book_id); |
|
568 |
- this.fetchRoadmapData(unit_id, book_id); |
|
569 |
- this.fetchRabbit(); |
|
570 |
- |
|
571 |
- this.unit_id = unit_id |
|
572 |
- this.book_id = book_id |
|
573 |
- |
|
574 |
- if (this.$route.query.reCapture == 'true') { |
|
575 |
- this.openCameraModal() |
|
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(); |
|
576 | 597 |
} |
577 | 598 |
}, |
578 | 599 |
computed: { |
600 |
+ ...mapGetters(['getBookId', 'getUnitId']), |
|
601 |
+ |
|
579 | 602 |
processedRoadmap() { |
580 | 603 |
let problemCounter = 0; |
581 | 604 |
let wordCounter = 0; |
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?