type.ts 987 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { PaginationRequest, PaginationResponse } from '@/types/common/type';
  2. import { PermissionTreeKey } from '../permission/type';
  3. /**
  4. * 角色列表row
  5. */
  6. export interface Role {
  7. // 主键ID
  8. id: number;
  9. // 角色名
  10. roleName: string;
  11. // 备注
  12. remark: string;
  13. // 租户ID
  14. tenantId?: number;
  15. isDeleted?: number;
  16. createdAt?: string;
  17. createdBy?: string;
  18. updatedAt?: string;
  19. updatedBy?: string;
  20. }
  21. /**
  22. * 角色列表请求参数
  23. */
  24. export interface RolePageRequest extends PaginationRequest {
  25. queryParam?: {
  26. roleName: Role['roleName'];
  27. tenantId?: Role['tenantId'];
  28. };
  29. }
  30. /**
  31. * 角色列表数据
  32. */
  33. export type RolePageResponse = PaginationResponse<Role>;
  34. /**
  35. * 角色表单
  36. */
  37. export interface RoleForm {
  38. id: number | null;
  39. roleName: string;
  40. remark: string;
  41. menuIds: PermissionTreeKey[];
  42. permIds: PermissionTreeKey[];
  43. tenantId?: number;
  44. }
  45. export type AssignedPermissions = Pick<RoleForm, 'cameraIds' | 'menuIds' | 'permIds'>;