|
|
|
|
@ -61,7 +61,9 @@ export const useFlowEditorState = (initialData?: any, readOnly?: boolean) => {
|
|
|
|
|
Object.values(initialData.components).some((comp: any) => comp.status);
|
|
|
|
|
|
|
|
|
|
setNodes((prevNodes) => {
|
|
|
|
|
return prevNodes.map((node) => {
|
|
|
|
|
let hasChanges = false;
|
|
|
|
|
|
|
|
|
|
const nextNodes = prevNodes.map((node) => {
|
|
|
|
|
// 如果是只读模式(历史实例查看),优先使用节点自身的历史状态
|
|
|
|
|
// 如果是正常运行模式,只使用运行时状态
|
|
|
|
|
let nodeStatus = 'waiting';
|
|
|
|
|
@ -80,6 +82,14 @@ export const useFlowEditorState = (initialData?: any, readOnly?: boolean) => {
|
|
|
|
|
showStatus = currentAppIsRunning;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (
|
|
|
|
|
node.data.status === nodeStatus &&
|
|
|
|
|
node.data.isStatusVisible === showStatus
|
|
|
|
|
) {
|
|
|
|
|
return node;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hasChanges = true;
|
|
|
|
|
return {
|
|
|
|
|
...node,
|
|
|
|
|
data: {
|
|
|
|
|
@ -89,6 +99,8 @@ export const useFlowEditorState = (initialData?: any, readOnly?: boolean) => {
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return hasChanges ? nextNodes : prevNodes;
|
|
|
|
|
});
|
|
|
|
|
}, [
|
|
|
|
|
appRuntimeData,
|
|
|
|
|
|