2 Commits 9b3739a50e ... 3d45d8acce

Auteur SHA1 Bericht Datum
  leo 3d45d8acce Merge branch 'yili' of http://gogsb.soaringnova.com/ylproj/jupyterlab into yili 1 jaar geleden
  leo f30547685a fix: pin脚问题 1 jaar geleden
3 gewijzigde bestanden met toevoegingen van 10 en 3 verwijderingen
  1. 0 1
      dagtest2.dag
  2. 1 1
      packages/yili-dag/src/request.ts
  3. 9 1
      packages/yili-dag/src/utils.ts

File diff suppressed because it is too large
+ 0 - 1
dagtest2.dag


+ 1 - 1
packages/yili-dag/src/request.ts

@@ -156,7 +156,7 @@ export const getSchema = (table_name: string) =>
 // sql数据源表预览
 export const getSqlDsTable = (table_name: string) =>
   request({
-    url: `/jpt/datamanagement/table_content?table_name=${table_name}&page=${1}&size=${100}`,
+    url: `/jpt/dag/dag_node_content?table_name=${table_name}&page=${1}&size=${100}`,
     method: 'get'
   });
 

+ 9 - 1
packages/yili-dag/src/utils.ts

@@ -167,6 +167,7 @@ const generateInputs = (graph: any, id: any) => {
   const edges = graph.getIncomingEdges(id);
   if (edges?.length > 0) {
     edges.forEach((item: any, index: any) => {
+      // 获取source的输出pin脚
       const sourceNode = item.getSourceNode();
       const sourcePortID = item.getSourcePortId();
       const sourcePorts = sourceNode.getPortsByGroup('bottom');
@@ -177,7 +178,14 @@ const generateInputs = (graph: any, id: any) => {
           : sourcePorts.indexOf(
               sourcePorts.find((item: any) => item.id === sourcePortID)
             );
-      inputsResult[`input${index}`] = [sourceId, portNumber];
+      // 获取target输入pin脚
+      const targetNode = item.getTargetNode();
+      const targetPortID = item.getTargetPortId();
+      const targetPorts = targetNode.getPortsByGroup('top');
+      const inputPortIndex = targetPorts.indexOf(
+        targetPorts.find((item: any) => item.id === targetPortID)
+      );
+      inputsResult[`input${inputPortIndex}`] = [sourceId, portNumber];
     });
   }
   return inputsResult;

Some files were not shown because too many files changed in this diff