king
2022-11-21 f6626b05f1275cc2f8ca77f773d4f6a6af1b0a89
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', '数据源')
  }
  /**
@@ -70,8 +67,6 @@
      res.actionfixed = res.actionfixed === 'true'
      this.props.updatesetting({...config, setting: res})
      MKEmitter.emit('modalStatus', false)
    }, () => {
      this.setState({
        loading: false
@@ -152,6 +147,16 @@
          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
        }
      })
    }
    setting.maxScript = maxScript
@@ -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