From 503a35f44e78c92310463836b91bdcdc66ae0eab Mon Sep 17 00:00:00 2001 From: jason <2667446@qq.com> Date: Sun, 26 Jan 2025 14:34:23 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=BC=BA=E9=99=B7=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E3=80=91=E5=BB=B6=E8=BF=9F=E5=99=A8=E8=8A=82=E7=82=B9=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E4=BF=AE=E5=A4=8D=E9=97=AE=E9=A2=98=EF=BC=8C=E5=BB=B6?= =?UTF-8?q?=E8=BF=9F=E5=99=A8=E8=8A=82=E7=82=B9=E9=AB=98=E4=BA=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/nodes-config/ConditionNodeConfig.vue | 20 ++++--------------- .../src/nodes-config/DelayTimerNodeConfig.vue | 1 + .../src/nodes-config/TriggerNodeConfig.vue | 1 + .../src/nodes-config/components/Condition.vue | 18 +++++------------ .../detail/ProcessInstanceSimpleViewer.vue | 10 ++++++++++ 5 files changed, 21 insertions(+), 29 deletions(-) diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue index 93e3795a..e9b387a7 100644 --- a/src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue +++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue @@ -47,10 +47,9 @@ import { SimpleFlowNode, ConditionType, COMPARISON_OPERATORS, - ProcessVariableEnum } from '../consts' import { getDefaultConditionNodeName } from '../utils' -import { useFormFields } from '../node' +import { useFormFieldsAndStartUser } from '../node' import Condition from './components/Condition.vue' const message = useMessage() // 消息弹窗 defineOptions({ @@ -176,23 +175,12 @@ const getShowText = (): string => { } return showText } - -const fieldsInfo = useFormFields() -/** 条件规则可选择的表单字段 */ -const fieldOptions = computed(() => { - const fieldsCopy = fieldsInfo.slice() - // 固定添加发起人 ID 字段 - fieldsCopy.unshift({ - field: ProcessVariableEnum.START_USER_ID, - title: '发起人', - required: true - }) - return fieldsCopy -}) +// 流程表单字段和发起人字段 +const fieldOptions = useFormFieldsAndStartUser() /** 获取字段名称 */ const getFieldTitle = (field: string) => { - const item = fieldOptions.value.find((item) => item.field === field) + const item = fieldOptions.find((item) => item.field === field) return item?.title } diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/DelayTimerNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/DelayTimerNodeConfig.vue index 27a351b8..741796d3 100644 --- a/src/components/SimpleProcessDesignerV2/src/nodes-config/DelayTimerNodeConfig.vue +++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/DelayTimerNodeConfig.vue @@ -124,6 +124,7 @@ const saveConfig = async () => { if (!valid) return false const showText = getShowText() if (!showText) return false + currentNode.value.name = nodeName.value! currentNode.value.showText = showText if (configForm.value.delayType === DelayTypeEnum.FIXED_TIME_DURATION) { currentNode.value.delaySetting = { diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue index e29278dd..b6697a7c 100644 --- a/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue +++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue @@ -192,6 +192,7 @@ const saveConfig = async () => { if (!valid) return false const showText = getShowText() if (!showText) return false + currentNode.value.name = nodeName.value! currentNode.value.showText = showText currentNode.value.triggerSetting = configForm.value settingVisible.value = false diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/components/Condition.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/components/Condition.vue index e86ac2da..d7216546 100644 --- a/src/components/SimpleProcessDesignerV2/src/nodes-config/components/Condition.vue +++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/components/Condition.vue @@ -138,11 +138,10 @@ import { COMPARISON_OPERATORS, CONDITION_CONFIG_TYPES, ConditionType, - DEFAULT_CONDITION_GROUP_VALUE, - ProcessVariableEnum + DEFAULT_CONDITION_GROUP_VALUE } from '../../consts' import { BpmModelFormType } from '@/utils/constants' -import { useFormFields } from '../../node' +import { useFormFieldsAndStartUser } from '../../node' const props = defineProps({ modelValue: { @@ -170,17 +169,10 @@ const conditionConfigTypes = computed(() => { } }) }) + /** 条件规则可选择的表单字段 */ -const fieldOptions = computed(() => { - const fieldsCopy = useFormFields().slice() - // 固定添加发起人 ID 字段 - fieldsCopy.unshift({ - field: ProcessVariableEnum.START_USER_ID, - title: '发起人', - required: true - }) - return fieldsCopy -}) +const fieldOptions = useFormFieldsAndStartUser() + // 表单校验规则 const formRules = reactive({ conditionType: [{ required: true, message: '配置方式不能为空', trigger: 'blur' }], diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue b/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue index 0694ab8a..69fd7014 100644 --- a/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue +++ b/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue @@ -114,6 +114,16 @@ const setSimpleModelNodeTaskStatus = ( simpleModel.activityStatus = TaskStatusEnum.NOT_START } } + // 触发器节点 + if (simpleModel.type === NodeType.TRIGGER_NODE) { + // 触发器节点,只有通过和未执行状态 + if (finishedActivityIds.includes(simpleModel.id)) { + simpleModel.activityStatus = TaskStatusEnum.APPROVE + } else { + simpleModel.activityStatus = TaskStatusEnum.NOT_START + } + } + // 条件节点对应 SequenceFlow if (simpleModel.type === NodeType.CONDITION_NODE) { // 条件节点,只有通过和未执行状态