king
2020-09-09 2a347c8d91d6962f4302f0553c55a3b9f743baa5
src/templates/sharecomponent/settingcomponent/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Icon, Modal, Button, notification } from 'antd'
import { Icon, Modal, Button } from 'antd'
import Utils from '@/utils/utils.js'
import DevUtils from '@/utils/devutils.js'
@@ -84,18 +84,8 @@
    const { config } = this.props
    const { menu } = this.state
    this.settingRef.handleConfirm(true).then(setting => {
      if (setting.interType !== 'inner' || !setting.innerFunc) {
        notification.warning({
          top: 92,
          message: '使用内部接口,且存在内部函数时,才可以创建存储过程!',
          duration: 5
        })
        return
      }
    this.settingRef.handleConfirm('func').then(setting => {
      let _config = {...config, setting: setting}
      let newLText = Utils.formatOptions(DevUtils.getTableFunc(setting, menu, _config)) // 创建存储过程sql
      let DelText = Utils.formatOptions(DevUtils.dropfunc(setting.innerFunc))          // 删除存储过程sql
@@ -114,16 +104,7 @@
    const { config } = this.props
    const { menu } = this.state
    this.settingRef.handleConfirm(true).then(setting => {
      if (setting.interType !== 'system') {
        notification.warning({
          top: 92,
          message: '使用系统接口时,才可以创建接口!',
          duration: 5
        })
        return
      }
    this.settingRef.handleConfirm('interface').then(setting => {
      let _config = {...config, setting: setting}
      let _menu = {
        type: config.Template === 'CommonTable' ? 'main' : 'subtable',
@@ -173,13 +154,11 @@
          destroyOnClose
        >
          <SettingForm
            type={config.Template === 'CommonTable' ? 'main' : 'subtable'}
            dict={dict}
            menu={menu}
            config={config}
            search={search}
            permFuncField={permFuncField}
            inputSubmit={this.settingSave}
            wrappedComponentRef={(inst) => this.settingRef = inst}
          />
        </Modal>