重构消息通知弹窗
This commit is contained in:
parent
0991fb487f
commit
8e2d39107f
@ -23,7 +23,7 @@ export const deleteUser = (id: number) =>
|
||||
|
||||
// 重置密码
|
||||
export const resetPassword = (id: number, password: string) =>
|
||||
request.post(`${BASE_URL}/${id}/reset-password`, { password });
|
||||
request.post(`${BASE_URL}/${id}/reset-password`, { newPassword: password });
|
||||
|
||||
// 分配角色
|
||||
export const assignRoles = (userId: number, roleIds: number[]) =>
|
||||
|
||||
@ -4,6 +4,7 @@ import * as definitionService from '../../Definition/List/service';
|
||||
import type { FlowNode, FlowEdge } from '../types';
|
||||
import type { WorkflowDefinition } from '../../Definition/List/types';
|
||||
import { NODE_DEFINITIONS, NodeType, getNodeCategory } from '../nodes';
|
||||
import { convertToDisplayName } from '@/utils/workflow/variableConversion';
|
||||
|
||||
interface LoadedWorkflowData {
|
||||
nodes: FlowNode[];
|
||||
@ -79,8 +80,20 @@ export const useWorkflowLoad = () => {
|
||||
.map(edge => {
|
||||
const edgeConfig: any = edge.config || {};
|
||||
// ⚠️ 不再设置默认值,边线初始状态为 undefined,由用户主动配置
|
||||
const condition = edgeConfig.condition;
|
||||
const originalCondition = edgeConfig.condition;
|
||||
|
||||
// ✅ 转换condition.expression中的UUID为中文节点名(界面显示)
|
||||
let condition = originalCondition;
|
||||
if (originalCondition && originalCondition.type === 'EXPRESSION' && originalCondition.expression) {
|
||||
condition = {
|
||||
...originalCondition,
|
||||
expression: convertToDisplayName(originalCondition.expression, nodes)
|
||||
};
|
||||
}
|
||||
|
||||
// label使用转换后的中文表达式
|
||||
const label = condition?.expression || edge.name || '';
|
||||
|
||||
// 从后端读取保存的拐点(支持多个)
|
||||
const verticesArr = (edge as any).vertices as Array<{ x: number; y: number }> | undefined;
|
||||
const vertices = Array.isArray(verticesArr) ? verticesArr.map(p => ({ x: p.x, y: p.y })) : undefined;
|
||||
|
||||
@ -31,17 +31,10 @@ export const convertToUUID = (
|
||||
return displayText;
|
||||
}
|
||||
|
||||
console.log('🔍 convertToUUID - 输入:', displayText);
|
||||
console.log('🔍 可用节点:', allNodes.map(n => ({ id: n.id, label: n.data?.label })));
|
||||
|
||||
// 阶段1:处理 ${...} 块
|
||||
return displayText.replace(BLOCK_PATTERN, (blockMatch, blockContent) => {
|
||||
console.log('🔍 找到 ${} 块:', blockContent);
|
||||
|
||||
// 阶段2:在块内容中查找并替换所有 节点名.字段 引用
|
||||
const transformedContent = blockContent.replace(NODE_REF_PATTERN, (refMatch: string, nodeNameOrId: string, fieldPath: string) => {
|
||||
console.log('🔍 找到节点引用:', { refMatch, nodeNameOrId, fieldPath });
|
||||
|
||||
// 特殊处理:表单字段
|
||||
if (nodeNameOrId === '启动表单' || nodeNameOrId === 'form' || nodeNameOrId === 'notification') {
|
||||
return `${nodeNameOrId}.${fieldPath}`;
|
||||
@ -54,12 +47,10 @@ export const convertToUUID = (
|
||||
});
|
||||
|
||||
if (nodeByName) {
|
||||
console.log('✅ 找到节点,转换为UUID:', nodeByName.id);
|
||||
return `${nodeByName.id}.${fieldPath}`;
|
||||
}
|
||||
|
||||
// 可能已经是UUID格式,保持原样
|
||||
console.log('⚠️ 未找到节点(可能已是UUID):', nodeNameOrId);
|
||||
return refMatch;
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user