feat: add search page

This commit is contained in:
vben
2020-12-10 23:58:11 +08:00
parent 596e7062e9
commit dddda5b296
45 changed files with 1399 additions and 1004 deletions

View File

@@ -45,13 +45,13 @@ async function getAsyncMenus() {
}
// 获取深层扁平化菜单
export const getFlatMenus = async () => {
export const getFlatMenus = async (): Promise<Menu[]> => {
const menus = await getAsyncMenus();
return flatMenus(menus);
};
// 获取菜单 树级
export const getMenus = async () => {
export const getMenus = async (): Promise<Menu[]> => {
const menus = await getAsyncMenus();
const routes = router.getRoutes();
return !isBackMode() ? filter(menus, basicFilter(routes)) : menus;
@@ -65,7 +65,7 @@ export async function getCurrentParentPath(currentPath: string) {
}
// 获取1级菜单删除children
export async function getShallowMenus() {
export async function getShallowMenus(): Promise<Menu[]> {
const menus = await getAsyncMenus();
const routes = router.getRoutes();
const shallowMenuList = menus.map((item) => ({ ...item, children: undefined }));