Browse Source

feat: 统一缩进

nobody 2 years ago
parent
commit
27613cb1a4

+ 9 - 0
packages/yili-dag/src/ScriptEditor.tsx

@@ -117,6 +117,15 @@ export default class ScriptEditor extends React.Component<any, any> {
           error_list: [],
           error_list: [],
         }
         }
       },
       },
+      indentUnit: 4,
+      tabSize: 4,
+      extraKeys: {
+        Tab: (cm) => {
+          const indentUnit = cm.getOption("indentUnit") as number
+          var spaces = Array(indentUnit + 1).join(" ");
+          cm.replaceSelection(spaces);
+        }
+      }
     })
     })
     editor.setSize(null, '100%')
     editor.setSize(null, '100%')
     editor.setValue(this.props.scriptText)
     editor.setValue(this.props.scriptText)

+ 0 - 1
packages/yili-dag/src/ScriptNodeInfo.tsx

@@ -183,7 +183,6 @@ export default class ScriptNodeInfo extends React.Component<any, any> {
       return item.group === 'bottom' ? pre.concat(item) : pre
       return item.group === 'bottom' ? pre.concat(item) : pre
     }, [])
     }, [])
     currentOutputPorts.forEach((item: any) => {
     currentOutputPorts.forEach((item: any) => {
-      console.log('item:', item);
       const index = outputData.findIndex((output: any) => output.outputVar === item.id)
       const index = outputData.findIndex((output: any) => output.outputVar === item.id)
       if (index === -1) {
       if (index === -1) {
         node.removePort(item.id)
         node.removePort(item.id)

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


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