Skip to content

Commit b0464ca

Browse files
feat: dynamics-form
1 parent 5a7562f commit b0464ca

141 files changed

Lines changed: 1390 additions & 8209 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎ui/package.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"dingtalk-jsapi": "^3.2.9",
3333
"element-plus": "^2.14.2",
3434
"jsencrypt": "^3.5.4",
35+
"lodash": "^4.18.1",
3536
"nanoid": "^6.0.1",
3637
"nprogress": "^0.2.0",
3738
"pinia": "^3.0.4",
@@ -43,6 +44,7 @@
4344
"devDependencies": {
4445
"@tailwindcss/vite": "^4.3.2",
4546
"@tsconfig/node24": "^24.0.4",
47+
"@types/lodash": "^4.17.25",
4648
"@types/node": "^24.13.2",
4749
"@types/nprogress": "^0.2.3",
4850
"@vitejs/plugin-vue": "^6.0.7",

‎ui/src/api/API_README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ API 枚举与类型统一在 `src/api` 范围内管理,相关规则由本文
7575

7676
- API 专用的请求参数、响应包装、请求配置和基础设施类型,放在对应 API 文件、资源目录的
7777
`types.ts`,或该 API 业务域的 `common.ts`。
78+
- 字符串键字典统一使用 `@/api/types` 导出的 `Dict<T>`;未收窄值类型的请求查询参数使用
79+
`Dict<unknown>`,不再为相同结构声明额外别名。
7880
- `src/api/types` 只存放 API 与 View 或 Component 跨层共用的业务类型,使用方统一通过
7981
`import type { ... } from '@/api/types'` 导入,不写 `/index.ts`。
8082
- `src/api/types/index.ts` 只负责导出各业务域类型,不直接声明类型。

‎ui/src/api/admin/core/request.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import axios, {
99
import router from '@/router/admin'
1010
import { useStore } from '@/stores'
1111
import type { ApiResponse, LoadingTarget } from './types'
12-
import type { RequestParams } from '@/api/types'
12+
import type { Dict } from '@/api/types'
1313
import { MsgError } from '@/utils/message'
1414

1515
const DEFAULT_TIMEOUT = 30 * 60 * 1_000 // 30 minutes
@@ -200,7 +200,7 @@ export async function promise<T>(
200200
/** 发送 GET 请求。 */
201201
export function get<T = unknown>(
202202
url: string,
203-
params?: RequestParams,
203+
params?: Dict<unknown>,
204204
loading?: LoadingTarget,
205205
timeout?: number,
206206
) {
@@ -211,7 +211,7 @@ export function get<T = unknown>(
211211
export async function getExportFile(
212212
fileName: string,
213213
url: string,
214-
params?: RequestParams,
214+
params?: Dict<unknown>,
215215
loading?: LoadingTarget,
216216
): Promise<boolean> {
217217
startLoading(loading)
@@ -232,7 +232,7 @@ export async function getExportFile(
232232
export async function postExportExcel<TData = unknown>(
233233
fileName: string,
234234
url: string,
235-
params?: RequestParams,
235+
params?: Dict<unknown>,
236236
data?: TData,
237237
loading?: LoadingTarget,
238238
): Promise<boolean> {
@@ -254,7 +254,7 @@ export async function postExportExcel<TData = unknown>(
254254
export function post<TData = unknown, T = unknown>(
255255
url: string,
256256
data?: TData,
257-
params?: RequestParams,
257+
params?: Dict<unknown>,
258258
loading?: LoadingTarget,
259259
timeout?: number,
260260
) {
@@ -265,7 +265,7 @@ export function post<TData = unknown, T = unknown>(
265265
export function put<TData = unknown, T = unknown>(
266266
url: string,
267267
data?: TData,
268-
params?: RequestParams,
268+
params?: Dict<unknown>,
269269
loading?: LoadingTarget,
270270
timeout?: number,
271271
) {
@@ -275,7 +275,7 @@ export function put<TData = unknown, T = unknown>(
275275
/** 发送 DELETE 请求。 */
276276
export function del<TData = unknown, T = unknown>(
277277
url: string,
278-
params?: RequestParams,
278+
params?: Dict<unknown>,
279279
data?: TData,
280280
loading?: LoadingTarget,
281281
timeout?: number,

‎ui/src/api/admin/system/chat-user-groups.ts‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
import { del, get, post } from '../core/request'
22
import type { ParamsPage, ResponsePage } from '../core/types'
3-
import type {
4-
ChatUserGroupMember,
5-
ChatUserGroupPayload,
6-
ListItem,
7-
RequestParams,
8-
} from '@/api/types'
3+
import type { ChatUserGroupMember, ChatUserGroupPayload, ListItem, Dict } from '@/api/types'
94

105
const prefix = '/system/group'
116

@@ -25,7 +20,7 @@ const deleteChatUserGroup = (groupId: string) => {
2520
}
2621

2722
/** 获取用户组成员分页列表。 */
28-
const getChatUserGroupMembers = (groupId: string, page: ParamsPage, query?: RequestParams) => {
23+
const getChatUserGroupMembers = (groupId: string, page: ParamsPage, query?: Dict<unknown>) => {
2924
return get<ResponsePage<ChatUserGroupMember>>(
3025
`${prefix}/${groupId}/user_list/${page.currentPage}/${page.pageSize}`,
3126
query,

‎ui/src/api/admin/system/chat-user.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import type {
1111
ChatUserQuotaPayload,
1212
ChatUserSyncResult,
1313
ChatUserUpdateRequest,
14-
RequestParams,
14+
Dict,
1515
} from '@/api/types'
1616

1717
const prefix = '/system/chat_user'
@@ -22,7 +22,7 @@ const getChatUser = () => {
2222
}
2323

2424
/** 获取对话用户分页列表。 */
25-
const getChatUserPage = (page: ParamsPage, query?: RequestParams) => {
25+
const getChatUserPage = (page: ParamsPage, query?: Dict<unknown>) => {
2626
return get<ResponsePage<ChatUser>>(
2727
`${prefix}/user_manage/${page.currentPage}/${page.pageSize}`,
2828
query,

‎ui/src/api/admin/system/common.ts‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
import { get } from '../core/request'
2-
import type { RequestParams, SystemUserOption, CommonUserOption } from '@/api/types'
2+
import type { CommonUserOption, Dict, SystemUserOption } from '@/api/types'
33

44
/** 获取默认密码。 */
55
const getDefaultPassword = () => {
66
return get<{ password: string }>(`/user_manage/password`)
77
}
88

99
/** 获得全部用户 */
10-
const getAllUsers = (query?: RequestParams) => {
10+
const getAllUsers = (query?: Dict<unknown>) => {
1111
return get<SystemUserOption[]>('/user/list', query)
1212
}
1313

1414
/** 获取指定工作空间的普通用户选项。 */
15-
const getWorkspaceMembers = (workspaceId: string, query?: RequestParams) => {
15+
const getWorkspaceMembers = (workspaceId: string, query?: Dict<unknown>) => {
1616
return get<CommonUserOption[]>(`/workspace/${workspaceId}/user_member`, query)
1717
}
1818

19-
20-
2119
export default {
2220
getDefaultPassword,
2321
getAllUsers,

‎ui/src/api/admin/system/operate-log.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { postExportExcel, get, post } from '../core/request'
22
import type { ParamsPage, ResponsePage } from '../core/types'
3-
import type { OperateLog, OperateLogMenuOption, RequestParams } from '@/api/types'
3+
import type { Dict, OperateLog, OperateLogMenuOption } from '@/api/types'
44

55
const prefix = '/operate_log'
66

77
/** 获取操作日志分页列表。 */
8-
const getOperateLogPage = (page: ParamsPage, query: RequestParams) => {
8+
const getOperateLogPage = (page: ParamsPage, query: Dict<unknown>) => {
99
return get<ResponsePage<OperateLog>>(`${prefix}/${page.currentPage}/${page.pageSize}`, query)
1010
}
1111

@@ -15,7 +15,7 @@ const getOperateLogMenuOptions = () => {
1515
}
1616

1717
/** 导出操作日志。 */
18-
const exportOperateLog = (query: RequestParams) => {
18+
const exportOperateLog = (query: Dict<unknown>) => {
1919
return postExportExcel('log.xlsx', `${prefix}/export/`, query)
2020
}
2121

‎ui/src/api/admin/system/resource-authorization.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { get, put } from '../core/request'
22
import type {
3-
RequestParams,
3+
Dict,
44
ResourceAuthorizationType,
55
ResourcePermissionItem,
66
ResourcePermissionPayload,
@@ -13,7 +13,7 @@ const getUserResourcePermissions = (
1313
workspaceId: string,
1414
userId: string,
1515
resource: ResourceAuthorizationType,
16-
query?: RequestParams,
16+
query?: Dict<unknown>,
1717
) => {
1818
return get<ResourcePermissionItem[]>(
1919
`${prefix(workspaceId)}/user/${userId}/resource/${resource}`,
@@ -34,7 +34,6 @@ const putUserResourcePermissions = (
3434
)
3535
}
3636

37-
3837
export default {
3938
getUserResourcePermissions,
4039
putUserResourcePermissions,

‎ui/src/api/admin/system/role.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { del, get, post } from '../core/request'
22
import type { ParamsPage, ResponsePage } from '../core/types'
33
import type {
44
CreateRoleMembersRequest,
5-
RequestParams,
5+
Dict,
66
RoleItem,
77
RoleMember,
88
RolePermissionModule,
@@ -27,20 +27,18 @@ const deleteRole = (roleId: string) => {
2727
return del<boolean>(`${prefix}/${roleId}`)
2828
}
2929

30-
3130
/** 获取指定角色的权限配置。 */
3231
const getRolePermissionList = (roleId: string) => {
3332
return get<RolePermissionModule[]>(`${prefix}/${roleId}/permission`)
3433
}
3534

36-
3735
/** 保存指定角色的权限配置。 */
3836
const postRolePermissions = (roleId: string, permissions: SaveRolePermissionRequest[]) => {
3937
return post<SaveRolePermissionRequest[], boolean>(`${prefix}/${roleId}/permission`, permissions)
4038
}
4139

4240
/** 获取指定角色的成员分页列表。 */
43-
const getRoleMemberList = (roleId: string, page: ParamsPage, query?: RequestParams) => {
41+
const getRoleMemberList = (roleId: string, page: ParamsPage, query?: Dict<unknown>) => {
4442
return get<ResponsePage<RoleMember>>(
4543
`${prefix}/${roleId}/user_list/${page.currentPage}/${page.pageSize}`,
4644
query,

‎ui/src/api/admin/system/user-groups.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { del, get, post } from '../core/request'
22
import type { ParamsPage, ResponsePage } from '../core/types'
3-
import type { SystemUserGroup, SystemUserGroupMember, RequestParams } from '@/api/types'
3+
import type { Dict, SystemUserGroup, SystemUserGroupMember } from '@/api/types'
44

55
const prefix = (workspaceId: string) => `/system/workspace/${workspaceId}/user_group`
66

@@ -24,7 +24,7 @@ const getSystemUserGroupMembers = (
2424
workspaceId: string,
2525
groupId: string,
2626
page: ParamsPage,
27-
query?: RequestParams,
27+
query?: Dict<unknown>,
2828
) => {
2929
return get<ResponsePage<SystemUserGroupMember>>(
3030
`${prefix(workspaceId)}/${groupId}/user_list/${page.currentPage}/${page.pageSize}`,

0 commit comments

Comments
 (0)