mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-23 23:09:47 +08:00
update 添加节点悬浮提示配置开关
This commit is contained in:
@ -259,5 +259,7 @@ warm-flow:
|
|||||||
ui: true
|
ui: true
|
||||||
# 是否显示流程图顶部文字
|
# 是否显示流程图顶部文字
|
||||||
top-text-show: true
|
top-text-show: true
|
||||||
|
# 是否渲染节点悬浮提示,默认true
|
||||||
|
node-tooltip: true
|
||||||
# 默认Authorization,如果有多个token,用逗号分隔
|
# 默认Authorization,如果有多个token,用逗号分隔
|
||||||
token-name: ${sa-token.token-name},clientid
|
token-name: ${sa-token.token-name},clientid
|
||||||
|
@ -24,6 +24,7 @@ import org.dromara.warm.flow.orm.mapper.FlowHisTaskMapper;
|
|||||||
import org.dromara.warm.flow.ui.service.ChartExtService;
|
import org.dromara.warm.flow.ui.service.ChartExtService;
|
||||||
import org.dromara.workflow.common.ConditionalOnEnable;
|
import org.dromara.workflow.common.ConditionalOnEnable;
|
||||||
import org.dromara.workflow.common.constant.FlowConstant;
|
import org.dromara.workflow.common.constant.FlowConstant;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -48,6 +49,8 @@ public class FlwChartExtServiceImpl implements ChartExtService {
|
|||||||
private final DeptService deptService;
|
private final DeptService deptService;
|
||||||
private final FlowHisTaskMapper flowHisTaskMapper;
|
private final FlowHisTaskMapper flowHisTaskMapper;
|
||||||
private final DictService dictService;
|
private final DictService dictService;
|
||||||
|
@Value("${warm-flow.node-tooltip:true}")
|
||||||
|
private boolean nodeTooltip;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置流程图提示信息
|
* 设置流程图提示信息
|
||||||
@ -56,6 +59,11 @@ public class FlwChartExtServiceImpl implements ChartExtService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void execute(DefJson defJson) {
|
public void execute(DefJson defJson) {
|
||||||
|
// 配置关闭,直接返回,不渲染悬浮窗
|
||||||
|
if (!nodeTooltip) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 根据流程实例ID查询所有相关的历史任务列表
|
// 根据流程实例ID查询所有相关的历史任务列表
|
||||||
List<FlowHisTask> flowHisTasks = this.getHisTaskGroupedByNode(defJson.getInstance().getId());
|
List<FlowHisTask> flowHisTasks = this.getHisTaskGroupedByNode(defJson.getInstance().getId());
|
||||||
if (CollUtil.isEmpty(flowHisTasks)) {
|
if (CollUtil.isEmpty(flowHisTasks)) {
|
||||||
@ -103,6 +111,11 @@ public class FlwChartExtServiceImpl implements ChartExtService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void initPromptContent(DefJson defJson) {
|
public void initPromptContent(DefJson defJson) {
|
||||||
|
// 配置关闭,直接返回,不渲染悬浮窗
|
||||||
|
if (!nodeTooltip) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
defJson.setTopText("流程名称: " + defJson.getFlowName());
|
defJson.setTopText("流程名称: " + defJson.getFlowName());
|
||||||
defJson.getNodeList().forEach(nodeJson -> {
|
defJson.getNodeList().forEach(nodeJson -> {
|
||||||
nodeJson.setPromptContent(
|
nodeJson.setPromptContent(
|
||||||
@ -152,8 +165,10 @@ public class FlwChartExtServiceImpl implements ChartExtService {
|
|||||||
/**
|
/**
|
||||||
* 处理节点的扩展信息,构建用于流程图悬浮提示的内容
|
* 处理节点的扩展信息,构建用于流程图悬浮提示的内容
|
||||||
*
|
*
|
||||||
* @param nodeJson 当前节点对象
|
* @param nodeJson 当前流程节点对象,包含节点基础信息和提示内容容器
|
||||||
* @param taskList 当前节点对应的历史审批任务列表
|
* @param taskList 当前节点关联的历史审批任务列表,用于生成提示信息
|
||||||
|
* @param userMap 用户信息映射表,key 为用户ID,value 为用户DTO对象,用于获取审批人信息
|
||||||
|
* @param dictType 数据字典映射表,key 为字典项编码,value 为对应显示值,用于翻译审批状态等
|
||||||
*/
|
*/
|
||||||
private void processNodeExtInfo(NodeJson nodeJson, List<FlowHisTask> taskList, Map<Long, UserDTO> userMap, Map<String, String> dictType) {
|
private void processNodeExtInfo(NodeJson nodeJson, List<FlowHisTask> taskList, Map<Long, UserDTO> userMap, Map<String, String> dictType) {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user