Files
cn-rdms-web/src/typings/api/system-manage.d.ts

440 lines
11 KiB
TypeScript
Raw Normal View History

2026-03-26 20:18:20 +08:00
declare namespace Api {
/**
* namespace SystemManage
*
* backend api module: "system"
*/
namespace SystemManage {
type CommonStatus = 0 | 1;
interface PageParams {
pageNo: number;
pageSize: number;
}
interface PageResult<T = any> {
total: number;
list: T[];
}
type RoleType = 1 | 2;
type ScopeType = 'global' | 'object';
type ObjectType = 'product' | 'project';
interface ScopeQueryParams {
scopeType?: ScopeType;
objectType?: ObjectType;
}
2026-03-26 20:18:20 +08:00
interface Role {
/** role id */
id: string;
2026-03-26 20:18:20 +08:00
/** role name */
name: string;
/** role code */
code: string;
/** scope type */
scopeType?: ScopeType;
/** object type */
objectType?: ObjectType | '' | null;
2026-03-26 20:18:20 +08:00
/** display sort */
sort: number;
/** status: 0 enabled, 1 disabled */
status: CommonStatus;
/** role type */
type: RoleType;
/** remark */
remark?: string | null;
/** create time */
createTime: number;
}
type RoleSearchParams = CommonType.RecordNullable<Pick<Role, 'name' | 'code' | 'status'>> &
PageParams & { createTime?: string[] } & ScopeQueryParams;
2026-03-26 20:18:20 +08:00
type SaveRoleParams = (Pick<Role, 'name' | 'code' | 'sort' | 'status'> & {
2026-03-26 20:18:20 +08:00
remark?: string | null;
}) &
ScopeQueryParams;
2026-03-26 20:18:20 +08:00
type RoleList = PageResult<Role>;
/**
* keep the legacy fields for the user page until it is migrated
*/
type AllRole = RoleSimple & {
roleName: string;
roleCode: string;
};
type DeptOrgType = 'company' | 'dept' | 'direction' | 'team';
interface Dept {
id: number;
name: string;
parentId: number;
orgType: DeptOrgType;
path?: string | null;
level?: number | null;
code?: string | null;
sort?: number | null;
status: CommonStatus;
createTime?: number | null;
children?: Dept[] | null;
}
interface DeptSimple {
id: number;
name: string;
parentId: number;
children?: DeptSimple[] | null;
}
type DeptList = Dept[];
type DeptSimpleList = DeptSimple[];
type DeptSearchParams = CommonType.RecordNullable<Pick<Dept, 'name' | 'orgType' | 'status'>>;
type SaveDeptParams = Pick<Dept, 'name' | 'parentId' | 'orgType' | 'code' | 'sort' | 'status'>;
interface OrgLeaderRelation {
id: number;
deptId: number;
userId: string;
2026-03-26 20:18:20 +08:00
userNickname: string;
effectiveFrom?: number | null;
effectiveUntil?: number | null;
remark?: string | null;
createTime?: number | null;
updateTime?: number | null;
}
type OrgLeaderRelationList = OrgLeaderRelation[];
interface OrgLeaderCandidateUser {
id: string;
2026-03-26 20:18:20 +08:00
nickname: string;
deptId: number;
deptName?: string | null;
}
type OrgLeaderCandidateUserList = OrgLeaderCandidateUser[];
type SaveOrgLeaderRelationParams = {
deptId: number;
userId: string | null;
2026-03-26 20:18:20 +08:00
effectiveFrom?: number | null;
effectiveUntil?: number | null;
remark?: string | null;
};
type UserGender = 0 | 1 | 2;
interface User {
id: number;
username: string;
nickname?: string | null;
remark?: string | null;
deptId: number;
deptName?: string | null;
positionId?: number | null;
positionName?: string | null;
company?: string | null;
2026-03-26 20:18:20 +08:00
email?: string | null;
mobile?: string | null;
sex?: UserGender | null;
avatar?: string | null;
status: CommonStatus;
loginIp?: string | null;
resignedAt?: number | null;
loginDate?: number | null;
createTime: number;
}
type UserSearchParams = CommonType.RecordNullable<
Pick<User, 'status'> &
Pick<PageParams, 'pageNo' | 'pageSize'> & {
username?: string;
nickname?: string;
mobile?: string;
deptId?: number;
roleId?: string;
company?: string;
}
2026-03-26 20:18:20 +08:00
>;
type UserList = PageResult<User>;
type SaveUserParams = Pick<User, 'username' | 'deptId'> & {
nickname?: string | null;
remark?: string | null;
positionId?: number | null;
resignedAt?: number | null;
company?: string | null;
2026-03-26 20:18:20 +08:00
email?: string | null;
mobile?: string | null;
sex?: UserGender | null;
avatar?: string | null;
password?: string;
};
interface UpdateUserStatusParams {
id: number;
status: CommonStatus;
}
interface UpdateUserPasswordParams {
id: number;
password: string;
}
type PostType = 'management' | 'technical' | 'business';
interface Post {
id: number;
name: string;
code?: string | null;
postType?: PostType | null;
levelRank?: number | null;
sort?: number | null;
status: CommonStatus;
remark?: string | null;
createTime: number;
}
2026-03-26 20:18:20 +08:00
interface PostSimple {
id: number;
name: string;
code?: string | null;
postType?: PostType | null;
levelRank?: number | null;
sort?: number | null;
}
type PostSimpleList = PostSimple[];
type PostSearchParams = CommonType.RecordNullable<Pick<Post, 'name' | 'code' | 'postType' | 'status'>> & PageParams;
type SavePostParams = Pick<Post, 'name' | 'code' | 'postType' | 'levelRank' | 'sort' | 'status'> & {
remark?: string | null;
};
type PostList = PageResult<Post>;
2026-03-26 20:18:20 +08:00
type RoleSimple = Pick<Role, 'id' | 'name' | 'code' | 'status' | 'sort'>;
type RoleSimpleList = RoleSimple[];
interface AssignUserRoleParams {
userId: number;
roleIds: string[];
2026-03-26 20:18:20 +08:00
}
/**
* menu type
*
* - 1: directory
* - 2: menu
* - 3: button
*/
type MenuType = 1 | 2 | 3;
/**
* menu route kind
*
* - dir: directory route
* - view: normal page route
* - single: top level single page
* - iframe: iframe page
* - external: external link
* - redirect: redirect route
*/
type MenuRouteKind = 'dir' | 'view' | 'single' | 'iframe' | 'external' | 'redirect';
interface Menu {
/** menu id */
id: string;
2026-03-26 20:18:20 +08:00
/** menu name */
name: string;
/** permission code */
permission?: string | null;
/** scope type */
scopeType?: ScopeType;
/** object type */
objectType?: ObjectType | '' | null;
2026-03-26 20:18:20 +08:00
/** menu type */
type: MenuType;
/** display sort */
sort: number;
/** parent menu id */
parentId: string;
2026-03-26 20:18:20 +08:00
/** route path */
path?: string | null;
/** menu icon */
icon?: string | null;
/** component path */
component?: string | null;
/** component name */
componentName?: string | null;
/** route kind */
routeKind?: MenuRouteKind | null;
/** route props json */
routePropsJson?: string | null;
/** status: 0 enabled, 1 disabled */
status: CommonStatus;
/** visible in menu */
visible?: boolean | null;
/** keep alive */
keepAlive?: boolean | null;
/** always show children */
alwaysShow?: boolean | null;
/** create time */
createTime: number;
/** frontend tree children */
children?: Menu[] | null;
}
type MenuSearchParams = CommonType.RecordNullable<Pick<Menu, 'name' | 'status'>> & ScopeQueryParams;
2026-03-26 20:18:20 +08:00
type SaveMenuParams = Pick<
Menu,
| 'name'
| 'permission'
| 'type'
| 'sort'
| 'parentId'
| 'path'
| 'icon'
| 'component'
| 'componentName'
| 'routeKind'
| 'routePropsJson'
| 'status'
| 'visible'
| 'keepAlive'
| 'alwaysShow'
> &
ScopeQueryParams;
2026-03-26 20:18:20 +08:00
interface MenuSimple {
id: string;
2026-03-26 20:18:20 +08:00
name: string;
parentId: string;
scopeType?: ScopeType;
objectType?: ObjectType | '' | null;
2026-03-26 20:18:20 +08:00
type: MenuType;
children?: MenuSimple[] | null;
}
type MenuList = Menu[];
type MenuSimpleList = MenuSimple[];
interface AssignRoleMenuParams {
roleId: string;
menuIds: string[];
2026-03-26 20:18:20 +08:00
}
/**
*
*
*
* UserManagementRelationRespVO
*/
interface UserManagementRelation {
/** 主键 ID */
id: string | null;
/** 管理者用户 ID */
managerUserId: string | null;
/** 被管理用户 ID */
subordinateUserId: string | null;
/** 生效开始时间 */
effectiveFrom?: number | null;
/** 生效结束时间 */
effectiveUntil?: number | null;
/** 备注 */
remark?: string | null;
/** 创建时间 */
createTime: number;
}
/**
* VO
*
*
* UserManagementRelationTreeRespVO
*/
interface UserManagementRelationTreeRespVO {
/** 关系记录主键 ID最高领导为 null */
id: string | null;
/** 用户 ID */
userId: string;
/** 用户昵称 */
userNickname: string;
/** 上级用户 ID最高领导为 null */
managerUserId: string | null;
/** 上级用户昵称(最高领导为 null */
managerNickname: string | null;
/** 下级用户列表(基层员工为空列表) */
children?: UserManagementRelationTreeRespVO[] | null;
}
/**
*
*
*
* UserManagementRelationSaveReqVO
*/
interface UserManagementRelationSaveReqVO {
/** 主键 ID更新时需要 */
id?: string;
/** 管理者用户 ID */
managerUserId: string | null;
/** 被管理用户 ID */
subordinateUserId: string | null;
/** 生效开始时间 */
effectiveFrom?: number | null;
/** 生效结束时间 */
effectiveUntil?: number | null;
/** 备注 */
remark?: string | null;
}
/**
*
*
*
* UserManagementRelationQueryReqVO
*/
type UserManagementRelationQueryReqVO = CommonType.RecordNullable<
Pick<UserManagementRelation, 'managerUserId' | 'subordinateUserId'> & {
/** 是否来自管理链路的index组件 */
fromUserIndex: boolean;
/** 部门ID */
deptId?: number | null;
}
>;
/**
*
*
*
*/
interface UserSimple {
/** 用户 ID */
id: string;
/** 用户昵称 */
nickname: string;
/** 用户账号 */
username?: string | null;
/** 部门 ID */
deptId?: string | null;
/** 部门名称 */
deptName?: string | null;
}
2026-03-26 20:18:20 +08:00
}
}