|
@@ -314,6 +314,29 @@ export default class Dag extends React.Component<any, any> {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+ formatNodeData = (script_nodes: any) => {
|
|
|
+ const menuNode = this.state.contextMenuNode;
|
|
|
+ const allNodes = this.state.dagGraph.getNodes();
|
|
|
+ const inputs = script_nodes.find(
|
|
|
+ (item: any) => item.id === menuNode.data.nodeId
|
|
|
+ ).inputs;
|
|
|
+ const keys = Object.keys(inputs);
|
|
|
+ let format_nodes = [] as any;
|
|
|
+ keys.forEach((key: any) => {
|
|
|
+ const input_id = inputs[key][0];
|
|
|
+ const input_type = allNodes.find(
|
|
|
+ (item: any) => item.data.nodeId === input_id
|
|
|
+ ).data.type;
|
|
|
+ format_nodes = script_nodes.map((item: any) => {
|
|
|
+ if (item.id === input_id && input_type === 'datasource') {
|
|
|
+ item.skip = false;
|
|
|
+ }
|
|
|
+ return item;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ return format_nodes;
|
|
|
+ };
|
|
|
+
|
|
|
// 执行此处
|
|
|
handleNodeRun = () => {
|
|
|
const menuNode = this.state.contextMenuNode;
|
|
@@ -322,7 +345,7 @@ export default class Dag extends React.Component<any, any> {
|
|
|
menuNode,
|
|
|
'handle_run'
|
|
|
);
|
|
|
- this.executeDagData(script_nodes, script_edges);
|
|
|
+ this.executeDagData(this.formatNodeData(script_nodes), script_edges);
|
|
|
this.setState({ contextMenu: null });
|
|
|
};
|
|
|
|
|
@@ -355,7 +378,7 @@ export default class Dag extends React.Component<any, any> {
|
|
|
menuNode,
|
|
|
'handle_run_begin'
|
|
|
);
|
|
|
- this.executeDagData(script_nodes, script_edges);
|
|
|
+ this.executeDagData(this.formatNodeData(script_nodes), script_edges);
|
|
|
this.setState({ contextMenu: null });
|
|
|
};
|
|
|
|