|
@@ -5,13 +5,13 @@ import {
|
|
Refresh,
|
|
Refresh,
|
|
Upload,
|
|
Upload,
|
|
} from '@icon-park/react';
|
|
} from '@icon-park/react';
|
|
-import {ChildrenFC} from '@utils';
|
|
|
|
|
|
+import {ChildrenFC, MENU_STORAGE} from '@utils';
|
|
import {Button, Space, Upload as AntUpload, UploadProps} from 'antd';
|
|
import {Button, Space, Upload as AntUpload, UploadProps} from 'antd';
|
|
import css from './index.module.css';
|
|
import css from './index.module.css';
|
|
import {useLocation} from 'react-router-dom';
|
|
import {useLocation} from 'react-router-dom';
|
|
import {useMemo} from 'react';
|
|
import {useMemo} from 'react';
|
|
-import {useStore} from 'zustand';
|
|
|
|
-import {menuStore} from '@stores';
|
|
|
|
|
|
+import {useSessionStorageState} from 'ahooks';
|
|
|
|
+import {TreeRoleMenuData} from '@models';
|
|
|
|
|
|
type Props = {
|
|
type Props = {
|
|
onAdd?: () => void;
|
|
onAdd?: () => void;
|
|
@@ -37,7 +37,7 @@ const TableTools: ChildrenFC<Props> = function ({
|
|
uploadProps,
|
|
uploadProps,
|
|
isUploading,
|
|
isUploading,
|
|
}) {
|
|
}) {
|
|
- const pages = useStore(menuStore, state => state.menus);
|
|
|
|
|
|
+ const [pages] = useSessionStorageState<TreeRoleMenuData[]>(MENU_STORAGE);
|
|
const {pathname} = useLocation();
|
|
const {pathname} = useLocation();
|
|
const menuTitle = useMemo(
|
|
const menuTitle = useMemo(
|
|
function () {
|
|
function () {
|