From da64ab0923bf8817fc8599a6e37b953ce38f64c8 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 27 八月 2023 18:37:36 +0800
Subject: [PATCH] 2023-08-27

---
 src/menu/datasource/verifycard/index.jsx |   34 ++++++++++++++++++++++++++++------
 1 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/src/menu/datasource/verifycard/index.jsx b/src/menu/datasource/verifycard/index.jsx
index ddd14c0..9d84902 100644
--- a/src/menu/datasource/verifycard/index.jsx
+++ b/src/menu/datasource/verifycard/index.jsx
@@ -29,7 +29,8 @@
 
 class VerifyCard extends Component {
   static propTpyes = {
-    config: PropTypes.object,        // 缁勪欢閰嶇疆淇℃伅
+    config: PropTypes.object,
+    updRecord: PropTypes.func
   }
 
   state = {
@@ -117,7 +118,7 @@
       {
         title: 'SQL',
         dataIndex: 'sql',
-        width: '72%',
+        width: '65%',
         render: (text) => {
           let title = text.match(/^\s*\/\*.+\*\//)
           title = title && title[0] ? title[0] : ''
@@ -132,9 +133,21 @@
         }
       },
       {
+        title: '鎵ц浣嶇疆',
+        dataIndex: 'position',
+        width: '10%',
+        render: (text, record) => {
+          if (record.position === 'back') {
+            return <span style={{color: '#1890ff'}}>鍚庣疆</span>
+          } else {
+            return <span style={{color: '#26C281'}}>鍓嶇疆</span>
+          }
+        }
+      },
+      {
         title: '鐘舵��',
         dataIndex: 'status',
-        width: '13%',
+        width: '10%',
         render: (text, record) => record.status === 'false' ?
           (
             <div style={{color: '#ff4d4f'}}>
@@ -244,7 +257,7 @@
 
     _sParam.open_key = Utils.encryptOpenKey(_sParam.secretkey, _sParam.timestamp) // 浜戠鏁版嵁楠岃瘉
     
-    Api.getSystemConfig(_sParam).then(res => {
+    Api.getCloudConfig(_sParam).then(res => {
       if (res.status) {
         let _scripts = res.data.map(item => {
           return {
@@ -657,6 +670,7 @@
   }
 
   sqlverify = (resolve, reject, change = false, testScripts) => {
+    const { config } = this.props
     const { columns, setting, scripts, searches, defaultSearch, debugId } = this.state
 
     let _scripts = scripts.filter(item => item.status !== 'false')
@@ -681,7 +695,7 @@
 
     if ((setting.interType === 'system' && setting.execute !== 'false') || _scripts.length > 0) {
       let timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
-      let r = SettingUtils.getDebugSql(setting, _scripts, columns, searches, defaultSearch, '2023-04-20 15:29:37')
+      let r = SettingUtils.getDebugSql(setting, _scripts, columns, searches, defaultSearch, config.type, '2023-04-20 15:29:37')
 
       let _debugId = md5(r.sql)
 
@@ -898,7 +912,14 @@
           this.setState({reload: false})
         })
       }
+
+      this.props.updRecord({...res.data.setting})
     })
+  }
+
+  updateStatus = (res) => {
+    this.setState({median: {...res}})
+    this.props.updRecord({...res})
   }
 
   copyColumns = () => {
@@ -972,7 +993,7 @@
               subColumns={subColumns}
               setting={setting}
               scripts={scripts}
-              updateStatus={(res) => this.setState({median: {...res}})}
+              updateStatus={this.updateStatus}
               wrappedComponentRef={(inst) => this.settingForm = inst}
             /> : null}
           </TabPane>
@@ -1027,6 +1048,7 @@
               this.setState({visible: true, script: null, scriptValue: ''})
             }}/> : null}
             <CustomScriptsForm
+              type={config.type}
               setting={setting}
               searches={searches}
               defaultsql={defaultsql}

--
Gitblit v1.8.0