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

440 lines
11 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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;
}
interface Role {
/** role id */
id: string;
/** role name */
name: string;
/** role code */
code: string;
/** scope type */
scopeType?: ScopeType;
/** object type */
objectType?: ObjectType | '' | null;
/** 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;
type SaveRoleParams = (Pick<Role, 'name' | 'code' | 'sort' | 'status'> & {
remark?: string | null;
}) &
ScopeQueryParams;
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' | 'function' | '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;
userNickname: string;
effectiveFrom?: number | null;
effectiveUntil?: number | null;
remark?: string | null;
createTime?: number | null;
updateTime?: number | null;
}
type OrgLeaderRelationList = OrgLeaderRelation[];
interface OrgLeaderCandidateUser {
id: string;
nickname: string;
deptId: number;
deptName?: string | null;
}
type OrgLeaderCandidateUserList = OrgLeaderCandidateUser[];
type SaveOrgLeaderRelationParams = {
deptId: number;
userId: string | null;
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;
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;
}
>;
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;
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;
}
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>;
type RoleSimple = Pick<Role, 'id' | 'name' | 'code' | 'status' | 'sort'>;
type RoleSimpleList = RoleSimple[];
interface AssignUserRoleParams {
userId: number;
roleIds: string[];
}
/**
* 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;
/** menu name */
name: string;
/** permission code */
permission?: string | null;
/** scope type */
scopeType?: ScopeType;
/** object type */
objectType?: ObjectType | '' | null;
/** menu type */
type: MenuType;
/** display sort */
sort: number;
/** parent menu id */
parentId: string;
/** 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;
type SaveMenuParams = Pick<
Menu,
| 'name'
| 'permission'
| 'type'
| 'sort'
| 'parentId'
| 'path'
| 'icon'
| 'component'
| 'componentName'
| 'routeKind'
| 'routePropsJson'
| 'status'
| 'visible'
| 'keepAlive'
| 'alwaysShow'
> &
ScopeQueryParams;
interface MenuSimple {
id: string;
name: string;
parentId: string;
scopeType?: ScopeType;
objectType?: ObjectType | '' | null;
type: MenuType;
children?: MenuSimple[] | null;
}
type MenuList = Menu[];
type MenuSimpleList = MenuSimple[];
interface AssignRoleMenuParams {
roleId: string;
menuIds: string[];
}
/**
* 用户管理链路记录
*
* 用于管理用户之间的管理链路,支持多层级上下级关系
* 对应后端 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;
}
}
}