|
@@ -6,6 +6,7 @@ import AlgoNode from './AlgoNode';
|
|
import ToolBar from './ToolBar';
|
|
import ToolBar from './ToolBar';
|
|
import DatasourceNodeInfo from './DatasourceNodeInfo';
|
|
import DatasourceNodeInfo from './DatasourceNodeInfo';
|
|
import ScriptNodeInfo from './ScriptNodeInfo';
|
|
import ScriptNodeInfo from './ScriptNodeInfo';
|
|
|
|
+import OutputNodeInfo from './OutputNodeInfo';
|
|
import ContextMenuView from './ContextMenu';
|
|
import ContextMenuView from './ContextMenu';
|
|
|
|
|
|
// 侧边栏UI组件
|
|
// 侧边栏UI组件
|
|
@@ -37,6 +38,24 @@ const dataSourceNodes = [
|
|
}
|
|
}
|
|
];
|
|
];
|
|
|
|
|
|
|
|
+// 输出源节点
|
|
|
|
+const outputSourceNodes = [
|
|
|
|
+ {
|
|
|
|
+ id: '10',
|
|
|
|
+ shape: 'dag-node',
|
|
|
|
+ height: 80,
|
|
|
|
+ width: 180,
|
|
|
|
+ data: {
|
|
|
|
+ label: 'OutputSource',
|
|
|
|
+ status: 'default',
|
|
|
|
+ type: 'outputsource'
|
|
|
|
+ },
|
|
|
|
+ ports: {
|
|
|
|
+ items: [{ id: 'topPort', group: 'top' }]
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+]
|
|
|
|
+
|
|
/* // 数据处理节点
|
|
/* // 数据处理节点
|
|
const dataHandleNodes = [
|
|
const dataHandleNodes = [
|
|
{
|
|
{
|
|
@@ -538,6 +557,10 @@ export default class Dag extends React.Component<any, any> {
|
|
name: 'dataSource',
|
|
name: 'dataSource',
|
|
title: '数据源'
|
|
title: '数据源'
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ name: 'outputSource',
|
|
|
|
+ title: '输出源'
|
|
|
|
+ },
|
|
{
|
|
{
|
|
name: 'dataHandle',
|
|
name: 'dataHandle',
|
|
title: '数据处理',
|
|
title: '数据处理',
|
|
@@ -566,6 +589,7 @@ export default class Dag extends React.Component<any, any> {
|
|
|
|
|
|
// 将可拖拽项加载到侧边栏中
|
|
// 将可拖拽项加载到侧边栏中
|
|
stencil.load(dataSourceNodes, 'dataSource');
|
|
stencil.load(dataSourceNodes, 'dataSource');
|
|
|
|
+ stencil.load(outputSourceNodes, 'outputSource')
|
|
// stencil.load(dataHandleNodes, 'dataHandle');
|
|
// stencil.load(dataHandleNodes, 'dataHandle');
|
|
// stencil.load(otherScriptNodes, 'otherScript');
|
|
// stencil.load(otherScriptNodes, 'otherScript');
|
|
stencil.load(customScriptNodes, 'customScript');
|
|
stencil.load(customScriptNodes, 'customScript');
|
|
@@ -573,6 +597,10 @@ export default class Dag extends React.Component<any, any> {
|
|
width: 200,
|
|
width: 200,
|
|
height: dataSourceNodes.length * 120
|
|
height: dataSourceNodes.length * 120
|
|
});
|
|
});
|
|
|
|
+ stencil.resizeGroup('outputSource', {
|
|
|
|
+ width: 200,
|
|
|
|
+ height: outputSourceNodes.length * 120
|
|
|
|
+ });
|
|
/* stencil.resizeGroup('dataHandle', {
|
|
/* stencil.resizeGroup('dataHandle', {
|
|
width: 200,
|
|
width: 200,
|
|
height: dataHandleNodes.length * 60
|
|
height: dataHandleNodes.length * 60
|
|
@@ -672,6 +700,10 @@ export default class Dag extends React.Component<any, any> {
|
|
{this.state.selectedNodeData?.type === 'script' && (
|
|
{this.state.selectedNodeData?.type === 'script' && (
|
|
<ScriptNodeInfo nodeInfo={this.state.selectedNodeData} />
|
|
<ScriptNodeInfo nodeInfo={this.state.selectedNodeData} />
|
|
)}
|
|
)}
|
|
|
|
+ {/* 输出源节点 */}
|
|
|
|
+ {this.state.selectedNodeData?.type === 'outputsource' && (
|
|
|
|
+ <OutputNodeInfo nodeInfo={this.state.selectedNodeData} />
|
|
|
|
+ )}
|
|
</Drawer>
|
|
</Drawer>
|
|
{/* 工具栏 */}
|
|
{/* 工具栏 */}
|
|
<ToolBar
|
|
<ToolBar
|
|
@@ -704,6 +736,9 @@ function initNodeData(newNode: Node<Node.Properties>) {
|
|
newNode.data.packageData = undefined;
|
|
newNode.data.packageData = undefined;
|
|
newNode.data.status = 'undone';
|
|
newNode.data.status = 'undone';
|
|
break;
|
|
break;
|
|
|
|
+ case 'outputsource':
|
|
|
|
+ newNode.data.nodeName = undefined;
|
|
|
|
+ newNode.data.outputSource = undefined;
|
|
default:
|
|
default:
|
|
}
|
|
}
|
|
}
|
|
}
|