@clownlee/rbac 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/README.md +17 -0
  2. package/dist/index.js +40756 -0
  3. package/dist/rbac/src/components/assign-menus-modal/index.vue.d.ts +29 -0
  4. package/dist/rbac/src/components/assign-roles-modal/index.vue.d.ts +29 -0
  5. package/dist/rbac/src/components/menu-detail-modal/index.vue.d.ts +48 -0
  6. package/dist/rbac/src/components/menu-form-modal/index.vue.d.ts +45 -0
  7. package/dist/rbac/src/components/role-detail-modal/index.vue.d.ts +40 -0
  8. package/dist/rbac/src/components/role-form-modal/index.vue.d.ts +42 -0
  9. package/dist/rbac/src/components/user-detail-modal/index.vue.d.ts +26 -0
  10. package/dist/rbac/src/components/user-form-modal/index.vue.d.ts +28 -0
  11. package/dist/rbac/src/index.d.ts +14 -0
  12. package/dist/rbac/src/utils/menu.d.ts +25 -0
  13. package/dist/rbac/src/utils/role.d.ts +33 -0
  14. package/dist/rbac/src/utils/user.d.ts +14 -0
  15. package/dist/rbac/src/views/menu-management/api/menu.api.d.ts +47 -0
  16. package/dist/rbac/src/views/menu-management/composables/use-list.d.ts +80 -0
  17. package/dist/rbac/src/views/menu-management/index.vue.d.ts +45 -0
  18. package/dist/rbac/src/views/menu-management/types/menu.types.d.ts +61 -0
  19. package/dist/rbac/src/views/role-management/api/role.api.d.ts +63 -0
  20. package/dist/rbac/src/views/role-management/composables/use-list.d.ts +93 -0
  21. package/dist/rbac/src/views/role-management/index.vue.d.ts +97 -0
  22. package/dist/rbac/src/views/role-management/types/role.types.d.ts +70 -0
  23. package/dist/rbac/src/views/user-management/api/user.api.d.ts +74 -0
  24. package/dist/rbac/src/views/user-management/composables/use-list.d.ts +96 -0
  25. package/dist/rbac/src/views/user-management/index.vue.d.ts +93 -0
  26. package/dist/rbac/src/views/user-management/types/user.types.d.ts +73 -0
  27. package/package.json +54 -0
