diff --git a/ruoyi-ui/src/store/modules/menu.js b/ruoyi-ui/src/store/modules/menu.js index 6f0103f4..c8d81166 100644 --- a/ruoyi-ui/src/store/modules/menu.js +++ b/ruoyi-ui/src/store/modules/menu.js @@ -29,6 +29,14 @@ const state = { mutations.saveRecent(state); }, + pinRecent(state, item){ + state.recentPages.forEach((unit, index) => { + if (unit.path == item.path) { + unit.isPinned = !unit.isPinned; + } + }); + mutations.saveRecent(state); + }, openRecent(state){ state.isRecentOpen = true; sessionStorage.setItem("isRecentOpen", true); @@ -43,9 +51,14 @@ const state = { mutations.saveRecent(state); }, resetRecent(state, para){ - state.isRecentOpen = false; - sessionStorage.setItem("isRecentOpen", false); - sessionStorage.removeItem("recentPages") + temp = JSON.parse(sessionStorage.getItem("recentPages") || "[]"); + state.recentPages = []; + temp.forEach((unit, index) => { + if (unit.isPinned) { + state.recentPages.push(unit); + } + }); + state.isRecentOpen = true; } } diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/RecentPages/ContextMenu.vue b/ruoyi-ui/src/views/JiHeExpressway/components/RecentPages/ContextMenu.vue new file mode 100644 index 00000000..8d61145c --- /dev/null +++ b/ruoyi-ui/src/views/JiHeExpressway/components/RecentPages/ContextMenu.vue @@ -0,0 +1,36 @@ + + + \ No newline at end of file diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/RecentPages/index.vue b/ruoyi-ui/src/views/JiHeExpressway/components/RecentPages/index.vue index 1450ffd4..eede637f 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/RecentPages/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/RecentPages/index.vue @@ -1,24 +1,34 @@