Przeglądaj źródła

fix: 删除自定义脚本out_pin与in_pin的bug

kilnonedre 1 rok temu
rodzic
commit
0b0f2b9b05
1 zmienionych plików z 2 dodań i 3 usunięć
  1. 2 3
      packages/yili-dag/src/ScriptNodeInfo.tsx

+ 2 - 3
packages/yili-dag/src/ScriptNodeInfo.tsx

@@ -111,7 +111,7 @@ export default class ScriptNodeInfo extends React.Component<any, any> {
         return item.group === 'top' ? pre + 1 : pre;
       }, 0);
     for (let i = number; i < currentInputPortsNumber; i++) {
-      node.removePort(`input${number}`);
+      node.removePort(`input${i}`);
     }
     for (let i = currentInputPortsNumber; i < number; i++) {
       node.addPort({ group: 'top', id: `input${i}` });
@@ -124,7 +124,6 @@ export default class ScriptNodeInfo extends React.Component<any, any> {
   };
 
   updateOutputNumber = (outputNumber: number) => {
-    console.log(outputNumber);
     this.setState({ outputNumber });
   };
 
@@ -137,7 +136,7 @@ export default class ScriptNodeInfo extends React.Component<any, any> {
         return item.group === 'bottom' ? pre + 1 : pre;
       }, 0);
     for (let i = number; i < currentOutputPortsNumber; i++) {
-      node.removePort(`r${number}`);
+      node.removePort(`r${i}`);
     }
     for (let i = currentOutputPortsNumber; i < number; i++) {
       node.addPort({ group: 'bottom', id: `r${i}` });