From 5ee0a7b946a39c9f69009aa52bbf3e0768101d98 Mon Sep 17 00:00:00 2001 From: jason <2667446@qq.com> Date: Tue, 18 Jun 2024 00:06:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BF=E9=92=89=E9=92=89=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8-=20=E7=AE=80=E5=8C=96=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E6=8B=92=E7=BB=9D=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/bpm/simple/index.ts | 4 +-- .../src/SimpleProcessDesigner.vue | 2 +- .../SimpleProcessDesignerV2/src/consts.ts | 13 ++------- .../src/nodes-config/UserTaskNodeConfig.vue | 28 ++----------------- src/views/bpm/simpleWorkflow/index.vue | 1 - src/views/bpm/simpleWorkflow/index1.vue | 12 +++----- 6 files changed, 11 insertions(+), 49 deletions(-) diff --git a/src/api/bpm/simple/index.ts b/src/api/bpm/simple/index.ts index 28808565..6e1e995a 100644 --- a/src/api/bpm/simple/index.ts +++ b/src/api/bpm/simple/index.ts @@ -8,8 +8,8 @@ export const updateBpmSimpleModel = async (data) => { }) } -export const getBpmSimpleModel = async (modelId) => { +export const getBpmSimpleModel = async (id) => { return await request.get({ - url: '/bpm/model/simple/get?modelId=' + modelId + url: '/bpm/model/simple/get?id=' + id }) } diff --git a/src/components/SimpleProcessDesignerV2/src/SimpleProcessDesigner.vue b/src/components/SimpleProcessDesignerV2/src/SimpleProcessDesigner.vue index 8b7efff4..d3d0b44c 100644 --- a/src/components/SimpleProcessDesignerV2/src/SimpleProcessDesigner.vue +++ b/src/components/SimpleProcessDesignerV2/src/SimpleProcessDesigner.vue @@ -82,7 +82,7 @@ const saveSimpleFlowModel = async () => { return; } const data = { - modelId: props.modelId, + id: props.modelId, simpleModel: processNodeTree.value } diff --git a/src/components/SimpleProcessDesignerV2/src/consts.ts b/src/components/SimpleProcessDesignerV2/src/consts.ts index 784e3315..eb897d47 100644 --- a/src/components/SimpleProcessDesignerV2/src/consts.ts +++ b/src/components/SimpleProcessDesignerV2/src/consts.ts @@ -70,15 +70,7 @@ export enum RejectHandlerType { /** * 驳回到指定节点 */ - RETURN_PRE_USER_TASK = 2, - /** - * 按拒绝人数比例终止流程 - */ - FINISH_PROCESS_BY_REJECT_RATIO = 3, - /** - * 结束任务 - */ - FINISH_TASK = 4 + RETURN_USER_TASK = 2 } @@ -233,8 +225,7 @@ export const TIMEOUT_HANDLER_ACTION_TYPES: DictDataVO [] = [ ] export const REJECT_HANDLER_TYPES: DictDataVO [] = [ { label: '终止流程', value: RejectHandlerType.FINISH_PROCESS }, - { label: '驳回到指定节点', value: RejectHandlerType.RETURN_PRE_USER_TASK }, - { label: '按拒绝人数终止流程(用于会签)', value: RejectHandlerType.FINISH_PROCESS_BY_REJECT_RATIO } + { label: '驳回到指定节点', value: RejectHandlerType.RETURN_USER_TASK } // { label: '结束任务', value: RejectHandlerType.FINISH_TASK } ] diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue index 4ee0d310..7bb245eb 100644 --- a/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue +++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue @@ -181,7 +181,6 @@ :key="item.value" :value="item.value" :label="item.label" - :disabled="rejectHandlerOptionDisabled(item.value)" /> @@ -191,7 +190,7 @@ { currentNode.value.name || (NODE_DEFAULT_NAME.get(NodeType.USER_TASK_NODE) as string) } const approveMethodChanged = () => { + currentNode.value.attributes.rejectHandler.type = RejectHandlerType.FINISH_PROCESS const approveMethod = currentNode.value.attributes?.approveMethod - if ( approveMethod === ApproveMethodType.APPROVE_BY_RATIO) { - currentNode.value.attributes.rejectHandler.type = - RejectHandlerType.FINISH_PROCESS_BY_REJECT_RATIO - } else { - currentNode.value.attributes.rejectHandler.type = RejectHandlerType.FINISH_PROCESS - } - if (approveMethod === ApproveMethodType.APPROVE_BY_RATIO) { currentNode.value.attributes.approveRatio = 100; } } -const rejectHandlerOptionDisabled = computed(() => { - return (val: number) => { - const approveMethod = currentNode.value.attributes?.approveMethod - if ( - val === RejectHandlerType.FINISH_PROCESS_BY_REJECT_RATIO && - approveMethod !== ApproveMethodType.APPROVE_BY_RATIO - ) { - return true - } - if ( approveMethod === ApproveMethodType.APPROVE_BY_RATIO - && val !== RejectHandlerType.FINISH_PROCESS_BY_REJECT_RATIO) { - return true - } - - return false - } -}) // 默认 6小时 const timeDuration = ref(6) const timeUnit = ref(TimeUnitType.HOUR) diff --git a/src/views/bpm/simpleWorkflow/index.vue b/src/views/bpm/simpleWorkflow/index.vue index 9d5d2144..dac9aa82 100644 --- a/src/views/bpm/simpleWorkflow/index.vue +++ b/src/views/bpm/simpleWorkflow/index.vue @@ -56,5 +56,4 @@ onMounted( async () => { }) diff --git a/src/views/bpm/simpleWorkflow/index1.vue b/src/views/bpm/simpleWorkflow/index1.vue index 04eb8d89..4d612ff0 100644 --- a/src/views/bpm/simpleWorkflow/index1.vue +++ b/src/views/bpm/simpleWorkflow/index1.vue @@ -53,18 +53,14 @@ const test = async () => { message.error('缺少模型 modelId 编号') return } - const test = nodeConfig.value - console.log('test is ', test) + console.log('nodeConfig.value ', nodeConfig.value) - const data1 = { - modelId: modelId, - simpleModelBody: toRaw(nodeConfig.value) - } + const data = { - modelId: modelId, + id: modelId, simpleModelBody: nodeConfig.value } - console.log('request json data1 is ', data1) + const result = await updateBpmSimpleModel(data) console.log('save the result is ', result) if (result) {