feat(permission): replace OA roles with post-bound roles and assignee posts
Unify effective roles via post-role bindings, remove dedicated OA role UI, and update OA assignee resolution plus related SQL/docs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
a3c73d76bb
commit
06db3bc966
66 files changed
+55337
-38647
No files matched your search
@@ -833,6 +833,18 @@ export function fetchUpdatePostBoundUsers(postId: string, userIds: string[]) {
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchPostBoundRoleIds(postId: string) {
|
||||
return request.get<{ roleIds: string[] }>({ url: `/web/admin/posts/${postId}/roles` })
|
||||
}
|
||||
|
||||
export function fetchUpdatePostBoundRoles(postId: string, roleIds: string[]) {
|
||||
return request.put({
|
||||
url: `/web/admin/posts/${postId}/roles`,
|
||||
params: { roleIds },
|
||||
showSuccessMessage: true
|
||||
})
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// 物品单位管理
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -2,75 +2,6 @@ import request from '@/utils/http'
|
||||
|
||||
const BASE = '/web/admin/oa-approval'
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// 工作流角色
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export function fetchOaRoleList(params?: { keyword?: string; status?: string }) {
|
||||
return request.get<{ list: any[] }>({
|
||||
url: `${BASE}/roles`,
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchEnsureOaRolePresets() {
|
||||
return request.post<{ createdCount: number }>({
|
||||
url: `${BASE}/roles/ensure-presets`,
|
||||
showSuccessMessage: true
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchCreateOaRole(data: {
|
||||
roleName: string
|
||||
roleCode: string
|
||||
status?: string
|
||||
orderNum?: number
|
||||
remark?: string
|
||||
}) {
|
||||
return request.post({
|
||||
url: `${BASE}/roles`,
|
||||
data,
|
||||
showSuccessMessage: true
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchUpdateOaRole(
|
||||
id: string,
|
||||
data: Partial<{
|
||||
roleName: string
|
||||
status: string
|
||||
orderNum: number
|
||||
remark: string
|
||||
}>
|
||||
) {
|
||||
return request.put({
|
||||
url: `${BASE}/roles/${id}`,
|
||||
data,
|
||||
showSuccessMessage: true
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchDeleteOaRole(id: string) {
|
||||
return request.del({
|
||||
url: `${BASE}/roles/${id}`,
|
||||
showSuccessMessage: true
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchOaRoleUsers(roleId: string) {
|
||||
return request.get<{ list: any[] }>({
|
||||
url: `${BASE}/roles/${roleId}/users`
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchReplaceOaRoleUsers(roleId: string, userIds: string[]) {
|
||||
return request.put<{ list: any[] }>({
|
||||
url: `${BASE}/roles/${roleId}/users`,
|
||||
data: { userIds },
|
||||
showSuccessMessage: true
|
||||
})
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// 收款账户
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -187,6 +118,13 @@ export function fetchDeleteOaApp(id: string) {
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchCopyOaApp(id: string) {
|
||||
return request.post({
|
||||
url: `${BASE}/apps/${id}/copy`,
|
||||
showSuccessMessage: true
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchOaAppDraft(appId: string) {
|
||||
return request.get<any>({ url: `${BASE}/apps/${appId}/draft` })
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user