4 changed files with 66 additions and 0 deletions
@ -0,0 +1,30 @@ |
|||
import type { ListResultDto } from '@abp/core'; |
|||
|
|||
import type { UserFavoriteMenuDto } from '../types/favorites'; |
|||
|
|||
import { useRequest } from '@abp/request'; |
|||
|
|||
export function useMyFavoriteMenusApi() { |
|||
const { cancel, request } = useRequest(); |
|||
|
|||
/** |
|||
* 获取常用菜单列表 |
|||
* @param framework ui框架 |
|||
* @returns 菜单列表 |
|||
*/ |
|||
function getListApi( |
|||
framework?: string, |
|||
): Promise<ListResultDto<UserFavoriteMenuDto>> { |
|||
return request<ListResultDto<UserFavoriteMenuDto>>( |
|||
`/api/platform/menus/favorites/my-favorite-menus?framework=${framework}`, |
|||
{ |
|||
method: 'GET', |
|||
}, |
|||
); |
|||
} |
|||
|
|||
return { |
|||
cancel, |
|||
getListApi, |
|||
}; |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
import type { AuditedEntityDto, IHasConcurrencyStamp } from '@abp/core'; |
|||
|
|||
interface UserFavoriteMenuDto extends AuditedEntityDto<string> { |
|||
aliasName?: string; |
|||
color?: string; |
|||
displayName: string; |
|||
framework: string; |
|||
icon?: string; |
|||
menuId: string; |
|||
name: string; |
|||
path?: string; |
|||
userId: string; |
|||
} |
|||
|
|||
interface UserFavoriteMenuCreateOrUpdateDto { |
|||
aliasName?: string; |
|||
color?: string; |
|||
icon?: string; |
|||
menuId: string; |
|||
} |
|||
|
|||
interface UserFavoriteMenuCreateDto extends UserFavoriteMenuCreateOrUpdateDto { |
|||
framework: string; |
|||
} |
|||
|
|||
interface UserFavoriteMenuUpdateDto |
|||
extends IHasConcurrencyStamp, |
|||
UserFavoriteMenuCreateOrUpdateDto {} |
|||
|
|||
export type { |
|||
UserFavoriteMenuCreateDto, |
|||
UserFavoriteMenuDto, |
|||
UserFavoriteMenuUpdateDto, |
|||
}; |
|||
@ -1,4 +1,5 @@ |
|||
export * from './dataDictionaries'; |
|||
export * from './favorites'; |
|||
export * from './layouts'; |
|||
export * from './menus'; |
|||
export * from './messages'; |
|||
|
|||
Loading…
Reference in new issue