From c7aece35a62b6e91fd98a625bf0e53f64bfbd18d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 17 八月 2023 16:22:15 +0800
Subject: [PATCH] 2023-08-17

---
 src/templates/sharecomponent/settingcomponent/index.jsx |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/templates/sharecomponent/settingcomponent/index.jsx b/src/templates/sharecomponent/settingcomponent/index.jsx
index 85be0a7..24a1ce3 100644
--- a/src/templates/sharecomponent/settingcomponent/index.jsx
+++ b/src/templates/sharecomponent/settingcomponent/index.jsx
@@ -5,7 +5,6 @@
 import { SettingOutlined } from '@ant-design/icons'
 
 import Utils, { FuncUtils } from '@/utils/utils.js'
-import MKEmitter from '@/utils/events.js'
 import SettingForm from './settingform'
 import CreateFunc from '@/templates/zshare/createfunc'
 import CreateInterface from '@/templates/zshare/createinterface'
@@ -48,8 +47,6 @@
       search: _search,
       menu: menu
     })
-
-    MKEmitter.emit('modalStatus', '鏁版嵁婧�')
   }
 
   /**
@@ -67,11 +64,8 @@
         visible: false,
         loading: false
       })
-      res.actionfixed = res.actionfixed === 'true'
 
       this.props.updatesetting({...config, setting: res})
-
-      MKEmitter.emit('modalStatus', false)
     }, () => {
       this.setState({
         loading: false
@@ -89,7 +83,7 @@
     this.settingRef.handleConfirm('loading').then(setting => {
       let res = this.resetSetting(setting, config.setting)
       let _config = {...config, setting: res}
-      let newLText = Utils.formatOptions(FuncUtils.getTableFunc(setting, menu, _config)) // 鍒涘缓瀛樺偍杩囩▼sql
+      let newLText = Utils.formatOptions(FuncUtils.getTableFunc(setting.innerFunc, menu, _config)) // 鍒涘缓瀛樺偍杩囩▼sql
       let DelText = Utils.formatOptions(FuncUtils.dropfunc(setting.innerFunc))          // 鍒犻櫎瀛樺偍杩囩▼sql
 
       this.refs.funcCreatComponent.exec(setting.innerFunc, newLText, DelText)
@@ -127,6 +121,7 @@
     setting.drawerPlacement = ori.drawerPlacement || 'right'
     setting.searchRatio = ori.searchRatio || 6
     setting.searchLwidth = ori.searchLwidth !== undefined ? ori.searchLwidth : 33.3
+    setting.resetContrl = ori.resetContrl || 'init'
 
     if (window.GLOB.funcs && window.GLOB.funcs.length > 0) {
       window.GLOB.funcs.forEach(m => {
@@ -150,6 +145,16 @@
         })
         if (setting.dataresource) {
           setting.dataresource = setting.dataresource.replace(reg, `/*$ex@${m.func_code}-begin*/\n${m.key_sql}\n/*@ex$-end*/`)
+        }
+      })
+    } else {
+      setting.scripts.forEach(item => {
+        if (item.status === 'false') return
+
+        if (/exec\s/ig.test(item.sql)) {
+          maxScript = 1000
+        } else if (item.sql.length > maxScript) {
+          maxScript = item.sql.length
         }
       })
     }
@@ -185,11 +190,11 @@
           visible={visible}
           width={'75vw'}
           maskClosable={false}
-          onCancel={() => { MKEmitter.emit('modalStatus', false); this.setState({ visible: false, loading: false })}}
+          onCancel={() => { this.setState({ visible: false, loading: false })}}
           footer={[
             record && record.interType === 'system' ? <CreateInterface key="interface" loading={this.state.interloading} ref="tableCreatInterface" trigger={this.tableCreatInterface}/> : null,
             record && record.interType === 'inner' ? <CreateFunc key="create" ref="funcCreatComponent" trigger={this.tableCreatFunc}/> : null,
-            <Button key="cancel" onClick={() => { MKEmitter.emit('modalStatus', false); this.setState({ visible: false, loading: false }) }}>鍙栨秷</Button>,
+            <Button key="cancel" onClick={() => { this.setState({ visible: false, loading: false }) }}>鍙栨秷</Button>,
             <Button key="confirm" type="primary" loading={this.state.loading} onClick={this.settingSave}>纭畾</Button>
           ]}
           destroyOnClose

--
Gitblit v1.8.0