@@ -0,0 +1,63 @@
1
+ import { RoleQueryModel, RoleFormModel, RoleListResponse, ApiResponse } from '../types/role.types';
2
+
3
+ /**
4
+ * Http 请求实例接口
5
+ */
6
+ export interface RoleHttpInstance {
7
+ queryRoleList: (params: RoleQueryModel) => Promise<ApiResponse<RoleListResponse>>;
8
+ createRole: (data: RoleFormModel) => Promise<ApiResponse<any>>;
9
+ updateRole: (data: RoleFormModel) => Promise<ApiResponse<any>>;
10
+ deleteRole: (id: string | number) => Promise<ApiResponse<any>>;
11
+ getRoleDetail: (id: string | number) => Promise<ApiResponse<any>>;
12
+ enableRole: (id: string) => Promise<ApiResponse<any>>;
13
+ disableRole: (id: string) => Promise<ApiResponse<any>>;
14
+ }
15
+ /**
16
+ * 查询角色列表
17
+ * @param http Http 请求实例
18
+ * @param params 查询参数
19
+ * @returns 角色列表响应
20
+ */
21
+ export declare function queryRoleList(http: Record<string, any>, params: RoleQueryModel): Promise<ApiResponse<RoleListResponse>>;
22
+ /**
23
+ * 创建角色
24
+ * @param http Http 请求实例
25
+ * @param data 角色表单数据
26
+ * @returns 创建响应
27
+ */
28
+ export declare function createRole(http: Record<string, any>, data: RoleFormModel): Promise<ApiResponse<any>>;
29
+ /**
30
+ * 更新角色
31
+ * @param http Http 请求实例
32
+ * @param data 角色表单数据
33
+ * @returns 更新响应
34
+ */
35
+ export declare function updateRole(http: Record<string, any>, data: RoleFormModel): Promise<ApiResponse<any>>;
36
+ /**
37
+ * 删除角色
38
+ * @param http Http 请求实例
39
+ * @param id 角色ID
40
+ * @returns 删除响应
41
+ */
42
+ export declare function deleteRole(http: Record<string, any>, id: string | number): Promise<ApiResponse<any>>;
43
+ /**
44
+ * 获取角色详情
45
+ * @param http Http 请求实例
46
+ * @param id 角色ID
47
+ * @returns 角色详情响应
48
+ */
49
+ export declare function getRoleDetail(http: Record<string, any>, id: string | number): Promise<ApiResponse<any>>;
50
+ /**
51
+ * 启用角色
52
+ * @param http Http 请求实例
53
+ * @param id 角色ID
54
+ * @returns 启用响应
55
+ */
56
+ export declare function enableRole(http: Record<string, any>, id: string | number): Promise<ApiResponse<any>>;
57
+ /**
58
+ * 禁用角色
59
+ * @param http Http 请求实例
60
+ * @param id 角色ID
61
+ * @returns 禁用响应
62
+ */
63
+ export declare function disableRole(http: Record<string, any>, id: string | number): Promise<ApiResponse<any>>;
@@ -0,0 +1,93 @@
1
+ import { RoleQueryModel, RoleRowModel, RoleFormModel, PaginationModel } from '../types/role.types';
2
+
3
+ /**
4
+ * Store 接口(localStorage 操作)
5
+ */
6
+ export interface RoleStore {
7
+ getItem: (key: string) => string | null;
8
+ setItem: (key: string, value: string) => void;
9
+ removeItem: (key: string) => void;
10
+ clear: () => void;
11
+ }
12
+ /**
13
+ * Http 请求实例接口
14
+ */
15
+ export interface RoleHttp {
16
+ queryRoleList: (params: RoleQueryModel) => Promise<any>;
17
+ createRole: (data: RoleFormModel) => Promise<any>;
18
+ updateRole: (data: RoleFormModel) => Promise<any>;
19
+ deleteRole: (id: string | number) => Promise<any>;
20
+ getRoleDetail: (id: string | number) => Promise<any>;
21
+ enableRole: (id: string | number) => Promise<any>;
22
+ disableRole: (id: string | number) => Promise<any>;
23
+ }
24
+ /**
25
+ * 配置项接口
26
+ */
27
+ export interface RoleConfig {
28
+ queryParamsKey?: string;
29
+ [key: string]: any;
30
+ }
31
+ /**
32
+ * 角色列表 composable
33
+ */
34
+ export declare function useRoleList(store: RoleStore, http: RoleHttp, config?: RoleConfig): {
35
+ loading: import('vue').Ref<boolean, boolean>;
36
+ roleList: import('vue').Ref<{
37
+ [x: string]: any;
38
+ id: string | number;
39
+ roleName: string;
40
+ roleCode: string;
41
+ roleDesc?: string | undefined;
42
+ sort?: number | undefined;
43
+ tenantId?: string | number | undefined;
44
+ status?: number | undefined;
45
+ createTime: string;
46
+ updateTime?: string | undefined;
47
+ }[], RoleRowModel[] | {
48
+ [x: string]: any;
49
+ id: string | number;
50
+ roleName: string;
51
+ roleCode: string;
52
+ roleDesc?: string | undefined;
53
+ sort?: number | undefined;
54
+ tenantId?: string | number | undefined;
55
+ status?: number | undefined;
56
+ createTime: string;
57
+ updateTime?: string | undefined;
58
+ }[]>;
59
+ queryParams: import('vue').Ref<{
60
+ [x: string]: any;
61
+ roleName?: string | undefined;
62
+ roleCode?: string | undefined;
63
+ status?: number | undefined;
64
+ page?: number | undefined;
65
+ pageSize?: number | undefined;
66
+ }, RoleQueryModel | {
67
+ [x: string]: any;
68
+ roleName?: string | undefined;
69
+ roleCode?: string | undefined;
70
+ status?: number | undefined;
71
+ page?: number | undefined;
72
+ pageSize?: number | undefined;
73
+ }>;
74
+ pagination: import('vue').Ref<{
75
+ total: number;
76
+ page: number;
77
+ pageSize: number;
78
+ }, PaginationModel | {
79
+ total: number;
80
+ page: number;
81
+ pageSize: number;
82
+ }>;
83
+ loadRoleList: () => Promise<void>;
84
+ handleSearch: (params: RoleQueryModel) => Promise<void>;
85
+ handleReset: () => Promise<void>;
86
+ handleCreate: (data: RoleFormModel) => Promise<boolean>;
87
+ handleUpdate: (data: RoleFormModel) => Promise<boolean>;
88
+ handleDelete: (roleId: string | number) => Promise<boolean>;
89
+ handleEnable: (roleId: string | number) => Promise<boolean>;
90
+ handleDisable: (roleId: string | number) => Promise<boolean>;
91
+ handlePageChange: (page: number, pageSize: number) => Promise<void>;
92
+ loadSavedQueryParams: () => void;
93
+ };
@@ -0,0 +1,97 @@
1
+ import { RoleStore, RoleHttp, RoleConfig } from './composables/use-list';
2
+
3
+ interface Props {
4
+ store: RoleStore | any;
5
+ http?: RoleHttp | {
6
+ roleApis?: any;
7
+ rolePermissionApis?: any;
8
+ };
9
+ config?: RoleConfig;
10
+ data: {
11
+ permissions: {
12
+ search: string;
13
+ reset: string;
14
+ create: string;
15
+ tableList: string;
16
+ detail: string;
17
+ edit: string;
18
+ assignMenus: string | string[];
19
+ enable: string;
20
+ disable: string;
21
+ delete: string;
22
+ pagination: string;
23
+ };
24
+ [key: string]: any;
25
+ };
26
+ }
27
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
28
+ config: () => {};
29
+ data: () => {
30
+ permissions: {
31
+ search: string;
32
+ reset: string;
33
+ create: string;
34
+ tableList: string;
35
+ detail: string;
36
+ edit: string;
37
+ assignMenus: string;
38
+ enable: string;
39
+ disable: string;
40
+ delete: string;
41
+ pagination: string;
42
+ };
43
+ };
44
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
45
+ config: () => {};
46
+ data: () => {
47
+ permissions: {
48
+ search: string;
49
+ reset: string;
50
+ create: string;
51
+ tableList: string;
52
+ detail: string;
53
+ edit: string;
54
+ assignMenus: string;
55
+ enable: string;
56
+ disable: string;
57
+ delete: string;
58
+ pagination: string;
59
+ };
60
+ };
61
+ }>>> & Readonly<{}>, {
62
+ data: {
63
+ permissions: {
64
+ search: string;
65
+ reset: string;
66
+ create: string;
67
+ tableList: string;
68
+ detail: string;
69
+ edit: string;
70
+ assignMenus: string | string[];
71
+ enable: string;
72
+ disable: string;
73
+ delete: string;
74
+ pagination: string;
75
+ };
76
+ [key: string]: any;
77
+ };
78
+ config: RoleConfig;
79
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
80
+ export default _default;
81
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
82
+ type __VLS_TypePropsToRuntimeProps<T> = {
83
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
84
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
85
+ } : {
86
+ type: import('vue').PropType<T[K]>;
87
+ required: true;
88
+ };
89
+ };
90
+ type __VLS_WithDefaults<P, D> = {
91
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
92
+ default: D[K];
93
+ }> : P[K];
94
+ };
95
+ type __VLS_Prettify<T> = {
96
+ [K in keyof T]: T[K];
97
+ } & {};
@@ -0,0 +1,70 @@
1
+ /**
2
+ * 角色相关类型定义
3
+ */
4
+ /**
5
+ * 查询条件模型
6
+ */
7
+ export interface RoleQueryModel {
8
+ roleName?: string;
9
+ roleCode?: string;
10
+ status?: number;
11
+ page?: number;
12
+ pageSize?: number;
13
+ [key: string]: any;
14
+ }
15
+ /**
16
+ * 列表行数据模型
17
+ */
18
+ export interface RoleRowModel {
19
+ id: string | number;
20
+ roleName: string;
21
+ roleCode: string;
22
+ roleDesc?: string;
23
+ sort?: number;
24
+ tenantId?: string | number;
25
+ status?: number;
26
+ createTime: string;
27
+ updateTime?: string;
28
+ [key: string]: any;
29
+ }
30
+ /**
31
+ * 表单数据模型
32
+ */
33
+ export interface RoleFormModel {
34
+ id?: string | number;
35
+ roleName: string;
36
+ roleCode: string;
37
+ roleDesc?: string;
38
+ sort?: number;
39
+ status?: number;
40
+ [key: string]: any;
41
+ }
42
+ /**
43
+ * 分页数据模型
44
+ */
45
+ export interface PaginationModel {
46
+ total: number;
47
+ page: number;
48
+ pageSize: number;
49
+ }
50
+ /**
51
+ * 列表响应模型
52
+ */
53
+ export interface RoleListResponse {
54
+ list: RoleRowModel[];
55
+ total: number;
56
+ page?: number;
57
+ pageSize?: number;
58
+ }
59
+ /**
60
+ * API 通用响应模型
61
+ */
62
+ export interface ApiResponse<T = any> {
63
+ code: number;
64
+ message: string;
65
+ data: T;
66
+ traceId?: string | null;
67
+ timestamp?: string;
68
+ success?: boolean;
69
+ failure?: boolean;
70
+ }
@@ -0,0 +1,74 @@
1
+ import { UserQueryModel, UserFormModel, UserListResponse, ApiResponse } from '../types/user.types';
2
+
3
+ /**
4
+ * Http 请求实例接口
5
+ */
6
+ export interface UserHttpInstance {
7
+ queryUserList: (params: UserQueryModel) => Promise<ApiResponse<UserListResponse>>;
8
+ getUserDetail: (id: string | number) => Promise<ApiResponse<any>>;
9
+ createUser: (data: UserFormModel) => Promise<ApiResponse<any>>;
10
+ updateUser: (data: UserFormModel) => Promise<ApiResponse<any>>;
11
+ deleteUser: (id: string | number) => Promise<ApiResponse<any>>;
12
+ enableUser: (id: string | number) => Promise<ApiResponse<any>>;
13
+ disableUser: (id: string | number) => Promise<ApiResponse<any>>;
14
+ assignRoles: (userId: string | number, roleIds: string[]) => Promise<ApiResponse<any>>;
15
+ }
16
+ /**
17
+ * 查询用户列表
18
+ * @param http Http 请求实例
19
+ * @param params 查询参数
20
+ * @returns 用户列表响应
21
+ */
22
+ export declare function queryUserList(http: Record<string, any>, params: UserQueryModel): Promise<ApiResponse<UserListResponse>>;
23
+ /**
24
+ * 获取用户详情
25
+ * @param http Http 请求实例
26
+ * @param id 用户ID
27
+ * @returns 用户详情响应
28
+ */
29
+ export declare function getUserDetail(http: Record<string, any>, id: string | number): Promise<ApiResponse<any>>;
30
+ /**
31
+ * 创建用户
32
+ * @param http Http 请求实例
33
+ * @param data 用户表单数据
34
+ * @returns 创建响应
35
+ */
36
+ export declare function createUser(http: Record<string, any>, data: UserFormModel & {
37
+ password?: string;
38
+ }): Promise<ApiResponse<any>>;
39
+ /**
40
+ * 更新用户
41
+ * @param http Http 请求实例
42
+ * @param data 用户表单数据
43
+ * @returns 更新响应
44
+ */
45
+ export declare function updateUser(http: Record<string, any>, data: UserFormModel): Promise<ApiResponse<any>>;
46
+ /**
47
+ * 删除用户
48
+ * @param http Http 请求实例
49
+ * @param id 用户ID
50
+ * @returns 删除响应
51
+ */
52
+ export declare function deleteUser(http: Record<string, any>, id: string | number): Promise<ApiResponse<any>>;
53
+ /**
54
+ * 启用用户
55
+ * @param http Http 请求实例
56
+ * @param id 用户ID
57
+ * @returns 启用响应
58
+ */
59
+ export declare function enableUser(http: Record<string, any>, id: string | number): Promise<ApiResponse<any>>;
60
+ /**
61
+ * 禁用用户
62
+ * @param http Http 请求实例
63
+ * @param id 用户ID
64
+ * @returns 禁用响应
65
+ */
66
+ export declare function disableUser(http: Record<string, any>, id: string | number): Promise<ApiResponse<any>>;
67
+ /**
68
+ * 分配角色
69
+ * @param http Http 请求实例
70
+ * @param userId 用户ID
71
+ * @param roleIds 角色ID数组
72
+ * @returns 分配响应
73
+ */
74
+ export declare function assignRoles(http: Record<string, any>, userId: string | number, roleIds: string[]): Promise<ApiResponse<any>>;
@@ -0,0 +1,96 @@
1
+ import { UserQueryModel, UserRowModel, UserFormModel, PaginationModel } from '../types/user.types';
2
+
3
+ /**
4
+ * Store 接口(localStorage 操作)
5
+ */
6
+ export interface UserStore {
7
+ getItem: (key: string) => string | null;
8
+ setItem: (key: string, value: string) => void;
9
+ removeItem: (key: string) => void;
10
+ clear: () => void;
11
+ }
12
+ /**
13
+ * Http 请求实例接口
14
+ */
15
+ export interface UserHttp {
16
+ queryUserList: (params: UserQueryModel) => Promise<any>;
17
+ getUserDetail: (id: string | number) => Promise<any>;
18
+ createUser: (data: UserFormModel) => Promise<any>;
19
+ updateUser: (data: UserFormModel) => Promise<any>;
20
+ deleteUser: (id: string | number) => Promise<any>;
21
+ enableUser: (id: string | number) => Promise<any>;
22
+ disableUser: (id: string | number) => Promise<any>;
23
+ assignRoles: (userId: string | number, roleIds: string[]) => Promise<any>;
24
+ }
25
+ /**
26
+ * 配置项接口
27
+ */
28
+ export interface UserConfig {
29
+ queryParamsKey?: string;
30
+ [key: string]: any;
31
+ }
32
+ /**
33
+ * 用户列表 composable
34
+ */
35
+ export declare function useUserList(store: UserStore, http: UserHttp, config?: UserConfig): {
36
+ loading: import('vue').Ref<boolean, boolean>;
37
+ userList: import('vue').Ref<{
38
+ [x: string]: any;
39
+ id: string | number;
40
+ username: string;
41
+ tenantId?: string | number | undefined;
42
+ status: number;
43
+ createTime: string;
44
+ updateTime?: string | undefined;
45
+ roles?: {
46
+ roleId: string | number;
47
+ roleName: string;
48
+ }[] | undefined;
49
+ }[], UserRowModel[] | {
50
+ [x: string]: any;
51
+ id: string | number;
52
+ username: string;
53
+ tenantId?: string | number | undefined;
54
+ status: number;
55
+ createTime: string;
56
+ updateTime?: string | undefined;
57
+ roles?: {
58
+ roleId: string | number;
59
+ roleName: string;
60
+ }[] | undefined;
61
+ }[]>;
62
+ queryParams: import('vue').Ref<{
63
+ [x: string]: any;
64
+ username?: string | undefined;
65
+ phone?: string | undefined;
66
+ status?: number | undefined;
67
+ page?: number | undefined;
68
+ pageSize?: number | undefined;
69
+ }, UserQueryModel | {
70
+ [x: string]: any;
71
+ username?: string | undefined;
72
+ phone?: string | undefined;
73
+ status?: number | undefined;
74
+ page?: number | undefined;
75
+ pageSize?: number | undefined;
76
+ }>;
77
+ pagination: import('vue').Ref<{
78
+ total: number;
79
+ page: number;
80
+ pageSize: number;
81
+ }, PaginationModel | {
82
+ total: number;
83
+ page: number;
84
+ pageSize: number;
85
+ }>;
86
+ loadUserList: () => Promise<void>;
87
+ handleSearch: (params: UserQueryModel) => Promise<void>;
88
+ handleReset: () => Promise<void>;
89
+ handleCreate: (data: UserFormModel) => Promise<boolean>;
90
+ handleUpdate: (data: UserFormModel) => Promise<boolean>;
91
+ handleDelete: (userId: string | number) => Promise<boolean>;
92
+ handleEnable: (userId: string | number) => Promise<boolean>;
93
+ handleDisable: (userId: string | number) => Promise<boolean>;
94
+ handlePageChange: (page: number, pageSize: number) => Promise<void>;
95
+ loadSavedQueryParams: () => void;
96
+ };
@@ -0,0 +1,93 @@
1
+ import { UserStore, UserHttp, UserConfig } from './composables/use-list';
2
+
3
+ interface Props {
4
+ store: UserStore | any;
5
+ http?: UserHttp | {
6
+ appUserApis?: any;
7
+ roleApis?: any;
8
+ };
9
+ config?: UserConfig;
10
+ data: {
11
+ permissions: {
12
+ search: string;
13
+ reset: string;
14
+ create: string;
15
+ tableList: string;
16
+ detail: string;
17
+ enable: string;
18
+ disable: string;
19
+ assignRoles: string | string[];
20
+ delete: string;
21
+ pagination: string;
22
+ };
23
+ [key: string]: any;
24
+ };
25
+ }
26
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
27
+ config: () => {};
28
+ data: () => {
29
+ permissions: {
30
+ search: string;
31
+ reset: string;
32
+ create: string;
33
+ tableList: string;
34
+ detail: string;
35
+ enable: string;
36
+ disable: string;
37
+ assignRoles: string;
38
+ delete: string;
39
+ pagination: string;
40
+ };
41
+ };
42
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
43
+ config: () => {};
44
+ data: () => {
45
+ permissions: {
46
+ search: string;
47
+ reset: string;
48
+ create: string;
49
+ tableList: string;
50
+ detail: string;
51
+ enable: string;
52
+ disable: string;
53
+ assignRoles: string;
54
+ delete: string;
55
+ pagination: string;
56
+ };
57
+ };
58
+ }>>> & Readonly<{}>, {
59
+ data: {
60
+ permissions: {
61
+ search: string;
62
+ reset: string;
63
+ create: string;
64
+ tableList: string;
65
+ detail: string;
66
+ enable: string;
67
+ disable: string;
68
+ assignRoles: string | string[];
69
+ delete: string;
70
+ pagination: string;
71
+ };
72
+ [key: string]: any;
73
+ };
74
+ config: UserConfig;
75
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
76
+ export default _default;
77
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
78
+ type __VLS_TypePropsToRuntimeProps<T> = {
79
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
80
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
81
+ } : {
82
+ type: import('vue').PropType<T[K]>;
83
+ required: true;
84
+ };
85
+ };
86
+ type __VLS_WithDefaults<P, D> = {
87
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
88
+ default: D[K];
89
+ }> : P[K];
90
+ };
91
+ type __VLS_Prettify<T> = {
92
+ [K in keyof T]: T[K];
93
+ } & {};
@@ -0,0 +1,73 @@
1
+ /**
2
+ * 用户相关类型定义
3
+ */
4
+ /**
5
+ * 查询条件模型
6
+ */
7
+ export interface UserQueryModel {
8
+ username?: string;
9
+ phone?: string;
10
+ status?: number;
11
+ page?: number;
12
+ pageSize?: number;
13
+ [key: string]: any;
14
+ }
15
+ /**
16
+ * 角色信息模型
17
+ */
18
+ export interface UserRoleModel {
19
+ roleId: string | number;
20
+ roleName: string;
21
+ }
22
+ /**
23
+ * 列表行数据模型
24
+ */
25
+ export interface UserRowModel {
26
+ id: string | number;
27
+ username: string;
28
+ tenantId?: string | number;
29
+ status: number;
30
+ createTime: string;
31
+ updateTime?: string;
32
+ roles?: UserRoleModel[];
33
+ [key: string]: any;
34
+ }
35
+ /**
36
+ * 表单数据模型
37
+ */
38
+ export interface UserFormModel {
39
+ id?: string | number;
40
+ username: string;
41
+ tenantId?: string | number;
42
+ status?: number;
43
+ [key: string]: any;
44
+ }
45
+ /**
46
+ * 分页数据模型
47
+ */
48
+ export interface PaginationModel {
49
+ total: number;
50
+ page: number;
51
+ pageSize: number;
52
+ }
53
+ /**
54
+ * 列表响应模型
55
+ */
56
+ export interface UserListResponse {
57
+ list: UserRowModel[];
58
+ total: number;
59
+ page?: number;
60
+ pageSize?: number;
61
+ }
62
+ /**
63
+ * API 通用响应模型
64
+ */
65
+ export interface ApiResponse<T = any> {
66
+ code: number;
67
+ message: string;
68
+ data: T;
69
+ traceId?: string | null;
70
+ timestamp?: string;
71
+ success?: boolean;
72
+ failure?: boolean;
73
+ }