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] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E3=80=91=20=E4=BB=BF=E9=92=89=E9=92=89=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E5=A2=9E=E5=8A=A0=E6=B5=8F=E8=A7=88=E6=A8=A1?= =?UTF-8?q?=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 @@
{{ NODE_DEFAULT_TEXT.get(NodeType.COPY_TASK_NODE) }}
- +
-
+
@@ -36,7 +36,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 @@