
--- client/views/component/Breadcrumb/Breadcrumb.vue
+++ client/views/component/Breadcrumb/Breadcrumb.vue
... | ... | @@ -37,12 +37,16 @@ |
37 | 37 |
generateBreadcrumb() { |
38 | 38 |
const menuState = this.$store.state; |
39 | 39 |
const currentPath = this.$route.path; |
40 |
+ const basePath = currentPath.substring(0, currentPath.lastIndexOf('/')); // 현재 경로에서 마지막 '/' 이전까지의 경로 |
|
41 |
+ // const pathType = currentPath.substring(currentPath.lastIndexOf('/') + 1); |
|
42 |
+ const upPath = basePath + '/list.page'; // 상위 경로(목록)로 생성 |
|
40 | 43 |
|
41 | 44 |
// 관리자: childList 기반 |
42 |
- const findFromTree = (menus, path, trail = []) => { |
|
45 |
+ const findFromTree = (menus, path, trail = [], isOwnPath) => { |
|
43 | 46 |
for (const menu of menus) { |
44 | 47 |
const newTrail = [...trail, menu]; |
45 | 48 |
if (menu.routerUrl === path) { |
49 |
+ findCurrent.isOwnPath = isOwnPath; // 본인 경로 여부 |
|
46 | 50 |
this.$store.commit('setMenu', menu); |
47 | 51 |
return newTrail; |
48 | 52 |
} |
... | ... | @@ -55,10 +59,11 @@ |
55 | 59 |
}; |
56 | 60 |
|
57 | 61 |
// 사용자: upMenuId 기반 |
58 |
- const findFromFlat = (flatMenus, path) => { |
|
62 |
+ const findFromFlat = (flatMenus, path, isOwnPath) => { |
|
59 | 63 |
const findCurrent = flatMenus.find(menu => menu.routerUrl === path); |
60 | 64 |
if (!findCurrent) return []; |
61 | 65 |
|
66 |
+ findCurrent.isOwnPath = isOwnPath; // 본인 경로 여부 |
|
62 | 67 |
this.$store.commit('setMenu', findCurrent); |
63 | 68 |
|
64 | 69 |
const buildTrail = (menu, trail = []) => { |
... | ... | @@ -96,10 +101,18 @@ |
96 | 101 |
// [menu, ...(menu.childList || [])] |
97 | 102 |
// ); |
98 | 103 |
const flatMenus = flattenMenus(menuState.menuList); |
99 |
- breadcrumb = findFromFlat(flatMenus, currentPath); |
|
104 |
+ const matchMenu = flatMenus.find(menu => menu.routerUrl === currentPath); // 현재 경로가 메뉴에 있는지 확인 |
|
105 |
+ let path = currentPath; |
|
106 |
+ let isOwnPath = true; // 본인 경로임 |
|
107 |
+ if(!matchMenu) { |
|
108 |
+ path = upPath; // 현재 경로가 메뉴에 없다면 상위 경로 사용 |
|
109 |
+ isOwnPath = false; // 본인 경로가 아님 |
|
110 |
+ } |
|
111 |
+ |
|
112 |
+ breadcrumb = findFromFlat(flatMenus, path, isOwnPath); |
|
100 | 113 |
} else if (menuState.menu?.childList?.length) { |
101 | 114 |
// 관리자용 |
102 |
- breadcrumb = findFromTree(menuState.menu.childList, currentPath); |
|
115 |
+ breadcrumb = findFromTree(menuState.menu.childList, path, isOwnPath); |
|
103 | 116 |
} |
104 | 117 |
|
105 | 118 |
this.breadcrumbList = breadcrumb; |
--- client/views/layout/AdminHeader.vue
+++ client/views/layout/AdminHeader.vue
... | ... | @@ -83,12 +83,12 @@ |
83 | 83 |
return "홈"; |
84 | 84 |
} |
85 | 85 |
|
86 |
- if (route.meta.typeId.includes("BBS_MNG")) { |
|
87 |
- const matchedMenu = store.state.flatMenuList.find(menu => menu.menuTypeCtgry === route.meta.typeId); |
|
88 |
- if (matchedMenu) { |
|
89 |
- return matchedMenu.menuNm; |
|
90 |
- } |
|
91 |
- } |
|
86 |
+ // if (route.meta.typeId.includes("BBS_MNG")) { |
|
87 |
+ // const matchedMenu = store.state.flatMenuList.find(menu => menu.menuTypeCtgry === route.meta.typeId); |
|
88 |
+ // if (matchedMenu) { |
|
89 |
+ // return matchedMenu.menuNm; |
|
90 |
+ // } |
|
91 |
+ // } |
|
92 | 92 |
|
93 | 93 |
if (storeMenu?.menuNm) { |
94 | 94 |
return storeMenu.menuNm; |
--- client/views/pages/adm/boardManagement/template/commonTemplate/CommonSelectListOne.vue
+++ client/views/pages/adm/boardManagement/template/commonTemplate/CommonSelectListOne.vue
... | ... | @@ -536,13 +536,13 @@ |
536 | 536 |
}, |
537 | 537 |
}, |
538 | 538 |
watch: { |
539 |
- $route(to, from) { |
|
540 |
- if (to.query.pageId != from.query.pageId) { |
|
541 |
- this.pageId = to.query.pageId; |
|
542 |
- (this.InputCmnt = ""), (this.upCmntId = null), this.fnSelectOne(); |
|
543 |
- this.getCmntList(); |
|
544 |
- } |
|
545 |
- }, |
|
539 |
+ // $route(to, from) { |
|
540 |
+ // if (to.query.pageId != from.query.pageId) { |
|
541 |
+ // this.pageId = to.query.pageId; |
|
542 |
+ // (this.InputCmnt = ""), (this.upCmntId = null), this.fnSelectOne(); |
|
543 |
+ // this.getCmntList(); |
|
544 |
+ // } |
|
545 |
+ // }, |
|
546 | 546 |
bbsMng: { |
547 | 547 |
handler() { |
548 | 548 |
this.$nextTick(() => { |
--- client/views/pages/adm/boardManagement/template/galleryTemplate/GallerySelectListOne.vue
+++ client/views/pages/adm/boardManagement/template/galleryTemplate/GallerySelectListOne.vue
... | ... | @@ -455,19 +455,19 @@ |
455 | 455 |
}, |
456 | 456 |
}, |
457 | 457 |
watch: { |
458 |
- $route(to, from) { |
|
459 |
- // 페이지 ID가 변경되었는지 확인합니다. |
|
460 |
- if (to.query.pageId !== from.query.pageId) { |
|
461 |
- // 페이지 ID가 변경되면, 여러 상태를 업데이트하고 필요한 함수를 호출합니다. |
|
462 |
- this.pageId = to.query.pageId; |
|
463 |
- this.InputCmnt = ""; |
|
464 |
- this.upCmntId = null; |
|
458 |
+ // $route(to, from) { |
|
459 |
+ // // 페이지 ID가 변경되었는지 확인합니다. |
|
460 |
+ // if (to.query.pageId !== from.query.pageId) { |
|
461 |
+ // // 페이지 ID가 변경되면, 여러 상태를 업데이트하고 필요한 함수를 호출합니다. |
|
462 |
+ // this.pageId = to.query.pageId; |
|
463 |
+ // this.InputCmnt = ""; |
|
464 |
+ // this.upCmntId = null; |
|
465 | 465 |
|
466 |
- this.fnSelectOne(); // 선택된 항목 가져오기 함수 |
|
467 |
- this.getCmntList(); // 댓글 목록 가져오기 함수 |
|
468 |
- this.updateVwCnt(); // 조회수 업데이트 함수 |
|
469 |
- } |
|
470 |
- }, |
|
466 |
+ // this.fnSelectOne(); // 선택된 항목 가져오기 함수 |
|
467 |
+ // this.getCmntList(); // 댓글 목록 가져오기 함수 |
|
468 |
+ // this.updateVwCnt(); // 조회수 업데이트 함수 |
|
469 |
+ // } |
|
470 |
+ // }, |
|
471 | 471 |
bbsMng: { |
472 | 472 |
handler() { |
473 | 473 |
this.$nextTick(() => { |
--- client/views/pages/adm/boardManagement/template/videoTemplate/VideoSelectListOne.vue
+++ client/views/pages/adm/boardManagement/template/videoTemplate/VideoSelectListOne.vue
... | ... | @@ -593,19 +593,19 @@ |
593 | 593 |
}, |
594 | 594 |
}, |
595 | 595 |
watch: { |
596 |
- $route(to, from) { |
|
597 |
- // 페이지 ID가 변경되었는지 확인합니다. |
|
598 |
- if (to.query.pageId !== from.query.pageId) { |
|
599 |
- // 페이지 ID가 변경되면, 여러 상태를 업데이트하고 필요한 함수를 호출합니다. |
|
600 |
- this.pageId = to.query.pageId; |
|
601 |
- this.InputCmnt = ""; |
|
602 |
- this.upCmntId = null; |
|
596 |
+ // $route(to, from) { |
|
597 |
+ // // 페이지 ID가 변경되었는지 확인합니다. |
|
598 |
+ // if (to.query.pageId !== from.query.pageId) { |
|
599 |
+ // // 페이지 ID가 변경되면, 여러 상태를 업데이트하고 필요한 함수를 호출합니다. |
|
600 |
+ // this.pageId = to.query.pageId; |
|
601 |
+ // this.InputCmnt = ""; |
|
602 |
+ // this.upCmntId = null; |
|
603 | 603 |
|
604 |
- this.fnSelectOne(); // 선택된 항목 가져오기 함수 |
|
605 |
- this.getCmntList(); // 댓글 목록 가져오기 함수 |
|
606 |
- this.updateVwCnt(); // 조회수 업데이트 함수 |
|
607 |
- } |
|
608 |
- }, |
|
604 |
+ // this.fnSelectOne(); // 선택된 항목 가져오기 함수 |
|
605 |
+ // this.getCmntList(); // 댓글 목록 가져오기 함수 |
|
606 |
+ // this.updateVwCnt(); // 조회수 업데이트 함수 |
|
607 |
+ // } |
|
608 |
+ // }, |
|
609 | 609 |
bbsMng: { |
610 | 610 |
handler() { |
611 | 611 |
this.$nextTick(() => { |
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?