소스 검색

fix: pin脚问题

leo 1 년 전
부모
커밋
f30547685a
3개의 변경된 파일10개의 추가작업 그리고 3개의 파일을 삭제
  1. 0 1
      dagtest2.dag
  2. 1 1
      packages/yili-dag/src/request.ts
  3. 9 1
      packages/yili-dag/src/utils.ts

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 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;

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.