From 3b2854adb89c82f1cb945098d0c2e8576f684948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Thu, 4 Sep 2025 17:41:03 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=8A=82=E7=82=B9=E6=82=AC=E6=B5=AE=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/FlwChartExtServiceImpl.java | 19 +++++++++++++++++-- script/config/nacos/ruoyi-workflow.yml | 2 ++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/FlwChartExtServiceImpl.java b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/FlwChartExtServiceImpl.java index 824615781..648e15e1a 100644 --- a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/FlwChartExtServiceImpl.java +++ b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/FlwChartExtServiceImpl.java @@ -25,6 +25,7 @@ import org.dromara.warm.flow.orm.mapper.FlowHisTaskMapper; import org.dromara.warm.flow.ui.service.ChartExtService; import org.dromara.workflow.common.ConditionalOnEnable; import org.dromara.workflow.common.constant.FlowConstant; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import java.util.ArrayList; @@ -47,6 +48,8 @@ public class FlwChartExtServiceImpl implements ChartExtService { private final FlowHisTaskMapper flowHisTaskMapper; private final DictService dictService; + @Value("${warm-flow.node-tooltip:true}") + private boolean nodeTooltip; @DubboReference private RemoteUserService remoteUserService; @@ -60,6 +63,11 @@ public class FlwChartExtServiceImpl implements ChartExtService { */ @Override public void execute(DefJson defJson) { + // 配置关闭,直接返回,不渲染悬浮窗 + if (!nodeTooltip) { + return; + } + // 根据流程实例ID查询所有相关的历史任务列表 List flowHisTasks = this.getHisTaskGroupedByNode(defJson.getInstance().getId()); if (CollUtil.isEmpty(flowHisTasks)) { @@ -107,6 +115,11 @@ public class FlwChartExtServiceImpl implements ChartExtService { */ @Override public void initPromptContent(DefJson defJson) { + // 配置关闭,直接返回,不渲染悬浮窗 + if (!nodeTooltip) { + return; + } + defJson.setTopText("流程名称: " + defJson.getFlowName()); defJson.getNodeList().forEach(nodeJson -> { nodeJson.setPromptContent( @@ -156,8 +169,10 @@ public class FlwChartExtServiceImpl implements ChartExtService { /** * 处理节点的扩展信息,构建用于流程图悬浮提示的内容 * - * @param nodeJson 当前节点对象 - * @param taskList 当前节点对应的历史审批任务列表 + * @param nodeJson 当前流程节点对象,包含节点基础信息和提示内容容器 + * @param taskList 当前节点关联的历史审批任务列表,用于生成提示信息 + * @param userMap 用户信息映射表,key 为用户ID,value 为用户DTO对象,用于获取审批人信息 + * @param dictType 数据字典映射表,key 为字典项编码,value 为对应显示值,用于翻译审批状态等 */ private void processNodeExtInfo(NodeJson nodeJson, List taskList, Map userMap, Map dictType) { diff --git a/script/config/nacos/ruoyi-workflow.yml b/script/config/nacos/ruoyi-workflow.yml index 8dfe7bb23..98f1347ac 100644 --- a/script/config/nacos/ruoyi-workflow.yml +++ b/script/config/nacos/ruoyi-workflow.yml @@ -32,5 +32,7 @@ warm-flow: ui: true # 是否显示流程图顶部文字 top-text-show: true + # 是否渲染节点悬浮提示,默认true + node-tooltip: true # 默认Authorization,如果有多个token,用逗号分隔 token-name: ${sa-token.token-name},clientid