From 36294575d11b5bcc943a27bac0a7a91d933e18b1 Mon Sep 17 00:00:00 2001 From: jason <2667446@qq.com> Date: Thu, 11 Jun 2026 22:58:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20[bpm][ele]=20=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=EF=BC=8C=E6=8B=92=E7=BB=9D=E5=8F=AF=E4=BB=A5=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=99=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/bpm/processInstance/index.ts | 1 + .../src/components/upload/file-upload.vue | 5 +- .../detail/modules/operation-button.vue | 75 ++++++++++++++++++- .../detail/modules/time-line.vue | 68 +++++++++++++++-- 4 files changed, 138 insertions(+), 11 deletions(-) diff --git a/apps/web-ele/src/api/bpm/processInstance/index.ts b/apps/web-ele/src/api/bpm/processInstance/index.ts index 7ee5421f8..f8442c35c 100644 --- a/apps/web-ele/src/api/bpm/processInstance/index.ts +++ b/apps/web-ele/src/api/bpm/processInstance/index.ts @@ -83,6 +83,7 @@ export namespace BpmProcessInstanceApi { reason: string; signPicUrl: string; status: number; + attachments?: string[]; } /** 抄送流程实例 */ diff --git a/apps/web-ele/src/components/upload/file-upload.vue b/apps/web-ele/src/components/upload/file-upload.vue index 476027582..8789154e0 100644 --- a/apps/web-ele/src/components/upload/file-upload.vue +++ b/apps/web-ele/src/components/upload/file-upload.vue @@ -139,9 +139,6 @@ function handleRemove(file: UploadFile) { /** 处理文件预览 */ function handlePreview(file: UploadFile) { emit('preview', file); - if (file.url) { - window.open(file.url); - } } /** 处理文件数量超限 */ @@ -307,7 +304,7 @@ function getValue() { diff --git a/apps/web-ele/src/views/bpm/processInstance/detail/modules/time-line.vue b/apps/web-ele/src/views/bpm/processInstance/detail/modules/time-line.vue index 02e4c6382..a7c19037f 100644 --- a/apps/web-ele/src/views/bpm/processInstance/detail/modules/time-line.vue +++ b/apps/web-ele/src/views/bpm/processInstance/detail/modules/time-line.vue @@ -201,16 +201,25 @@ function shouldShowCustomUserSelect( ); } -/** 判断是否需要显示审批意见 */ -function shouldShowApprovalReason(task: any, nodeType: BpmNodeTypeEnum) { +/** 判断是否需要显示审批意见和附件 */ +function shouldShowReasonAndAttachment(task: any, nodeType: BpmNodeTypeEnum) { return ( - task.reason && + (task.reason || task.attachments?.length > 0) && [BpmNodeTypeEnum.START_USER_NODE, BpmNodeTypeEnum.USER_TASK_NODE].includes( nodeType, ) ); } +function getAttachmentName(url: string) { + return decodeURIComponent(url.slice(url.lastIndexOf('/') + 1)); +} + +function isImageAttachment(url: string) { + const ext = url.split('.').pop()?.toLowerCase(); + return ['bmp', 'gif', 'jpeg', 'jpg', 'png', 'webp'].includes(ext || ''); +} + /** 用户选择弹窗关闭 */ function handleUserSelectClosed() { selectedUsers.value = []; @@ -411,13 +420,60 @@ defineExpose({ setCustomApproveUsers, batchSetCustomApproveUsers }); - +
- 审批意见:{{ task.reason }} +
审批意见:{{ task.reason }}
+
+
+ 附件列表: +
+
+ +
+