From 81d0d7721bb14a34b1eef99fd9506c3eda4bda99 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 18 十月 2023 17:17:47 +0800
Subject: [PATCH] 2023-10-18

---
 src/menu/sysinterface/index.jsx |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/menu/sysinterface/index.jsx b/src/menu/sysinterface/index.jsx
index 240fea2..1504093 100644
--- a/src/menu/sysinterface/index.jsx
+++ b/src/menu/sysinterface/index.jsx
@@ -52,7 +52,6 @@
         dataIndex: 'operation',
         render: (text, record) =>
           (<div style={{textAlign: 'center'}}>
-            <DataSource config={record} updateConfig={this.update}/>
             <span onClick={() => this.handleStatus(record)} style={{color: '#8E44AD', cursor: 'pointer', fontSize: '16px', marginRight: '15px'}}><SwapOutlined /></span>
             <span onClick={() => this.copy(record)} style={{color: '#26C281', cursor: 'pointer', fontSize: '16px', marginRight: '15px'}}><CopyOutlined /></span>
             <Popconfirm
@@ -60,8 +59,9 @@
               title="纭畾鍒犻櫎锛�"
               onConfirm={() => this.deleteScript(record)
             }>
-              <span style={{color: '#ff4d4f', cursor: 'pointer', fontSize: '16px'}}><DeleteOutlined /></span>
+              <span style={{color: '#ff4d4f', cursor: 'pointer', fontSize: '16px', marginRight: '15px'}}><DeleteOutlined /></span>
             </Popconfirm>
+            <DataSource config={record} updateConfig={this.update}/>
           </div>)
       }
     ]
@@ -176,7 +176,7 @@
     let trimreg = /(from|update|insert\s+into)\s+(@db@)?/ig
 
     if (record.setting.interType === 'system') {
-      if (record.setting.execute !== 'false') {
+      if (record.setting.execute !== 'false' && record.setting.dataresource) {
         let tbs = record.setting.dataresource.match(cutreg)
         tbs && cuts.push(...tbs)
       }
@@ -185,7 +185,7 @@
         let tbs = script.sql.match(cutreg)
         tbs && cuts.push(...tbs)
       })
-    } else {
+    } else if (record.setting.tableName) {
       let tb = record.setting.tableName.replace(/@db@|\s+/ig, '')
       if (/[a-z_]+/ig.test(tb)) {
         tables.push(tb)
@@ -211,6 +211,8 @@
     record.name = record.setting.name
     record.$tables = this.getTables(record)
 
+    delete record.subColumns
+
     let interfaces = this.state.interfaces.map(item => {
       if (item.uuid !== record.uuid) {
         return item
@@ -221,6 +223,7 @@
     this.setState({ interfaces })
     this.props.updateConfig({...config, interfaces})
 
+    MKEmitter.emit('editLineId', record.uuid)
     setTimeout(() => {
       MKEmitter.emit('mkUpdateInter', record, {delay: 0})
     }, 10)
@@ -252,8 +255,8 @@
     const { visible, columns, interfaces } = this.state
 
     return (
-      <div className="mk-sys-interface" style={{display: 'inline-block'}}>
-        <Button className="mk-border-green" onClick={this.trigger}><DatabaseOutlined /> 鍏叡鏁版嵁婧�</Button>
+      <>
+        <Button className="mk-border-danger" onClick={this.trigger}><DatabaseOutlined /> 鍏叡鏁版嵁婧�</Button>
         <Modal
           title="鍏叡鏁版嵁婧�"
           wrapClassName="interface-controller-modal"
@@ -271,7 +274,7 @@
           <PlusOutlined key="add-interface" onClick={this.addInterface}/>
           <EditTable key="manage-interface" actions={['copy']} type="interface" data={interfaces} columns={columns} onChange={this.changeScripts}/>
         </Modal>
-      </div>
+      </>
     )
   }
 }

--
Gitblit v1.8.0