提交
This commit is contained in:
1 parent
246ad2228e
commit
8e2dd8b9f0
186 files changed
+38821
-2571
No files matched your search
@@ -0,0 +1,206 @@
|
||||
import request from '@/utils/http'
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// 流程定义
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export function fetchProcessDefList(params?: {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
keyword?: string
|
||||
status?: string
|
||||
}) {
|
||||
return request.get<{
|
||||
list: Api.Workflow.ProcessDefItem[]
|
||||
total: number
|
||||
page: number
|
||||
pageSize: number
|
||||
totalPages: number
|
||||
}>({
|
||||
url: '/web/admin/workflow/defs',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchCreateProcessDef(data: {
|
||||
processCode: string
|
||||
processName: string
|
||||
status?: string
|
||||
orderNum?: number
|
||||
remark?: string
|
||||
}) {
|
||||
return request.post<Api.Workflow.ProcessDefItem>({
|
||||
url: '/web/admin/workflow/defs',
|
||||
data,
|
||||
showSuccessMessage: true
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchUpdateProcessDef(
|
||||
id: string,
|
||||
data: Partial<{
|
||||
processCode: string
|
||||
processName: string
|
||||
status: string
|
||||
orderNum: number
|
||||
remark: string
|
||||
}>
|
||||
) {
|
||||
return request.put<Api.Workflow.ProcessDefItem>({
|
||||
url: `/web/admin/workflow/defs/${id}`,
|
||||
data,
|
||||
showSuccessMessage: true
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchDeleteProcessDef(id: string) {
|
||||
return request.del({
|
||||
url: `/web/admin/workflow/defs/${id}`,
|
||||
showSuccessMessage: true
|
||||
})
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// 发布版本
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export function fetchPublishVersion(
|
||||
defId: string,
|
||||
data: {
|
||||
graphJson: string
|
||||
nodes: Array<{
|
||||
nodeKey: string
|
||||
nodeType: string
|
||||
nodeName?: string | null
|
||||
configJson?: string | null
|
||||
}>
|
||||
transitions: Array<{
|
||||
fromNodeKey: string
|
||||
toNodeKey: string
|
||||
conditionExpr?: string | null
|
||||
}>
|
||||
remark?: string
|
||||
}
|
||||
) {
|
||||
return request.post({
|
||||
url: `/web/admin/workflow/defs/${defId}/publish`,
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchVersionList(defId: string) {
|
||||
return request.get<Api.Workflow.VersionItem[]>({
|
||||
url: `/web/admin/workflow/defs/${defId}/versions`
|
||||
})
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// 设计器数据
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export function fetchDesignerData(defId: string) {
|
||||
return request.get<Api.Workflow.DesignerData>({
|
||||
url: `/web/admin/workflow/defs/${defId}/designer`
|
||||
})
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// 流程实例
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export function fetchStartInstance(data: {
|
||||
processCode: string
|
||||
businessType?: string
|
||||
businessId?: string
|
||||
variables?: Record<string, any>
|
||||
callbackUrl?: string
|
||||
}) {
|
||||
return request.post<{ instanceId: string }>({
|
||||
url: '/web/admin/workflow/instances',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchInstanceDetail(instanceId: string) {
|
||||
return request.get<Api.Workflow.InstanceDetail>({
|
||||
url: `/web/admin/workflow/instances/${instanceId}`
|
||||
})
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// 任务办理
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export function fetchPendingTasks(params?: {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
keyword?: string
|
||||
}) {
|
||||
return request.get<{
|
||||
list: Api.Workflow.TaskItem[]
|
||||
total: number
|
||||
page: number
|
||||
pageSize: number
|
||||
totalPages: number
|
||||
}>({
|
||||
url: '/web/admin/workflow/tasks/pending',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchCompletedTasks(params?: {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
keyword?: string
|
||||
}) {
|
||||
return request.get<{
|
||||
list: Api.Workflow.TaskItem[]
|
||||
total: number
|
||||
page: number
|
||||
pageSize: number
|
||||
totalPages: number
|
||||
}>({
|
||||
url: '/web/admin/workflow/tasks/completed',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchApproveTask(taskId: string, data?: { commentText?: string }) {
|
||||
return request.post({
|
||||
url: `/web/admin/workflow/tasks/${taskId}/approve`,
|
||||
data,
|
||||
showSuccessMessage: true
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchRejectTask(taskId: string, data?: { commentText?: string }) {
|
||||
return request.post({
|
||||
url: `/web/admin/workflow/tasks/${taskId}/reject`,
|
||||
data,
|
||||
showSuccessMessage: true
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchMyInstances(params?: {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
keyword?: string
|
||||
status?: string
|
||||
}) {
|
||||
return request.get<{
|
||||
list: Api.Workflow.MyInstanceItem[]
|
||||
total: number
|
||||
page: number
|
||||
pageSize: number
|
||||
totalPages: number
|
||||
}>({
|
||||
url: '/web/admin/workflow/instances/my',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchBusinessAllTasks(businessType: string, businessId: string) {
|
||||
return request.get<Api.Workflow.BusinessAllTasks>({
|
||||
url: `/web/admin/workflow/instances/by-business/${businessType}/${businessId}`
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user