Skip to content

Commit 22199c6

Browse files
YunaiVgitee-org
authored andcommitted
!595 bpm 仿钉钉/飞书模式
Merge pull request !595 from 芋道源码/feature/bpm
2 parents 16aef13 + 4ffaa2d commit 22199c6

File tree

95 files changed

+6926
-3988
lines changed

Some content is hidden

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

95 files changed

+6926
-3988
lines changed

.image/工作流设计器-bpmn.jpg

177 KB
Loading

.image/工作流设计器-simple.jpg

127 KB
Loading

README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,22 @@
120120

121121
### 工作流程
122122

123-
| | 功能 | 描述 |
124-
|-----|-------|----------------------------------------|
125-
| 🚀 | 流程模型 | 配置工作流的流程模型,支持文件导入与在线设计流程图,提供 7 种任务分配规则 |
126-
| 🚀 | 流程表单 | 拖动表单元素生成相应的工作流表单,覆盖 Element UI 所有的表单组件 |
127-
| 🚀 | 用户分组 | 自定义用户分组,可用于工作流的审批分组 |
128-
| 🚀 | 我的流程 | 查看我发起的工作流程,支持新建、取消流程等操作,高亮流程图、审批时间线 |
129-
| 🚀 | 待办任务 | 查看自己【未】审批的工作任务,支持通过、不通过、转发、委派、退回等操作 |
130-
| 🚀 | 已办任务 | 查看自己【已】审批的工作任务,未来会支持回退操作 |
131-
| 🚀 | OA 请假 | 作为业务自定义接入工作流的使用示例,只需创建请求对应的工作流程,即可进行审批 |
123+
| | 功能 | 描述 |
124+
|----|-------|-----------------------------------------|
125+
| 🚀 | 流程模型 | 配置工作流的流程模型,支持 BPMN 和仿钉钉/飞书设计器 |
126+
| 🚀 | 流程表单 | 拖动表单元素生成相应的工作流表单,覆盖 Element UI 所有的表单组件 |
127+
| 🚀 | 用户分组 | 自定义用户分组,可用于工作流的审批分组 |
128+
| 🚀 | 我的流程 | 查看我发起的工作流程,支持新建、取消流程等操作,高亮流程图、审批时间线 |
129+
| 🚀 | 待办任务 | 查看自己【未】审批的工作任务,支持通过、不通过、转派、委派、退回、加减签等操作 |
130+
| 🚀 | 已办任务 | 查看自己【已】审批的工作任务,支持流程预测,展示未来审批人信息 |
131+
| 🚀 | OA 请假 | 作为业务自定义接入工作流的使用示例,只需创建请求对应的工作流程,即可进行审批 |
132132

133133
![功能图](/.image/common/bpm-feature.png)
134134

135+
| BPMN 设计器 | 钉钉/飞书设计器 |
136+
|------------------------------|--------------------------------|
137+
| ![](/.image/工作流设计器-bpmn.jpg) | ![](/.image/工作流设计器-simple.jpg) |
138+
135139
### 支付系统
136140

137141
| | 功能 | 描述 |

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"pinia-plugin-persistedstate": "^3.2.1",
6565
"qrcode": "^1.5.3",
6666
"qs": "^6.12.0",
67+
"sortablejs": "^1.15.3",
6768
"steady-xml": "^0.1.0",
6869
"url": "^0.11.3",
6970
"video.js": "^7.21.5",
@@ -95,7 +96,7 @@
9596
"@vitejs/plugin-vue": "^5.0.4",
9697
"@vitejs/plugin-vue-jsx": "^3.1.0",
9798
"autoprefixer": "^10.4.17",
98-
"bpmn-js": "8.9.0",
99+
"bpmn-js": "8.10.0",
99100
"bpmn-js-properties-panel": "0.46.0",
100101
"consola": "^3.2.3",
101102
"eslint": "^8.57.0",

pnpm-lock.yaml

Lines changed: 89 additions & 82 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/api/bpm/activity/index.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/api/bpm/category/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ export const CategoryApi = {
3636
return await request.put({ url: `/bpm/category/update`, data })
3737
},
3838

