|
|
@ -12,7 +12,7 @@ const Sider = (props) => { |
|
|
|
useEffect(() => { |
|
|
|
let jumpurlObj = JumpUrls.find(s => s.url == pathname && selectedKeys != s.keys) |
|
|
|
if (jumpurlObj) { |
|
|
|
localStorage.setItem('zhongding_selected_sider', JSON.stringify([jumpurlObj.keys])) |
|
|
|
localStorage.setItem('governmentDataResourceCenter_selected_sider', JSON.stringify([jumpurlObj.keys])) |
|
|
|
setSelectedKeys(jumpurlObj.keys) |
|
|
|
} |
|
|
|
}, [pathname]) |
|
|
@ -36,11 +36,11 @@ const Sider = (props) => { |
|
|
|
|
|
|
|
let selectedKeys = [] |
|
|
|
let openKeys = [] |
|
|
|
const lastSelectedKeys = localStorage.getItem('zhongding_selected_sider') |
|
|
|
const lastSelectedKeys = localStorage.getItem('governmentDataResourceCenter_selected_sider') |
|
|
|
if (lastSelectedKeys) { |
|
|
|
selectedKeys = JSON.parse(lastSelectedKeys) |
|
|
|
} |
|
|
|
const lastOpenKeys = localStorage.getItem('zhongding_open_sider') |
|
|
|
const lastOpenKeys = localStorage.getItem('governmentDataResourceCenter_open_sider') |
|
|
|
if (lastOpenKeys) { |
|
|
|
openKeys = JSON.parse(lastOpenKeys) |
|
|
|
} |
|
|
@ -60,9 +60,9 @@ const Sider = (props) => { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
localStorage.setItem('zhongding_selected_sider', JSON.stringify(selectedKeys)) |
|
|
|
localStorage.setItem('governmentDataResourceCenter_selected_sider', JSON.stringify(selectedKeys)) |
|
|
|
setSelectedKeys(selectedKeys) |
|
|
|
localStorage.setItem('zhongding_open_sider', JSON.stringify(openKeys)) |
|
|
|
localStorage.setItem('governmentDataResourceCenter_open_sider', JSON.stringify(openKeys)) |
|
|
|
setOpenKeys(openKeys) |
|
|
|
}, []) |
|
|
|
|
|
|
@ -75,11 +75,11 @@ const Sider = (props) => { |
|
|
|
onSelect={(e) => { |
|
|
|
const { selectedKeys } = e; |
|
|
|
setSelectedKeys(selectedKeys) |
|
|
|
localStorage.setItem('zhongding_selected_sider', JSON.stringify(selectedKeys)) |
|
|
|
localStorage.setItem('governmentDataResourceCenter_selected_sider', JSON.stringify(selectedKeys)) |
|
|
|
}} |
|
|
|
onOpenChange={(openKeys) => { |
|
|
|
setOpenKeys(openKeys) |
|
|
|
localStorage.setItem('zhongding_open_sider', JSON.stringify(openKeys)) |
|
|
|
localStorage.setItem('governmentDataResourceCenter_open_sider', JSON.stringify(openKeys)) |
|
|
|
}} |
|
|
|
> |
|
|
|
{items} |
|
|
|