From 6888fd90d129e8d368839a19b5fa96bac059f352 Mon Sep 17 00:00:00 2001 From: kehaiyou Date: Sat, 23 Sep 2023 14:52:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E5=9B=9E=E9=80=80?= =?UTF-8?q?=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit de79e79d91f4949df9314f2238a30c9bd319eafe) --- src/api/bpm/task/index.ts | 16 ++++ .../package/designer/ProcessViewer.vue | 42 +++++++++ .../detail/TaskRollbackDialogForm.vue | 90 +++++++++++++++++++ 3 files changed, 148 insertions(+) create mode 100644 src/views/bpm/processInstance/detail/TaskRollbackDialogForm.vue diff --git a/src/api/bpm/task/index.ts b/src/api/bpm/task/index.ts index f6763720..126f01eb 100644 --- a/src/api/bpm/task/index.ts +++ b/src/api/bpm/task/index.ts @@ -41,3 +41,19 @@ export const getTaskListByProcessInstanceId = async (processInstanceId) => { export const exportTask = async (params) => { return await request.download({ url: '/bpm/task/export', params }) } + +/** + * 获取所有可回退的节点 + * @param params + */ +export const getReturnList = async (params) => { + return await request.get({ url: '/bpm/task/get-return-list', params }) +} + +/** + * 确认回退 + * @param params + */ +export const okRollback = async (data) => { + return await request.put({ url: '/bpm/task/rollback', data }) +} diff --git a/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue b/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue index 856fb2d7..dd4c8456 100644 --- a/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue +++ b/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue @@ -229,6 +229,9 @@ const getResultCss = (result) => { } else if (result === 4) { // 已取消 return 'highlight-cancel' + } else if (result === 5) { + // 退回 + return 'highlight-rollback' } return '' } @@ -564,6 +567,45 @@ watch( stroke: grey !important; } +/** 回退 */ +.highlight-rollback.djs-shape .djs-visual > :nth-child(1) { + fill: #e6a23c !important; + stroke: #e6a23c !important; + fill-opacity: 0.2 !important; +} +.highlight-rollback.djs-shape .djs-visual > :nth-child(2) { + fill: #e6a23c !important; +} +.highlight-rollback.djs-shape .djs-visual > path { + fill: #e6a23c !important; + fill-opacity: 0.2 !important; + stroke: #e6a23c !important; +} +.highlight-rollback.djs-connection > .djs-visual > path { + stroke: #e6a23c !important; +} + +.highlight-rollback:not(.djs-connection) .djs-visual > :nth-child(1) { + fill: #e6a23c !important; /* color elements as green */ +} + +:deep(.highlight-rollback.djs-shape .djs-visual > :nth-child(1)) { + fill: #e6a23c !important; + stroke: #e6a23c !important; + fill-opacity: 0.2 !important; +} +:deep(.highlight-rollback.djs-shape .djs-visual > :nth-child(2)) { + fill: #e6a23c !important; +} +:deep(.highlight-rollback.djs-shape .djs-visual > path) { + fill: #e6a23c !important; + fill-opacity: 0.2 !important; + stroke: #e6a23c !important; +} +:deep(.highlight-rollback.djs-connection > .djs-visual > path) { + stroke: #e6a23c !important; +} + .element-overlays { width: 200px; padding: 8px; diff --git a/src/views/bpm/processInstance/detail/TaskRollbackDialogForm.vue b/src/views/bpm/processInstance/detail/TaskRollbackDialogForm.vue new file mode 100644 index 00000000..168fd1a8 --- /dev/null +++ b/src/views/bpm/processInstance/detail/TaskRollbackDialogForm.vue @@ -0,0 +1,90 @@ + +