重构消息通知弹窗

This commit is contained in:
dengqichen 2025-11-20 15:02:59 +08:00
parent 0991fb487f
commit 8e2d39107f
3 changed files with 15 additions and 11 deletions

View File

@ -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[]) =>

View File

@ -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;

View File

@ -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;
});