update 优化 增加节点悬浮提示配置开关

dev
疯狂的狮子Li 4 months ago
parent 0d994c97b9
commit 3b2854adb8

@ -25,6 +25,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;
@ -47,6 +48,8 @@ public class FlwChartExtServiceImpl implements ChartExtService {
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;
@DubboReference @DubboReference
private RemoteUserService remoteUserService; private RemoteUserService remoteUserService;
@ -60,6 +63,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)) {
@ -107,6 +115,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(
@ -156,8 +169,10 @@ public class FlwChartExtServiceImpl implements ChartExtService {
/** /**
* *
* *
* @param nodeJson * @param nodeJson
* @param taskList * @param taskList
* @param userMap key IDvalue DTO
* @param dictType key value
*/ */
private void processNodeExtInfo(NodeJson nodeJson, List<FlowHisTask> taskList, Map<Long, RemoteUserVo> userMap, Map<String, String> dictType) { private void processNodeExtInfo(NodeJson nodeJson, List<FlowHisTask> taskList, Map<Long, RemoteUserVo> userMap, Map<String, String> dictType) {

@ -32,5 +32,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

Loading…
Cancel
Save