feat(projects): page manage_role

This commit is contained in:
Soybean
2024-01-28 00:44:21 +08:00
parent 2724169eb6
commit 237c6d227e
23 changed files with 909 additions and 60 deletions

75
src/typings/api.d.ts vendored
View File

@ -4,10 +4,41 @@
* All backend api type
*/
declare namespace Api {
namespace Common {
/** common params of paginating */
interface PaginatingCommonParams {
/** current page number */
current: number;
/** page size */
size: number;
/** total count */
total: number;
}
/** common params of paginating query list data */
interface PaginatingQueryRecord<T extends NonNullable<unknown>> extends PaginatingCommonParams {
records: T[];
}
/** common record */
type CommonRecord<T extends NonNullable<unknown>> = {
/** record id */
id: number;
/** record creator */
createBy: string;
/** record create time */
createTime: string;
/** record updater */
updateBy: string;
/** record update time */
updateTime: string;
} & T;
}
/**
* Namespace Auth
* namespace Auth
*
* Backend api module: "auth"
* backend api module: "auth"
*/
namespace Auth {
interface LoginToken {
@ -23,9 +54,9 @@ declare namespace Api {
}
/**
* Namespace Route
* namespace Route
*
* Backend api module: "route"
* backend api module: "route"
*/
namespace Route {
type ElegantConstRoute = import('@elegant-router/types').ElegantConstRoute;
@ -39,4 +70,40 @@ declare namespace Api {
home: import('@elegant-router/types').LastLevelRouteKey;
}
}
/**
* namespace SystemManage
*
* backend api module: "systemManage"
*/
namespace SystemManage {
/**
* role status
*
* - "1": enabled
* - "2": disabled
*/
type RoleStatus = '1' | '2';
/** role */
type Role = Common.CommonRecord<{
/** role name */
roleName: string;
/** role code */
roleCode: string;
/** role description */
roleDesc: string;
/** role status */
roleStatus: RoleStatus | null;
}>;
/** role search params */
type RoleSearchParams = CommonType.RecordNullable<
Pick<Api.SystemManage.Role, 'roleName' | 'roleCode' | 'roleStatus'> &
Pick<Common.PaginatingCommonParams, 'current' | 'size'>
>;
/** role list */
type RoleList = Common.PaginatingQueryRecord<Role>;
}
}