하석형 하석형 05-13
250513 하석형 등록/수정 페이지에서 새로고침 시 헤더/메뉴에 페이지 표시
@b908a6bbdd7728d97e67c87c202e5f9781c35b61
client/views/component/Breadcrumb/Breadcrumb.vue
--- client/views/component/Breadcrumb/Breadcrumb.vue
+++ client/views/component/Breadcrumb/Breadcrumb.vue
@@ -37,12 +37,16 @@
     generateBreadcrumb() {
       const menuState = this.$store.state;
       const currentPath = this.$route.path;
+      const basePath = currentPath.substring(0, currentPath.lastIndexOf('/')); // 현재 경로에서 마지막 '/' 이전까지의 경로
+      // const pathType = currentPath.substring(currentPath.lastIndexOf('/') + 1);
+      const upPath = basePath + '/list.page'; // 상위 경로(목록)로 생성
 
       // 관리자: childList 기반
-      const findFromTree = (menus, path, trail = []) => {
+      const findFromTree = (menus, path, trail = [], isOwnPath) => {
         for (const menu of menus) {
           const newTrail = [...trail, menu];
           if (menu.routerUrl === path) {
+            findCurrent.isOwnPath = isOwnPath; // 본인 경로 여부
             this.$store.commit('setMenu', menu);
             return newTrail;
           }
@@ -55,10 +59,11 @@
       };
 
       // 사용자: upMenuId 기반
-      const findFromFlat = (flatMenus, path) => {
+      const findFromFlat = (flatMenus, path, isOwnPath) => {
         const findCurrent = flatMenus.find(menu => menu.routerUrl === path);
         if (!findCurrent) return [];
 
+        findCurrent.isOwnPath = isOwnPath; // 본인 경로 여부
         this.$store.commit('setMenu', findCurrent);
 
         const buildTrail = (menu, trail = []) => {
@@ -96,10 +101,18 @@
         //   [menu, ...(menu.childList || [])]
         // );
         const flatMenus = flattenMenus(menuState.menuList);
-        breadcrumb = findFromFlat(flatMenus, currentPath);
+        const matchMenu = flatMenus.find(menu => menu.routerUrl === currentPath); // 현재 경로가 메뉴에 있는지 확인
+        let path = currentPath;
+        let isOwnPath = true; // 본인 경로임
+        if(!matchMenu) {
+          path = upPath; // 현재 경로가 메뉴에 없다면 상위 경로 사용
+          isOwnPath = false; // 본인 경로가 아님
+        }
+
+        breadcrumb = findFromFlat(flatMenus, path, isOwnPath);
       } else if (menuState.menu?.childList?.length) {
         // 관리자용
-        breadcrumb = findFromTree(menuState.menu.childList, currentPath);
+        breadcrumb = findFromTree(menuState.menu.childList, path, isOwnPath);
       }
 
       this.breadcrumbList = breadcrumb;
client/views/layout/AdminHeader.vue
--- client/views/layout/AdminHeader.vue
+++ client/views/layout/AdminHeader.vue
@@ -83,12 +83,12 @@
                     return "홈";
                 }
 
-                if (route.meta.typeId.includes("BBS_MNG")) {
-                    const matchedMenu = store.state.flatMenuList.find(menu => menu.menuTypeCtgry === route.meta.typeId);
-                    if (matchedMenu) {
-                        return matchedMenu.menuNm;
-                    }
-                }
+                // if (route.meta.typeId.includes("BBS_MNG")) {
+                //     const matchedMenu = store.state.flatMenuList.find(menu => menu.menuTypeCtgry === route.meta.typeId);
+                //     if (matchedMenu) {
+                //         return matchedMenu.menuNm;
+                //     }
+                // }
 
                 if (storeMenu?.menuNm) {
                     return storeMenu.menuNm;
client/views/layout/menuSatisfaction.vue
--- client/views/layout/menuSatisfaction.vue
+++ client/views/layout/menuSatisfaction.vue
@@ -160,7 +160,7 @@
         },
 
         '$store.state.menu'(newValue) {
-            if (newValue) {
+            if (newValue && (newValue.isOwnPath === undefined || newValue.isOwnPath === true)) {
                 this.pgNm = newValue.menuNm;
                 this.menuId = newValue.menuId;
                 this.fnView();
client/views/pages/adm/boardManagement/template/commonTemplate/CommonSelectListOne.vue
--- client/views/pages/adm/boardManagement/template/commonTemplate/CommonSelectListOne.vue
+++ client/views/pages/adm/boardManagement/template/commonTemplate/CommonSelectListOne.vue
@@ -536,13 +536,13 @@
     },
   },
   watch: {
-    $route(to, from) {
-      if (to.query.pageId != from.query.pageId) {
-        this.pageId = to.query.pageId;
-        (this.InputCmnt = ""), (this.upCmntId = null), this.fnSelectOne();
-        this.getCmntList();
-      }
-    },
+    // $route(to, from) {
+    //   if (to.query.pageId != from.query.pageId) {
+    //     this.pageId = to.query.pageId;
+    //     (this.InputCmnt = ""), (this.upCmntId = null), this.fnSelectOne();
+    //     this.getCmntList();
+    //   }
+    // },
     bbsMng: {
       handler() {
         this.$nextTick(() => {
client/views/pages/adm/boardManagement/template/galleryTemplate/GallerySelectListOne.vue
--- client/views/pages/adm/boardManagement/template/galleryTemplate/GallerySelectListOne.vue
+++ client/views/pages/adm/boardManagement/template/galleryTemplate/GallerySelectListOne.vue
@@ -455,19 +455,19 @@
     },
   },
   watch: {
-    $route(to, from) {
-      // 페이지 ID가 변경되었는지 확인합니다.
-      if (to.query.pageId !== from.query.pageId) {
-        // 페이지 ID가 변경되면, 여러 상태를 업데이트하고 필요한 함수를 호출합니다.
-        this.pageId = to.query.pageId;
-        this.InputCmnt = "";
-        this.upCmntId = null;
+    // $route(to, from) {
+    //   // 페이지 ID가 변경되었는지 확인합니다.
+    //   if (to.query.pageId !== from.query.pageId) {
+    //     // 페이지 ID가 변경되면, 여러 상태를 업데이트하고 필요한 함수를 호출합니다.
+    //     this.pageId = to.query.pageId;
+    //     this.InputCmnt = "";
+    //     this.upCmntId = null;
 
-        this.fnSelectOne(); // 선택된 항목 가져오기 함수
-        this.getCmntList(); // 댓글 목록 가져오기 함수
-        this.updateVwCnt(); // 조회수 업데이트 함수
-      }
-    },
+    //     this.fnSelectOne(); // 선택된 항목 가져오기 함수
+    //     this.getCmntList(); // 댓글 목록 가져오기 함수
+    //     this.updateVwCnt(); // 조회수 업데이트 함수
+    //   }
+    // },
     bbsMng: {
       handler() {
         this.$nextTick(() => {
client/views/pages/adm/boardManagement/template/videoTemplate/VideoSelectListOne.vue
--- client/views/pages/adm/boardManagement/template/videoTemplate/VideoSelectListOne.vue
+++ client/views/pages/adm/boardManagement/template/videoTemplate/VideoSelectListOne.vue
@@ -593,19 +593,19 @@
     },
   },
   watch: {
-    $route(to, from) {
-      // 페이지 ID가 변경되었는지 확인합니다.
-      if (to.query.pageId !== from.query.pageId) {
-        // 페이지 ID가 변경되면, 여러 상태를 업데이트하고 필요한 함수를 호출합니다.
-        this.pageId = to.query.pageId;
-        this.InputCmnt = "";
-        this.upCmntId = null;
+    // $route(to, from) {
+    //   // 페이지 ID가 변경되었는지 확인합니다.
+    //   if (to.query.pageId !== from.query.pageId) {
+    //     // 페이지 ID가 변경되면, 여러 상태를 업데이트하고 필요한 함수를 호출합니다.
+    //     this.pageId = to.query.pageId;
+    //     this.InputCmnt = "";
+    //     this.upCmntId = null;
 
-        this.fnSelectOne(); // 선택된 항목 가져오기 함수
-        this.getCmntList(); // 댓글 목록 가져오기 함수
-        this.updateVwCnt(); // 조회수 업데이트 함수
-      }
-    },
+    //     this.fnSelectOne(); // 선택된 항목 가져오기 함수
+    //     this.getCmntList(); // 댓글 목록 가져오기 함수
+    //     this.updateVwCnt(); // 조회수 업데이트 함수
+    //   }
+    // },
     bbsMng: {
       handler() {
         this.$nextTick(() => {
Add a comment
List