39+
// 批量修改流程分类的排序
40+
updateCategorySortBatch: async (ids: number[]) => {
41+
return await request.put({
42+
url: `/bpm/category/update-sort-batch`,
43+
params: {
44+
ids: ids.join(',')
45+
}
46+
})
47+
},
48+
3949
// 删除流程分类
4050
deleteCategory: async (id: number) => {
4151
return await request.delete({ url: `/bpm/category/delete?id=` + id })

src/api/bpm/model/index.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ export type ModelVO = {
2626
bpmnXml: string
2727
}
2828

29-
export const getModelPage = async (params) => {
30-
return await request.get({ url: '/bpm/model/page', params })
29+
export const getModelList = async (name: string | undefined) => {
30+
return await request.get({ url: '/bpm/model/list', params: { name } })
3131
}
3232

3333
export const getModel = async (id: string) => {
@@ -38,6 +38,16 @@ export const updateModel = async (data: ModelVO) => {
3838
return await request.put({ url: '/bpm/model/update', data: data })
3939
}
4040

41+
// 批量修改流程分类的排序
42+
export const updateModelSortBatch = async (ids: number[]) => {
43+
return await request.put({
44+
url: `/bpm/model/update-sort-batch`,
45+
params: {
46+
ids: ids.join(',')
47+
}
48+
})
49+
}
50+
4151
export const updateModelBpmn = async (data: ModelVO) => {
4252
return await request.put({ url: '/bpm/model/update-bpmn', data: data })
4353
}

src/api/bpm/processInstance/index.ts

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import request from '@/config/axios'
22
import { ProcessDefinitionVO } from '@/api/bpm/model'
3-
import { NodeType } from '@/components/SimpleProcessDesignerV2/src/consts'
3+
import { NodeType, CandidateStrategy } from '@/components/SimpleProcessDesignerV2/src/consts'
44
export type Task = {
55
id: string
66
name: string
@@ -24,30 +24,30 @@ export type ProcessInstanceVO = {
2424

2525
// 用户信息
2626
export type User = {
27-
id: number,
28-
nickname: string,
27+
id: number
28+
nickname: string
2929
avatar: string
3030
}
3131

3232
// 审批任务信息
3333
export type ApprovalTaskInfo = {
34-
id: number,
35-
ownerUser: User,
36-
assigneeUser: User,
37-
status: number,
34+
id: number
35+
ownerUser: User
36+
assigneeUser: User
37+
status: number
3838
reason: string
39-
4039
}
4140

4241
// 审批节点信息
4342
export type ApprovalNodeInfo = {
44-
id : number
43+
id: number
4544
name: string
4645
nodeType: NodeType
46+
candidateStrategy?: CandidateStrategy
4747
status: number
4848
startTime?: Date
4949
endTime?: Date
50-
candidateUserList?: User[]
50+
candidateUsers?: User[]
5151
tasks: ApprovalTaskInfo[]
5252
}
5353

@@ -88,12 +88,16 @@ export const getProcessInstanceCopyPage = async (params: any) => {
8888
}
8989

9090
// 获取审批详情
91-
export const getApprovalDetail = async (processInstanceId?:string, processDefinitionId?:string) => {
92-
const param = processInstanceId ? '?processInstanceId='+ processInstanceId : '?processDefinitionId='+ processDefinitionId
93-
return await request.get({ url: 'bpm/process-instance/get-approval-detail'+ param })
91+
export const getApprovalDetail = async (params: any) => {
92+
return await request.get({ url: 'bpm/process-instance/get-approval-detail' , params })
9493
}
9594

9695
// 获取表单字段权限
9796
export const getFormFieldsPermission = async (params: any) => {
9897
return await request.get({ url: '/bpm/process-instance/get-form-fields-permission', params })
9998
}
99+
100+
// 获取流程实例的 BPMN 模型视图
101+
export const getProcessInstanceBpmnModelView = async (id: string) => {
102+
return await request.get({ url: '/bpm/process-instance/get-bpmn-model-view?id=' + id })
103+
}

src/api/bpm/task/index.ts

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ export enum TaskStatusEnum {
99
*/
1010
NOT_START = -1,
1111

12-
/**
12+
/**
1313
* 待审批
1414
*/
15-
WAIT = 0,
15+
WAIT = 0,
1616
/**
1717
* 审批中
1818
*/
@@ -26,7 +26,7 @@ export enum TaskStatusEnum {
2626
* 审批不通过
2727
*/
2828
REJECT = 3,
29-
29+
3030
/**
3131
* 已取消
3232
*/
@@ -35,19 +35,10 @@ export enum TaskStatusEnum {
3535
* 已退回
3636
*/
3737
RETURN = 5,
38-
/**
39-
* 委派中
40-
*/
41-
DELEGATE = 6,
4238
/**
4339
* 审批通过中
4440
*/
45-
APPROVING = 7,
46-
47-
}
48-
49-
export type TaskVO = {
50-
id: number
41+
APPROVING = 7
5142
}
5243

5344
export const getTaskTodoPage = async (params: any) => {
@@ -76,12 +67,12 @@ export const getTaskListByProcessInstanceId = async (processInstanceId: string)
7667
})
7768
}
7869

79-
// 获取所有可回退的节点
70+
// 获取所有可退回的节点
8071
export const getTaskListByReturn = async (id: string) => {
8172
return await request.get({ url: '/bpm/task/list-by-return', params: { id } })
8273
}
8374

84-
// 回退
75+
// 退回
8576
export const returnTask = async (data: any) => {
8677
return await request.put({ url: '/bpm/task/return', data })
8778
}
@@ -106,6 +97,16 @@ export const signDeleteTask = async (data: any) => {
10697
return await request.delete({ url: '/bpm/task/delete-sign', data })
10798
}
10899

100+
// 抄送
101+
export const copyTask = async (data: any) => {
102+
return await request.put({ url: '/bpm/task/copy', data })
103+
}
104+
105+
// 获取我的待办任务
106+
export const myTodoTask = async (processInstanceId: string) => {
107+
return await request.get({ url: '/bpm/task/my-todo?processInstanceId=' + processInstanceId })
108+
}
109+
109110
// 获取减签任务列表
110111
export const getChildrenTaskList = async (id: string) => {
111112
return await request.get({ url: '/bpm/task/list-by-parent-task-id?parentTaskId=' + id })

0 commit comments

Comments
 (0)