浏览代码

添加代码检验按扭

nobody 2 年之前
父节点
当前提交
afa5f29cbe

+ 1 - 1
packages/yili-dag/src/ScriptEditor.tsx

@@ -18,7 +18,7 @@ export default class ScriptEditor extends React.Component<any, any> {
   componentDidMount() {
     const editor = CodeMirror.fromTextArea(document.querySelector('.editor') as any, {
       lineNumbers: true,
-      mode: 'sql',
+      mode: 'python',
     })
     editor.setSize(null, '100%')
   }

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

@@ -214,12 +214,15 @@ export default class ScriptNodeInfo extends React.Component<any, any> {
           title="编辑脚本"
           open={this.state.scriptModalVisible}
           onOk={this.submitScriptEdit}
-          okText="确认修改"
           className='script-modal'
-          cancelText="取消"
           width={'90%'}
           style={{ top: 20 }}
           onCancel={() => {this.setState({scriptModalVisible: false})}}
+          footer={[
+            <Button key="back" onClick={() => {this.setState({scriptModalVisible: false})}}>取消</Button>,
+            <Button key="check" type='primary' onClick={() => {console.log('代码校验');}}>代码校验</Button>,
+            <Button key="submit" type='primary' onClick={this.submitScriptEdit}>确定修改</Button>
+          ]}
         >
           <div className='modal-container'>
             {/* 数据表展示 */}

+ 3 - 0
packages/yili-dag/style/ScriptNodeInfo.css

@@ -8,6 +8,9 @@
   background-color: #F7F7F7;
   border-bottom: 1px solid #ddd;;
   height: 5%;
+  display: flex;
+  align-items: center;
+  padding: 0 15px;
 }
 
 .modal-table {