-
-
-
-
-
- {{ task.assigneeUser.nickname.substring(0, 1) }}
-
-
-
- {{ task.ownerUser.nickname.substring(0, 1) }}
-
-
+
+
+
-
+
+
+
+ {{ task.assigneeUser?.nickname.substring(0, 1) }}
+
+ {{ task.assigneeUser?.nickname }}
+
+
+
+
+ {{ task.ownerUser?.nickname.substring(0, 1) }}
+
+ {{ task.ownerUser?.nickname }}
+
+
+
+
+
-
-
-
+
- {{ task.assigneeUser.nickname }}
-
-
- {{ task.ownerUser.nickname }}
-
-
- 审批意见:{{ task.reason }}
-
-
-
-
-
-
-
-
-
-
-
- {{ user.nickname.substring(0, 1) }}
-
-
-
-
-
-
-
-
-
+
+
+ {{ user.nickname.substring(0, 1) }}
+
{{ user.nickname }}
+
+
+
+
+
+
+ 审批意见:{{ task.reason }}
+
@@ -141,93 +133,9 @@ import conditionSvg from '@/assets/svgs/bpm/condition.svg'
import parallelSvg from '@/assets/svgs/bpm/parallel.svg'
defineOptions({ name: 'BpmProcessInstanceTimeline' })
-// defineProps<{
-// approveNodes: ProcessInstanceApi.ApprovalNodeInfo[] // 审批节点信息
-// }>()
-const approveNodes = [
- {
- id: 1,
- name: '发起审批',
- nodeType: NodeType.START_USER_NODE,
- status: TaskStatusEnum.NOT_START,
- startTime: new Date('2024-10-01 10:00:00'),
- endTime: null,
- candidateUsers: [],
- tasks: []
- },
- {
- id: 2,
- name: '经理审批',
- nodeType: NodeType.USER_TASK_NODE,
- status: TaskStatusEnum.RUNNING, // 审批中
- startTime: new Date('2024-10-02 11:00:00'),
- endTime: null,
- candidateUsers: [
- {
- nickname: '张经理',
- avatar: 'https://picsum.photos/200?r=1'
- },
- {
- nickname: '张经理',
- avatar: 'https://picsum.photos/200?r=1'
- },
- {
- nickname: '张经理',
- avatar: 'https://picsum.photos/200?r=1'
- },
- {
- nickname: '张经理',
- avatar: 'https://picsum.photos/200?r=1'
- }
- ],
- tasks: [
- {
- assigneeUser: {
- nickname: '李经理',
- avatar: 'https://picsum.photos/200?r=1'
- },
- ownerUser: null,
- status: TaskStatusEnum.RUNNING, // 审批中
- reason: '同意'
- }
- ]
- },
- {
- id: 3,
- name: '财务审批',
- nodeType: NodeType.USER_TASK_NODE,
- status: TaskStatusEnum.APPROVE, // 审批通过
- startTime: new Date('2024-10-03 14:00:00'),
- endTime: new Date('2024-10-03 15:00:00'),
- candidateUsers: [],
- tasks: [
- {
- assigneeUser: {
- nickname: '王财务',
- avatar: 'https://picsum.photos/200?r=1'
- },
- ownerUser: null,
- status: TaskStatusEnum.APPROVE, // 审批通过
- reason: '审批通过'
- }
- ]
- },
- {
- id: 4,
- name: '总经理审批',
- nodeType: NodeType.USER_TASK_NODE,
- status: TaskStatusEnum.NOT_START, // 未开始
- startTime: null,
- endTime: null,
- candidateUsers: [
- {
- nickname: '总经理',
- avatar: 'https://picsum.photos/200?r=1'
- }
- ],
- tasks: []
- }
-]
+defineProps<{
+ approveNodes: ProcessInstanceApi.ApprovalNodeInfo[] // 审批节点信息
+}>()
// 审批节点
const statusIconMap2 = {
@@ -273,17 +181,21 @@ const statusIconMap = {
const nodeTypeSvgMap = {
// 发起人节点
- [NodeType.START_USER_NODE]: { color: '', svg: starterSvg },
+ [NodeType.START_USER_NODE]: { color: '#ffffff', svg: starterSvg },
// 审批人节点
- [NodeType.USER_TASK_NODE]: { color: '', svg: auditorSvg },
+ [NodeType.USER_TASK_NODE]: { color: '#ff943e', svg: auditorSvg },
// 抄送人节点
- [NodeType.COPY_TASK_NODE]: { color: '', svg: copySvg },
+ [NodeType.COPY_TASK_NODE]: { color: '#3296fb', svg: copySvg },
// 条件分支节点
- [NodeType.CONDITION_NODE]: { color: '', svg: conditionSvg },
+ [NodeType.CONDITION_NODE]: { color: '#14bb83', svg: conditionSvg },
// 并行分支节点
- [NodeType.PARALLEL_BRANCH_NODE]: { color: '', svg: parallelSvg }
+ [NodeType.PARALLEL_BRANCH_NODE]: { color: '#14bb83', svg: parallelSvg }
}
+// 只有只有状态是 -1、0、1 才展示头像右小角状态小icon
+const onlyStatusIconShow = [-1, 0, 1]
+
+// timeline时间线上icon图标
const getApprovalNodeImg = (nodeType: NodeType) => {
return nodeTypeSvgMap[nodeType]?.svg
}
From bd4ac52a2d71e910ae5313d9cb4df17c1cdb7439 Mon Sep 17 00:00:00 2001
From: GoldenZqqq <1361001127@qq.com>
Date: Fri, 25 Oct 2024 15:17:31 +0800
Subject: [PATCH 041/109] =?UTF-8?q?feat:=20=E6=B5=81=E7=A8=8B=E5=8F=91?=
=?UTF-8?q?=E8=B5=B7=E6=A8=A1=E5=9D=97-=E7=AC=AC=E4=B8=80=E6=AD=A5?=
=?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=B5=81=E7=A8=8B=E5=88=86=E7=B1=BB=E9=80=89?=
=?UTF-8?q?=E6=8B=A9=E5=AF=B9=E5=BA=94=E7=9A=84=E6=B5=81=E7=A8=8B=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2=E6=A0=B7=E5=BC=8F=E4=B8=8E=E5=B8=83=E5=B1=80=E4=BC=98?=
=?UTF-8?q?=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../bpm/processInstance/create/index_new.vue | 294 ++++++++++++++++++
src/views/bpm/processInstance/create/mock.js | 108 +++++++
2 files changed, 402 insertions(+)
create mode 100644 src/views/bpm/processInstance/create/index_new.vue
create mode 100644 src/views/bpm/processInstance/create/mock.js
diff --git a/src/views/bpm/processInstance/create/index_new.vue b/src/views/bpm/processInstance/create/index_new.vue
new file mode 100644
index 00000000..164e6cf2
--- /dev/null
+++ b/src/views/bpm/processInstance/create/index_new.vue
@@ -0,0 +1,294 @@
+
+
+
+
+
+
+
+ {{ category.name }}
+
+
+
+
+ {{ categoryActive.name }}
+
+
+
+
+
+ {{ definition.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 申请信息【{{ selectProcessDefinition.name }}】
+
+ 选择其它流程
+
+
+
+
+
+
+
+ 指定审批人
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/bpm/processInstance/create/mock.js b/src/views/bpm/processInstance/create/mock.js
new file mode 100644
index 00000000..67861662
--- /dev/null
+++ b/src/views/bpm/processInstance/create/mock.js
@@ -0,0 +1,108 @@
+// 模拟流程分类数据
+export const categoryList = [
+ { name: '审批流程', code: 'approval' },
+ { name: '管理流程', code: 'management' }
+]
+
+// 模拟流程定义数据
+export const processDefinitionList = [
+ {
+ id: '1',
+ key: 'process_1',
+ name: '请假申请',
+ category: 'approval',
+ icon: 'https://picsum.photos/200?r=1',
+ formType: 10,
+ formConf: {}, // 根据需要定义表单配置
+ formFields: [], // 根据需要定义表单字段
+ startUserSelectTasks: [
+ { id: 'task1', name: '部门经理' },
+ { id: 'task2', name: '人力资源' }
+ ]
+ },
+ {
+ id: '2',
+ key: 'process_2',
+ name: '报销申请',
+ category: 'approval',
+ icon: 'https://picsum.photos/200?r=2',
+ formType: 10,
+ formConf: {},
+ formFields: [],
+ startUserSelectTasks: [{ id: 'task3', name: '财务' }]
+ },
+ {
+ id: '3',
+ key: 'process_1',
+ name: '请假申请',
+ category: 'approval',
+ icon: 'https://picsum.photos/200?r=1',
+ formType: 10,
+ formConf: {}, // 根据需要定义表单配置
+ formFields: [], // 根据需要定义表单字段
+ startUserSelectTasks: [
+ { id: 'task1', name: '部门经理' },
+ { id: 'task2', name: '人力资源' }
+ ]
+ },
+ {
+ id: '4',
+ key: 'process_2',
+ name: '报销申请',
+ category: 'approval',
+ icon: 'https://picsum.photos/200?r=2',
+ formType: 10,
+ formConf: {},
+ formFields: [],
+ startUserSelectTasks: [{ id: 'task3', name: '财务' }]
+ },{
+ id: '5',
+ key: 'process_1',
+ name: '请假申请',
+ category: 'approval',
+ icon: 'https://picsum.photos/200?r=1',
+ formType: 10,
+ formConf: {}, // 根据需要定义表单配置
+ formFields: [], // 根据需要定义表单字段
+ startUserSelectTasks: [
+ { id: 'task1', name: '部门经理' },
+ { id: 'task2', name: '人力资源' }
+ ]
+ },
+ {
+ id: '6',
+ key: 'process_2',
+ name: '报销申请',
+ category: 'approval',
+ icon: 'https://picsum.photos/200?r=2',
+ formType: 10,
+ formConf: {},
+ formFields: [],
+ startUserSelectTasks: [{ id: 'task3', name: '财务' }]
+ },
+ {
+ id: '7',
+ key: 'process_1',
+ name: '请假申请',
+ category: 'approval',
+ icon: 'https://picsum.photos/200?r=1',
+ formType: 10,
+ formConf: {}, // 根据需要定义表单配置
+ formFields: [], // 根据需要定义表单字段
+ startUserSelectTasks: [
+ { id: 'task1', name: '部门经理' },
+ { id: 'task2', name: '人力资源' }
+ ]
+ },
+ {
+ id: '8',
+ key: 'process_2',
+ name: '报销申请',
+ category: 'approval',
+ icon: 'https://picsum.photos/200?r=2',
+ formType: 10,
+ formConf: {},
+ formFields: [],
+ startUserSelectTasks: [{ id: 'task3', name: '财务' }]
+ }
+]
From dca54d0760afc1e5079caab13f9416d349e5933f Mon Sep 17 00:00:00 2001
From: YunaiV
Date: Sat, 26 Oct 2024 21:30:59 +0800
Subject: [PATCH 042/109] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E5=AE=8C?=
=?UTF-8?q?=E5=96=84=E3=80=91=E5=B7=A5=E4=BD=9C=E6=B5=81=EF=BC=9A=E5=AE=A1?=
=?UTF-8?q?=E6=89=B9=E8=AF=A6=E6=83=85=E7=95=8C=E9=9D=A2=EF=BC=8C=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=20end=20=E5=9B=BE=E6=A0=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/assets/svgs/bpm/end.svg | 1 +
.../detail/ProcessInstanceTimeline.vue | 11 +++++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
create mode 100644 src/assets/svgs/bpm/end.svg
diff --git a/src/assets/svgs/bpm/end.svg b/src/assets/svgs/bpm/end.svg
new file mode 100644
index 00000000..21bd3a30
--- /dev/null
+++ b/src/assets/svgs/bpm/end.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue b/src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue
index 7c87d55f..329eab53 100644
--- a/src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue
+++ b/src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue
@@ -131,6 +131,7 @@ import auditorSvg from '@/assets/svgs/bpm/auditor.svg'
import copySvg from '@/assets/svgs/bpm/copy.svg'
import conditionSvg from '@/assets/svgs/bpm/condition.svg'
import parallelSvg from '@/assets/svgs/bpm/parallel.svg'
+import endSvg from '@/assets/svgs/bpm/end.svg'
defineOptions({ name: 'BpmProcessInstanceTimeline' })
defineProps<{
@@ -189,7 +190,9 @@ const nodeTypeSvgMap = {
// 条件分支节点
[NodeType.CONDITION_NODE]: { color: '#14bb83', svg: conditionSvg },
// 并行分支节点
- [NodeType.PARALLEL_BRANCH_NODE]: { color: '#14bb83', svg: parallelSvg }
+ [NodeType.PARALLEL_BRANCH_NODE]: { color: '#14bb83', svg: parallelSvg },
+ // 结束节点
+ [NodeType.END_EVENT_NODE]: { color: '#ffffff', svg: endSvg }
}
// 只有只有状态是 -1、0、1 才展示头像右小角状态小icon
@@ -205,7 +208,11 @@ const getApprovalNodeIcon = (taskStatus: number, nodeType: NodeType) => {
return statusIconMap[taskStatus]?.icon
}
- if (nodeType === NodeType.START_USER_NODE || nodeType === NodeType.USER_TASK_NODE) {
+ if (
+ nodeType === NodeType.START_USER_NODE ||
+ nodeType === NodeType.USER_TASK_NODE ||
+ nodeType === NodeType.END_EVENT_NODE
+ ) {
return statusIconMap[taskStatus]?.icon
}
}
From d599134de662bdec7b1e29eda56c4ee0a463659a Mon Sep 17 00:00:00 2001
From: YunaiV
Date: Sat, 26 Oct 2024 22:55:28 +0800
Subject: [PATCH 043/109] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E5=AE=8C?=
=?UTF-8?q?=E5=96=84=E3=80=91=E5=B7=A5=E4=BD=9C=E6=B5=81=EF=BC=9A=E5=AE=A1?=
=?UTF-8?q?=E6=89=B9=E8=AF=A6=E6=83=85=20approve-nodes=20=3D>=20activity-n?=
=?UTF-8?q?odes=20=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../processInstance/detail/ProcessInstanceTimeline.vue | 9 ++++++---
src/views/bpm/processInstance/detail/index.vue | 6 +++---
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue b/src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue
index 329eab53..d2a7a357 100644
--- a/src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue
+++ b/src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue
@@ -3,7 +3,7 @@
审批意见:{{ task.reason }}
@@ -135,7 +138,7 @@ import endSvg from '@/assets/svgs/bpm/end.svg'
defineOptions({ name: 'BpmProcessInstanceTimeline' })
defineProps<{
- approveNodes: ProcessInstanceApi.ApprovalNodeInfo[] // 审批节点信息
+ activityNodes: ProcessInstanceApi.ApprovalNodeInfo[] // 审批节点信息
}>()
// 审批节点
diff --git a/src/views/bpm/processInstance/detail/index.vue b/src/views/bpm/processInstance/detail/index.vue
index ab04d4a9..6a1d7425 100644
--- a/src/views/bpm/processInstance/detail/index.vue
+++ b/src/views/bpm/processInstance/detail/index.vue
@@ -65,7 +65,7 @@
-
+
@@ -229,7 +229,7 @@ const getApprovalDetail = async () => {
}
// 获取审批节点,显示 Timeline 的数据
- approveNodes.value = data.approveNodes
+ activityNodes.value = data.activityNodes
// 获取待办任务显示操作按钮
operationButtonRef.value?.loadTodoTask(data.todoTask)
@@ -239,7 +239,7 @@ const getApprovalDetail = async () => {
}
// 审批节点信息
-const approveNodes = ref
([])
+const activityNodes = ref([])
/**
* 设置表单权限
*/
From 137b33e7cfe675e6bf5c7149590fc24fe3baa400 Mon Sep 17 00:00:00 2001
From: jason <2667446@qq.com>
Date: Mon, 28 Oct 2024 10:02:35 +0800
Subject: [PATCH 044/109] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E6=96=B0?=
=?UTF-8?q?=E5=A2=9E=E3=80=91=20=E4=BB=BF=E9=92=89=E9=92=89=E6=B5=81?=
=?UTF-8?q?=E7=A8=8B=E6=A8=A1=E5=9E=8B=E5=A2=9E=E5=8A=A0=E6=B5=8F=E8=A7=88?=
=?UTF-8?q?=E6=A8=A1=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/NodeHandler.vue | 3 +
.../src/ProcessNodeTree.vue | 2 +-
.../src/SimpleProcessDesigner.vue | 3 +-
.../src/SimpleProcessViewer.vue | 63 +++++++
.../SimpleProcessDesignerV2/src/consts.ts | 4 +-
.../SimpleProcessDesignerV2/src/index.ts | 3 +-
.../SimpleProcessDesignerV2/src/node.ts | 24 +++
.../src/nodes/CopyTaskNode.vue | 14 +-
.../src/nodes/EndEventNode.vue | 16 +-
.../src/nodes/ExclusiveNode.vue | 27 ++-
.../src/nodes/InclusiveNode.vue | 16 +-
.../src/nodes/ParallelNode.vue | 21 +--
.../src/nodes/StartUserNode.vue | 18 +-
.../src/nodes/UserTaskNode.vue | 21 ++-
.../theme/simple-process-designer.scss | 94 ++++++++--
.../detail/ProcessInstanceSimpleViewer.vue | 160 ++++++++++++++++++
src/views/bpm/simpleWorkflow/index.vue | 5 +-
17 files changed, 436 insertions(+), 58 deletions(-)
create mode 100644 src/components/SimpleProcessDesignerV2/src/SimpleProcessViewer.vue
create mode 100644 src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue
diff --git a/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue b/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue
index 1e9dca6e..9505bfb3 100644
--- a/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue
+++ b/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue
@@ -6,6 +6,7 @@
v-model:visible="popoverShow"
placement="right-start"
width="auto"
+ v-if="!readonly"
>
@@ -78,6 +79,8 @@ const props = defineProps({
const emits = defineEmits(['update:childNode'])
+const readonly = inject
('readonly') // 是否只读
+
const addNode = (type: number) => {
popoverShow.value = false
if (type === NodeType.USER_TASK_NODE) {
diff --git a/src/components/SimpleProcessDesignerV2/src/ProcessNodeTree.vue b/src/components/SimpleProcessDesignerV2/src/ProcessNodeTree.vue
index 8c3e6f0f..b1b97e9b 100644
--- a/src/components/SimpleProcessDesignerV2/src/ProcessNodeTree.vue
+++ b/src/components/SimpleProcessDesignerV2/src/ProcessNodeTree.vue
@@ -47,7 +47,7 @@
/>
-
+
diff --git a/src/components/SimpleProcessDesignerV2/src/consts.ts b/src/components/SimpleProcessDesignerV2/src/consts.ts
index 3611ef91..2bd4660c 100644
--- a/src/components/SimpleProcessDesignerV2/src/consts.ts
+++ b/src/components/SimpleProcessDesignerV2/src/consts.ts
@@ -1,6 +1,6 @@
// @ts-ignore
import { DictDataVO } from '@/api/system/dict/types'
-
+import { TaskStatusEnum } from '@/api/bpm/task'
/**
* 节点类型
*/
@@ -96,6 +96,8 @@ export interface SimpleFlowNode {
conditionGroups?: ConditionGroup
// 是否默认的条件
defaultFlow?: boolean
+ // 活动的状态,用于前端节点状态展示
+ activityStatus? : TaskStatusEnum
}
// 候选人策略枚举 ( 用于审批节点。抄送节点 )
export enum CandidateStrategy {
diff --git a/src/components/SimpleProcessDesignerV2/src/index.ts b/src/components/SimpleProcessDesignerV2/src/index.ts
index a53dcf38..cacfbc12 100644
--- a/src/components/SimpleProcessDesignerV2/src/index.ts
+++ b/src/components/SimpleProcessDesignerV2/src/index.ts
@@ -1,4 +1,5 @@
import SimpleProcessDesigner from './SimpleProcessDesigner.vue'
+import SimpleProcessViewer from './SimpleProcessViewer.vue'
import '../theme/simple-process-designer.scss'
-export { SimpleProcessDesigner }
\ No newline at end of file
+export { SimpleProcessDesigner, SimpleProcessViewer }
diff --git a/src/components/SimpleProcessDesignerV2/src/node.ts b/src/components/SimpleProcessDesignerV2/src/node.ts
index 816d9b19..d10173bb 100644
--- a/src/components/SimpleProcessDesignerV2/src/node.ts
+++ b/src/components/SimpleProcessDesignerV2/src/node.ts
@@ -1,4 +1,5 @@
import { cloneDeep } from 'lodash-es'
+import { TaskStatusEnum } from '@/api/bpm/task'
import * as RoleApi from '@/api/system/role'
import * as DeptApi from '@/api/system/dept'
import * as PostApi from '@/api/system/post'
@@ -476,3 +477,26 @@ export function useNodeName2(node: Ref, nodeType: NodeType) {
blurEvent
}
}
+
+/**
+ * @description 根据节点任务状态,获取节点任务状态样式
+ */
+export function useTaskStatusClass(taskStatus: TaskStatusEnum | undefined) : string {
+ if (!taskStatus) {
+ return ''
+ }
+ if (taskStatus === TaskStatusEnum.APPROVE ) {
+ return 'status-pass'
+ }
+ if (taskStatus === TaskStatusEnum.RUNNING ) {
+ return 'status-running'
+ }
+ if (taskStatus === TaskStatusEnum.REJECT ) {
+ return 'status-reject'
+ }
+ if (taskStatus === TaskStatusEnum.CANCEL ) {
+ return 'status-cancel'
+ }
+
+ return '';
+}
diff --git a/src/components/SimpleProcessDesignerV2/src/nodes/CopyTaskNode.vue b/src/components/SimpleProcessDesignerV2/src/nodes/CopyTaskNode.vue
index 14a85a29..e6e4045f 100644
--- a/src/components/SimpleProcessDesignerV2/src/nodes/CopyTaskNode.vue
+++ b/src/components/SimpleProcessDesignerV2/src/nodes/CopyTaskNode.vue
@@ -5,7 +5,7 @@
-
+
-
diff --git a/src/components/SimpleProcessDesignerV2/src/nodes/ExclusiveNode.vue b/src/components/SimpleProcessDesignerV2/src/nodes/ExclusiveNode.vue
index b0b12050..9d307acc 100644
--- a/src/components/SimpleProcessDesignerV2/src/nodes/ExclusiveNode.vue
+++ b/src/components/SimpleProcessDesignerV2/src/nodes/ExclusiveNode.vue
@@ -1,7 +1,13 @@