|
@@ -209,6 +209,7 @@ export default class Dag extends React.Component<any, any> {
|
|
|
nodeTableData: [],
|
|
|
nodeTableCol: [],
|
|
|
nodeTablePins: [],
|
|
|
+ nodeTableInfo: {},
|
|
|
selectedPin: 0,
|
|
|
filename: '',
|
|
|
currentDblNode: '',
|
|
@@ -326,6 +327,7 @@ export default class Dag extends React.Component<any, any> {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+ // 处理节点跳过标记,当执行节点在已执行节点或input节点下时不跳过已经执行节点和input
|
|
|
formatNodeData = (script_nodes: any) => {
|
|
|
const menuNode = this.state.contextMenuNode;
|
|
|
const allNodes = this.state.dagGraph.getNodes();
|
|
@@ -334,18 +336,22 @@ export default class Dag extends React.Component<any, any> {
|
|
|
).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;
|
|
|
+ if (keys.length) {
|
|
|
+ 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;
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
+ } else {
|
|
|
+ format_nodes = script_nodes;
|
|
|
+ }
|
|
|
return format_nodes;
|
|
|
};
|
|
|
|
|
@@ -430,11 +436,17 @@ export default class Dag extends React.Component<any, any> {
|
|
|
};
|
|
|
const { data } = await getNodeResult(params);
|
|
|
if (data.code === 200) {
|
|
|
+ const { table_name, location, owner, share } = data.data;
|
|
|
const { col, tableData } = this.formatTableData(data.data);
|
|
|
this.setState({
|
|
|
nodeTableCol: col,
|
|
|
nodeTableData: tableData,
|
|
|
- resultTableName: data.data.table_name
|
|
|
+ resultTableName: table_name,
|
|
|
+ nodeTableInfo: {
|
|
|
+ location,
|
|
|
+ owner,
|
|
|
+ share: share ? '是' : '否'
|
|
|
+ }
|
|
|
});
|
|
|
} else {
|
|
|
// message.error(data.msg);
|
|
@@ -861,6 +873,7 @@ export default class Dag extends React.Component<any, any> {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ //递归更新链路节点
|
|
|
updateNodeStatus = (nodeId: any, edges: any) => {
|
|
|
edges.forEach((edge: any) => {
|
|
|
const source = edge.getSourceNode().getData();
|
|
@@ -879,43 +892,18 @@ export default class Dag extends React.Component<any, any> {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+ //修改数据之后将节点状态更新成为执行
|
|
|
saveChangeStatus = (nodeId: any) => {
|
|
|
const allEdges = this.state.dagGraph.getEdges();
|
|
|
- let current_target = '' as any;
|
|
|
- let current_edge = '' as any;
|
|
|
- allEdges.forEach((edge: any) => {
|
|
|
- const target = edge.getTargetNode().getData();
|
|
|
- // 将当前点击节点状态改为未执行
|
|
|
- if (target.nodeId === nodeId && target.type === 'script') {
|
|
|
- current_target = target;
|
|
|
- current_edge = edge;
|
|
|
- }
|
|
|
- });
|
|
|
- if (current_edge) {
|
|
|
- current_edge?.getTargetNode().setData(
|
|
|
- {
|
|
|
- ...current_target,
|
|
|
- status: 'undone'
|
|
|
- },
|
|
|
- { overwrite: true }
|
|
|
- );
|
|
|
- }
|
|
|
- // 只有一个节点的时候
|
|
|
- if (allEdges.length === 0) {
|
|
|
- const current_node = this.state.dagGraph.getNodes();
|
|
|
- const data = current_node[0].getData();
|
|
|
- if (data.type === 'script') {
|
|
|
- current_node[0].setData(
|
|
|
- {
|
|
|
- ...data,
|
|
|
- status: 'undone'
|
|
|
- },
|
|
|
- {
|
|
|
- overwrite: true
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
+ //更新选择节点
|
|
|
+ const current_node = this.state.currentDblNode;
|
|
|
+ current_node.setData(
|
|
|
+ {
|
|
|
+ ...current_node.getData(),
|
|
|
+ status: 'undone'
|
|
|
+ },
|
|
|
+ { overwrite: true }
|
|
|
+ );
|
|
|
this.updateNodeStatus(nodeId, allEdges);
|
|
|
};
|
|
|
|
|
@@ -977,6 +965,20 @@ export default class Dag extends React.Component<any, any> {
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div className="test_table_info">
|
|
|
+ <p>
|
|
|
+ 创建者:
|
|
|
+ {this.state.nodeTableInfo.owner}
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ 存储路径:
|
|
|
+ {this.state.nodeTableInfo.location}
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ 共享信息:
|
|
|
+ {this.state.nodeTableInfo.share}
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
<Table
|
|
|
columns={this.state.nodeTableCol}
|
|
|
dataSource={this.state.nodeTableData}
|