king
2019-12-12 790dfe8172be5027940a04594224531d15143389
2019-12-12
13个文件已修改
788 ■■■■■ 已修改文件
src/components/sidemenu/editthdmenu/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sidemenu/menuelement/card.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sidemenu/menuelement/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/tabview/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/en-US/comtable.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/zh-CN/comtable.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/actionform/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/dragelement/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/editcard/index.jsx 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.jsx 650 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/source.jsx 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sidemenu/editthdmenu/index.jsx
@@ -333,7 +333,7 @@
          text: '',
          type: template.type,
          PageParam: {OpenType: 'newtab', Template: template.type},
          LongParam: '',
          LongParam: template.baseconfig,
          ParentID: this.props.supMenu.MenuID
        }
      })
@@ -342,7 +342,7 @@
      this.setState({
        tabview: template.type,
        editMenu: {...editMenu, ...{LongParam: template.baseconfig, PageParam: _PageParam, type: template.type}}
        editMenu: {...editMenu, LongParam: template.baseconfig, PageParam: _PageParam, type: template.type}
      })
    }
    document.getElementById('root').style.overflowY = 'hidden'
src/components/sidemenu/menuelement/card.jsx
@@ -4,7 +4,7 @@
import ItemTypes from './itemtypes'
import './index.scss'
const Card = ({ id, icon, text, moveCard, findCard, editCard, closeCard }) => {
const Card = ({ id, icon, text, menutype, moveCard, findCard, editCard, closeCard }) => {
  const originalIndex = findCard(id).index
  const [{ isDragging }, drag] = useDrag({
    item: { type: ItemTypes.CARD, id, originalIndex },
@@ -37,7 +37,7 @@
        {icon && <Icon type={icon} />}
        {text}
      </div>
      <Icon className="edit" type="edit" onClick={edit} />
      {menutype !== 'iframe' ? <Icon className="edit" type="edit" onClick={edit} /> : null}
      <Icon className="close" type="close" onClick={close} />
    </div>
  )
src/components/sidemenu/menuelement/index.jsx
@@ -39,6 +39,7 @@
      type: 'close'
    })
  }
  const [, drop] = useDrop({ accept: ItemTypes.CARD })
  return (
    <div ref={drop} className="sidemenu-dragboard">
@@ -47,6 +48,7 @@
          key={card.id}
          id={`${card.id}`}
          icon={card.PageParam && card.PageParam.Icon}
          menutype={card.type}
          text={card.text}
          moveCard={moveCard}
          editCard={editCard}
src/components/tabview/index.jsx
@@ -18,6 +18,12 @@
let Comps = {}
let service = window.GLOB.service ? (/\/$/.test(window.GLOB.service) ? window.GLOB.service : window.GLOB.service + '/') : ''
if (process.env.NODE_ENV === 'production') {
  service = document.location.origin + '/' + service + 'zh-CN/'
} else {
  service = 'http://qingqiumarket.cn/' + service + 'zh-CN/'
}
class Header extends Component {
  static propTpyes = {
    collapse: PropTypes.bool,
@@ -72,7 +78,7 @@
    } else if (view.type === 'TabForm') {
      return (<Comps.TabForm MenuNo={view.MenuNo} MenuID={view.MenuID} key={view.MenuID} param={view.param}/>)
    } else if (view.type === 'iframe') {
      return (<Comps.Iframe key={view.MenuID} title={view.MenuName} url={'http://qingqiumarket.cn/' + service + 'zh-CN/' + view.LinkUrl}/>)
      return (<Comps.Iframe key={view.MenuID} title={view.MenuName} url={service + view.LinkUrl}/>)
    } else {
      return (<NotFount key={view.MenuID} />)
    }
src/locales/en-US/comtable.js
@@ -8,6 +8,7 @@
  'header.save': 'Save',
  'header.notsave': 'Do not save',
  'header.close': 'Close',
  'header.reset': 'Reset',
  'header.menu.basemsg': 'Please complete the basic information !',
  'header.menu.template.change': 'Switch the template',
  'header.menu.addtitle': 'The new menu',
@@ -37,6 +38,7 @@
  'header.menu.openType.menu': 'Menu',
  'header.menu.openType.newWindow': 'A new window',
  'header.menu.newpage.service': 'Customer Service',
  'header.menu.func.create': '创建存储过程',
  'header.form.search.placeholder': 'Please add search criteria',
  'header.form.modal.placeholder': 'Please add the form',
  'header.form.action.placeholder': 'Please add buttons',
@@ -48,6 +50,7 @@
  'header.form.column.action': 'Action',
  'header.form.name': 'Name',
  'header.form.field': 'Field',
  'header.form.field.placeholder': '请输入字段名',
  'header.form.innerFunc': 'Internal function',
  'header.form.outerFunc': 'External function',
  'header.form.callbackFunc': 'Callback function',
src/locales/zh-CN/comtable.js
@@ -8,6 +8,7 @@
  'header.save': '保存',
  'header.notsave': '不保存',
  'header.close': '关闭',
  'header.reset': '重置',
  'header.menu.basemsg': '请完善菜单基本信息!',
  'header.menu.template.change': '切换模板',
  'header.menu.addtitle': '新建菜单',
@@ -37,6 +38,7 @@
  'header.menu.openType.menu': '菜单',
  'header.menu.openType.newWindow': '新窗口',
  'header.menu.newpage.service': '客服',
  'header.menu.func.create': '创建存储过程',
  'header.form.search.placeholder': '请添加搜索条件',
  'header.form.modal.placeholder': '请添加表单',
  'header.form.action.placeholder': '请添加按钮',
@@ -48,6 +50,7 @@
  'header.form.column.action': '操作',
  'header.form.name': '名称',
  'header.form.field': '字段',
  'header.form.field.placeholder': '请输入字段名',
  'header.form.innerFunc': '内部函数',
  'header.form.outerFunc': '外部函数',
  'header.form.callbackFunc': '回调函数',
src/tabviews/commontable/index.jsx
@@ -362,8 +362,6 @@
  UNSAFE_componentWillMount () {
    // 组件加载时,获取菜单数据
    this.loadconfig()
    console.log(Utils.getfunc())
  }
  shouldComponentUpdate (nextProps, nextState) {
src/templates/comtableconfig/actionform/index.jsx
@@ -111,7 +111,7 @@
      if (_intertype === 'outer') {
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError', 'method']
      } else {
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType']
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError']
      }
    } else {
      if (_intertype === 'outer') {
@@ -132,7 +132,7 @@
        } else if (item.key === 'Ot') {
          if (_opentype === 'innerpage' || _position === 'grid') {
            item.options = this.state.reqOptionSgl
          } else if (['outerpage', 'blank', 'tab', 'pop', 'popview'].includes(_opentype)) {
          } else if (['outerpage', 'blank', 'tab', 'popview'].includes(_opentype)) {
            item.options = this.state.reqOptions
          } else {
            item.options = this.state.reqOptionsMutil
@@ -158,7 +158,7 @@
        if (this.state.interType === 'outer') {
          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError', 'method']
        } else {
          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType']
          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError']
        }
      } else {
        if (this.state.interType === 'inner') {
@@ -181,7 +181,7 @@
              item.options = this.state.reqOptionSgl
              item.initVal = 'requiredSgl'
              item.hidden = true
            } else if (['outerpage', 'blank', 'tab', 'pop', 'popview'].includes(value)) {
            } else if (['outerpage', 'blank', 'tab', 'popview'].includes(value)) {
              item.options = this.state.reqOptions
              item.initVal = 'requiredSgl'
              item.hidden = true
src/templates/comtableconfig/dragelement/index.jsx
@@ -49,6 +49,7 @@
      newid++
    }
    copycard.id = newid
    copycard.originCard = card
    copyElement(copycard)
  }
src/templates/comtableconfig/editcard/index.jsx
@@ -1,5 +1,5 @@
import React, {Component} from 'react'
import { Row, Col, Icon, Radio, Input } from 'antd'
import { Row, Col, Icon, Radio, Input, Button } from 'antd'
import './index.scss'
const { Search } = Input
@@ -49,8 +49,8 @@
      <div className={'ant-card ant-card-bordered ' + (card.selected ? 'selected' : '')} >
        <div className="base" onClick={this.changeSelect}>
          <Icon type="check" />
          <p title={card.field}>字段: <span>{card.field}</span></p>
          <p title={card.label}>名称: <span>{card.label}</span></p>
          <p title={card.field}>{this.props.dict['header.form.field']}: <span>{card.field}</span></p>
          <p title={card.label}>{this.props.dict['header.form.name']}: <span>{card.label}</span></p>
        </div>
        {type === 'search' ?
          <Radio.Group onChange={this.changeType} value={card.type} disabled={!card.selected}>
@@ -78,7 +78,8 @@
      dataSource: props.data,
      selectCards: props.data.filter(item => item.selected),
      type: props.type,
      searchKey: ''
      searchKey: '',
      loading: false
    }
  }
@@ -101,14 +102,30 @@
    })
  }
  reset = () => {
    this.setState({
      searchKey: '',
      loading: true
    }, () => {
      this.setState({
        loading: false
      })
    })
  }
  render() {
    const { dataSource, type } = this.state
    const { dataSource, type, loading } = this.state
    return (
      <div className="common-modal-edit-card">
        <Row className="search-row">
          <Col span={8}>
            <Search placeholder="请输入字段名" onSearch={value => {this.setState({searchKey: value})}} enterButton />
            {!loading ? <Search placeholder={this.props.dict['header.form.field.placeholder']} onSearch={value => {this.setState({searchKey: value})}} enterButton /> : null}
          </Col>
          <Col span={8}>
            <Button onClick={this.reset}>
              {this.props.dict['header.reset']}
            </Button>
          </Col>
        </Row>
        <Row>
@@ -116,7 +133,7 @@
            if (item.field.toLowerCase().indexOf(this.state.searchKey.toLowerCase()) >= 0) {
              return (
                <Col key={index} span={8}>
                  <EditCardCell ref={'cellCard' + index} type={type} card={item} changeCard={this.changeCard} />
                  <EditCardCell ref={'cellCard' + index} type={type} card={item} dict={this.props.dict} changeCard={this.changeCard} />
                </Col>
              )
            } else {
src/templates/comtableconfig/index.jsx
@@ -37,7 +37,6 @@
  }
  state = {
    operaType: '',           // 操作类型,新建或编辑
    dict: CommonDict,        // 字典
    config: null,            // 页面配置
    visible: false,          // 搜索条件、按钮、显示列,模态框显示控制
@@ -60,7 +59,8 @@
    tables: [],              // 可用表名
    selectedTables: [],      // 已选表名
    originMenu: null,        // 原始菜单
    originActions: null
    originActions: null,
    delActions: []
  }
  /**
@@ -69,14 +69,12 @@
   * 2、设置操作类型、原始菜单信息(每次保存后重置)、已使用表及基本信息表单
   */
  UNSAFE_componentWillMount () {
    const { menu, type } = this.props
    const { menu } = this.props
    let _LongParam = menu.LongParam
    let _config = ''
    let _type = type
    if (_type === 'add' || !_LongParam) {
      _type = 'add'
    if (!_LongParam) {
      _config = JSON.parse(JSON.stringify((Source.baseConfig)))
    } else {
      let _setting = Source.baseConfig.setting
@@ -86,16 +84,29 @@
      _LongParam.setting = _setting
      _config = _LongParam
    }
    let _oriActions = []
    if (_config.type === 'user') {
      _config.action = _config.action.map(item => {
        let uuid = Utils.getuuid()
    let _oriActions = _config.action
    if (_config.type === 'user' || _config.type === 'system') {
      _oriActions = []
        if (item.OpenType === 'pop') { // 含有子配置项的按钮。。。
          _oriActions.push({
            prebtn: JSON.parse(JSON.stringify(item)),
            curuuid: uuid,
            Template: 'Modal'
          })
        }
        item.uuid = uuid
        return item
      })
    }
    this.setState({
      originActions: _oriActions,
      config: _config,
      operaType: _type,
      originMenu: JSON.parse(JSON.stringify(menu)),
      selectedTables: _config.tables || [],
      menuformlist: [
@@ -913,6 +924,8 @@
   * 3、添加或编辑列,保存时,如按钮位置设置为表格,则修改操作列显示状态
   */
  handleSubmit = () => {
    const { menu } = this.props
    const { card } = this.state
    let _config = JSON.parse(JSON.stringify(this.state.config))
    if (this.state.formtemp !== 'gridbtn') {
@@ -927,6 +940,35 @@
            }
            res.values.dataSourceSql = Utils.formatOptions(sql)
          }
        }
        if (res.type === 'action' && card.originCard && res.values.OpenType === 'pop') {
          Api.getSystemConfig({
            func: 'sPC_Get_LongParam',
            MenuID: card.originCard.uuid
          }).then(result => {
            if (result.status && result.LongParam) {
              let param = {
                func: 'sPC_ButtonParam_AddUpt',
                ParentID: menu.MenuID,
                MenuID: res.values.uuid,
                MenuNo: menu.MenuNo,
                Template: 'Modal',
                MenuName: res.values.label,
                PageParam: JSON.stringify({Template: 'Modal'}),
                LongParam: result.LongParam
              }
              Api.getSystemConfig(param).then(response => {
                if (!response.status) {
                  notification.warning({
                    top: 92,
                    message: response.message,
                    duration: 10
                  })
                }
              })
            }
          })
        }
  
        _config[res.type] = _config[res.type].map(item => {
@@ -995,11 +1037,14 @@
  }
  creatFunc = () => {
    // let _config = JSON.parse(JSON.stringify(this.state.config))
    let _config = JSON.parse(JSON.stringify(this.state.config))
    this.formRef.handleConfirm().then(res => {
      let btn = res.values
      let LText = ''
      let DelText = ''
      let isExit = false
      if (!btn.innerFunc) {
        notification.warning({
          top: 92,
@@ -1027,7 +1072,22 @@
            }
            if (_LongParam) {
              resolve(_LongParam)
              let fields = []
              if (_LongParam.groups.length > 0) {
                _LongParam.groups.forEach(group => {
                  fields = [...fields, ...group.sublist]
                })
              } else {
                fields = _LongParam.fields
              }
              let _param = {
                name: _config.setting.tableName || '',
                fields: fields
              }
              LText = Utils.formatOptions(Utils.getfunc(_param))
              DelText = Utils.formatOptions(Utils.dropfunc(_param.name))
              resolve(true)
            } else {
              resolve(false)
              notification.warning({
@@ -1038,21 +1098,26 @@
            }
          })
        } else {
          let _param = {
            name: _config.setting.tableName || '',
            fields: ''
          }
          LText = Utils.formatOptions(Utils.getfunc(_param))
          DelText = Utils.formatOptions(Utils.dropfunc(_param.name))
          resolve(true)
        }
      }).then(res => {
        if (!res) return
        LText = Utils.formatOptions(Utils.getfunc())
        console.log(LText)
        console.log(res)
        if (res === false) return res
        return Api.getSystemConfig({
          func: 'sPC_Get_TVP',
          TVPName: btn.innerFunc
        })
      }).then(res => {
        console.log(res)
        if (res.status) {
          return true
        } else {
        if (res === false) return res
        if (!res.status) {
          notification.warning({
            top: 92,
            message: res.message,
@@ -1060,57 +1125,161 @@
          })
          return false
        }
        if (res.TVPText && LText === res.TVPText) {
          return 'drop'
        } else {
          if (res.TVPText) {
            isExit = true
          }
          return Api.getSystemConfig({
            func: 'sPC_TVP_InUp',
            TVPName: btn.innerFunc,
            TVPText: LText,
            TypeName: 'P'
          })
        }
      }).then(res => {
        console.log(res)
        if (res === false || res === 'drop') return res
        if (!res.status) {
          notification.warning({
            top: 92,
            message: res.message,
            duration: 10
          })
          return false
        } else if (isExit) {
          return 'drop'
        } else {
          return 'create'
        }
      }).then(res => {
        console.log(res)
        if (res === false || res === 'create') return res
        let _param = {
          func: 'sPC_TableData_InUpDe',
          LText: DelText
        }
        _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
        _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp)
        return Api.getSystemConfig(_param)
      }).then(res => {
        console.log(res)
        if (res === false || res === 'create') return res
        if (!res.status) {
          notification.warning({
            top: 92,
            message: res.message,
            duration: 10
          })
          return false
        } else {
          return 'create'
        }
      }).then(res => {
        console.log(res)
        if (res === false) return res
        let _param = {
          func: 'sPC_TableData_InUpDe',
          LText: LText
        }
        _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
        _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp)
        return Api.getSystemConfig(_param)
      }).then(res => {
        console.log(res)
        if (res === false) return res
        if (!res.status) {
          notification.warning({
            top: 92,
            message: res.message,
            duration: 10
          })
          return false
        } else {
          notification.success({
            top: 92,
            message: '创建成功',
            duration: 5
          })
        }
      }).then(res => {
        console.log(res)
        if (res === false) return res
        if (!res.status) {
          notification.warning({
            top: 92,
            message: res.message,
            duration: 10
          })
          return false
        } else {
          notification.success({
            top: 92,
            message: '创建成功',
            duration: 5
          })
          return true
        }
      }).then(res => {
        console.log(res)
        if (res === false) return res
        let isupdate = false
        _config.action = _config.action.map(item => {
          if (item.uuid === res.values.uuid) {
            isupdate = true
            return res.values
          } else {
            return item
          }
        })
        _config.action = _config.action.filter(item => !item.origin)
        if (!isupdate) { // 操作不是修改,添加元素至列表
          _config.action.push(res.values)
        }
        let gridbtn = _config.action.filter(act => act.position === 'grid')
        let _display = false
        if (gridbtn.length > 0) {
          _display = true
        }
        if (_config.gridBtn) {
          _config.gridBtn.display = _display
        } else {
          _config.gridBtn = {
            display: _display,
            Align: 'center',
            IsSort: 'false',
            uuid: Utils.getuuid(),
            label: this.state.dict['header.form.column.action'],
            type: 'action',
            style: 'button',
            show: 'horizontal',
            Width: 120
          }
        }
        this.setState({
          config: _config,
          actionloading: true
        }, () => {
          this.setState({
            actionloading: false
          })
        })
      })
      // let isupdate = false
      // _config.action = _config.action.map(item => {
      //   if (item.uuid === res.values.uuid) {
      //     isupdate = true
      //     return res.values
      //   } else {
      //     return item
      //   }
      // })
      // _config.action = _config.action.filter(item => !item.origin)
      // if (!isupdate) { // 操作不是修改,添加元素至列表
      //   _config.action.push(res.values)
      // }
      // let gridbtn = _config.action.filter(act => act.position === 'grid')
      // let _display = false
      // if (gridbtn.length > 0) {
      //   _display = true
      // }
      // if (_config.gridBtn) {
      //   _config.gridBtn.display = _display
      // } else {
      //   _config.gridBtn = {
      //     display: _display,
      //     Align: 'center',
      //     IsSort: 'false',
      //     uuid: Utils.getuuid(),
      //     label: this.state.dict['header.form.column.action'],
      //     type: 'action',
      //     style: 'button',
      //     show: 'horizontal',
      //     Width: 120
      //   }
      // }
      // this.setState({
      //   config: _config,
      //   actionloading: true
      // }, () => {
      //   this.setState({
      //     actionloading: false
      //   })
      // })
    })
  }
@@ -1131,6 +1300,7 @@
        })
        _this.setState({
          config: _config,
          delActions: [..._this.state.delActions, element.card.uuid],
          [element.type + 'loading']: true
        }, () => {
          _this.setState({
@@ -1151,35 +1321,21 @@
   */
  submitConfig = () => {
    const { menu } = this.props
    const { config, originMenu } = this.state
    const { originMenu } = this.state
    let config = JSON.parse(JSON.stringify(this.state.config))
    this.menuformRef.handleConfirm().then(res => {
      config.search = config.search.filter(item => !item.origin)
      config.action = config.action.filter(item => !item.origin)
      config.columns = config.columns.filter(item => !item.origin)
      // if (config.search[0] && config.search[0].origin) {
      //   notification.warning({
      //     top: 92,
      //     message: '请设置搜索条件',
      //     duration: 10
      //   })
      //   return
      // }
      // if (config.action[0] && config.action[0].origin) {
      //   notification.warning({
      //     top: 92,
      //     message: '请设置按钮',
      //     duration: 10
      //   })
      //   return
      // }
      // if (config.columns[0] && config.columns[0].origin) {
      //   notification.warning({
      //     top: 92,
      //     message: '请设置显示列',
      //     duration: 10
      //   })
      //   return
      // }
      if (config.search[0] && config.search[0].origin) {
        config.search = config.search.filter(item => !item.origin)
      }
      if (config.action[0] && config.action[0].origin) {
        config.action = config.action.filter(item => !item.origin)
      }
      if (config.columns[0] && config.columns[0].origin) {
        config.columns = config.columns.filter(item => !item.origin)
      }
      let _LongParam = ''
      let _config = {...config, tables: this.state.selectedTables}
@@ -1216,102 +1372,64 @@
      btnParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
      btnParam.secretkey = Utils.encrypt(btnParam.LText, btnParam.timestamp)
      if (this.state.operaType === 'add') { // 新建菜单
        let param = {
          func: 'sPC_TrdMenu_Add',
          ParentID: res.parentId,
          MenuID: menu.MenuID,
          MenuNo: res.menuNo,
          Template: menu.PageParam.Template || '',
          MenuName: res.menuName,
          PageParam: JSON.stringify(_pageParam),
          LongParam: _LongParam
        }
        if (this.state.closeVisible) { // 显示关闭对话框时,模态框中保存按钮,显示保存中状态
          this.setState({
            menucloseloading: true
          })
        } else {
          this.setState({
            menuloading: true
          })
        }
        Api.getSystemConfig(param).then(response => {
          if (response.status) {
            this.setState({
              operaType: 'edit',
              originMenu: {
                ...originMenu,
                LongParam: _config,
                PageParam: _pageParam,
                MenuName: res.menuName,
                MenuNo: res.menuNo,
                ParentID: res.parentId
              }
            })
            this.submitAction(btnParam)
          } else {
            this.setState({
              menuloading: false,
              menucloseloading: false
            })
            notification.warning({
              top: 92,
              message: response.message,
              duration: 10
            })
          }
      let param = {
        func: 'sPC_TrdMenu_AddUpt',
        ParentID: res.parentId,
        MenuID: menu.MenuID,
        MenuNo: res.menuNo,
        Template: menu.PageParam.Template || '',
        MenuName: res.menuName,
        Sort: (this.props.supMenuList.length + 1) * 10,
        PageParam: JSON.stringify(_pageParam),
        LongParam: _LongParam
      }
      if (this.state.closeVisible) { // 显示关闭对话框时,模态框中保存按钮,显示保存中状态
        this.setState({
          menucloseloading: true
        })
      } else { // 修改菜单
        let param = {
          func: 'sPC_TrdMenu_Upt',
          ParentID: res.parentId,
          MenuID: menu.MenuID,
          MenuNo: res.menuNo,
          Template: menu.PageParam.Template || '',
          MenuName: res.menuName,
          PageParam: JSON.stringify(_pageParam),
          LongParam: _LongParam
        }
        if (this.state.closeVisible) { // 显示关闭对话框时,模态框中保存按钮,显示保存中状态
          this.setState({
            menucloseloading: true
          })
        } else {
          this.setState({
            menuloading: true
          })
        }
        Api.getSystemConfig(param).then(response => {
          if (response.status) {
            this.setState({
              originMenu: {
                ...originMenu,
                LongParam: _config,
                PageParam: _pageParam,
                MenuName: res.menuName,
                MenuNo: res.menuNo,
                ParentID: res.parentId
              }
            })
            this.submitAction(btnParam)
          } else {
            this.setState({
              menuloading: false,
              menucloseloading: false
            })
            notification.warning({
              top: 92,
              message: response.message,
              duration: 10
            })
          }
      } else {
        this.setState({
          menuloading: true
        })
      }
      Api.getSystemConfig(param).then(response => {
        if (response.status) {
          this.setState({
            config: _config,
            originMenu: {
              ...originMenu,
              LongParam: _config,
              PageParam: _pageParam,
              MenuName: res.menuName,
              MenuNo: res.menuNo,
              ParentID: res.parentId
            },
            searchloading: true,
            actionloading: true,
            columnsloading: true
          }, () => {
            this.setState({
              searchloading: false,
              actionloading: false,
              columnsloading: false
            })
          })
          this.submitAction(btnParam)
        } else {
          this.setState({
            menuloading: false,
            menucloseloading: false
          })
          notification.warning({
            top: 92,
            message: response.message,
            duration: 10
          })
        }
      })
    }, () => {
      notification.warning({
        top: 92,
@@ -1325,8 +1443,117 @@
   * @description 保存或修改菜单按钮
   */
  submitAction = (param) => {
    Api.getSystemConfig(param).then(response => {
      if (response.status) {
    const { config } = this.state
    new Promise(resolve => {
      // 内部请求
      Api.getSystemConfig(param).then(response => {
        if (response.status) {
          resolve('true')
        } else {
          resolve(response)
        }
      })
    }).then(res => {
      console.log(res)
      if (res === 'true' && this.state.delActions.length > 0) {
        let deffers = this.state.delActions.map(item => {
          let param = {
            func: 'sPC_MainMenu_Del',
            MenuID: item
          }
          return new Promise(resolve => {
            Api.getSystemConfig(param).then(res => {
              resolve(res)
            })
          })
        })
        return Promise.all(deffers)
      } else if (res === 'true' && this.state.delActions.length === 0) {
        return 'copy'
      } else if (!res.status) {
        notification.warning({
          top: 92,
          message: res.message,
          duration: 10
        })
        return false
      }
    }).then(response => {
      console.log(response)
      if (response === false || response === 'copy') return response
      let res = 'copy'
      if (Array.isArray(response)) {
        response.forEach(result => {
          if (!result.status) {
            res = result
          }
        })
      }
      if (res === 'copy') return 'copy'
      notification.warning({
        top: 92,
        message: res.message,
        duration: 10
      })
      return false
    }).then(response => {
      console.log(response)
      if (response === false) return response
      let oriActions = []
      this.state.originActions.forEach(item => {
        let curBtn = config.action.filter(cell => item.curuuid === cell.uuid)[0] // 查看初始化按钮是否存在
        if (!curBtn) return
        if (curBtn.OpenType !== item.prebtn.OpenType) return
        oriActions.push({
          prebtn: item.prebtn,
          curBtn: item.curBtn
        })
      })
      if (oriActions.length === 0) return 'true'
      oriActions.forEach(action => {
        Api.getSystemConfig({
          func: 'sPC_Get_LongParam',
          MenuID: action.prebtn ? action.prebtn.uuid : ''
        }).then(result => {
          if (result.status && result.LongParam) {
            let _LongParam = ''
            if (result.LongParam) {
              _LongParam = window.decodeURIComponent(window.atob(result.LongParam))
              try {
                _LongParam = JSON.parse(_LongParam)
              } catch (e) {
                _LongParam = ''
              }
            }
            if (_LongParam) {
              let param = {
                func: 'sPC_ButtonParam_AddUpt',
                ParentID: this.props.menu.MenuID,
                MenuID: action.curBtn.uuid,
                MenuNo: this.props.menu.MenuNo,
                Template: _LongParam.type,
                MenuName: action.curBtn.label,
                PageParam: JSON.stringify({Template: _LongParam.type}),
                LongParam: result.LongParam
              }
              Api.getSystemConfig(param).then(() => {})
            }
          }
        })
      })
      return 'true'
    }).then(response => {
      console.log(response)
      if (response === 'true') {
        notification.success({
          top: 92,
          message: '保存成功',
@@ -1345,11 +1572,6 @@
          menuloading: false,
          menucloseloading: false
        })
        notification.warning({
          top: 92,
          message: response.message,
          duration: 10
        })
      }
    })
  }
@@ -1357,9 +1579,19 @@
  cancelConfig = () => {
    const { menu } = this.props
    const { config, originMenu } = this.state
    let _this = this
    if (this.state.operaType === 'add') {
    let _this = this
    let isAdd = false
    if (
      (config.search[0] && config.search[0].origin) ||
      (config.action[0] && config.action[0].origin) ||
      (config.columns[0] && config.columns[0].origin)
    ) {
      isAdd = true
    }
    if (isAdd) {
      confirm({
        content: '菜单尚未提交,确定放弃保存吗?',
        okText: this.state.dict['header.confirm'],
@@ -1590,11 +1822,14 @@
    }
    this.setState({
      tableVisible: false,
      [addType + 'loading']: true,
      addType: '',
      config: {...config, [addType]: items}
    }, () => {
      notification.success({
        top: 92,
        message: '操作成功',
        duration: 5
      })
      this.setState({
        [addType + 'loading']: false
      })
@@ -1693,7 +1928,17 @@
    const { menu } = this.props
    const { config, originMenu } = this.state
    if (this.state.operaType === 'add') {
    let isAdd = false
    if (
      (config.search[0] && config.search[0].origin) ||
      (config.action[0] && config.action[0].origin) ||
      (config.columns[0] && config.columns[0].origin)
    ) {
      isAdd = true
    }
    if (isAdd) {
      notification.warning({
        top: 92,
        message: '菜单尚未保存,请保存菜单配置!',
@@ -1739,7 +1984,7 @@
                  _LongParam = ''
                }
              }
              console.log(_LongParam)
              this.props.handleSubConfig(btn, originMenu, _LongParam)
            } else {
              this.setState({
@@ -1946,7 +2191,7 @@
          onOk={this.handleSubmit}
          footer={[
            this.state.formtemp === 'action' ?
            <Button key="delete" className="mk-btn mk-purple" onClick={this.creatFunc} loading={this.state.confirmLoading}>{this.state.dict['header.delete']}</Button> : null,
            <Button key="delete" className="mk-btn mk-purple" onClick={this.creatFunc} loading={this.state.confirmLoading}>{this.state.dict['header.menu.func.create']}</Button> : null,
            <Button key="cancel" onClick={() => { this.setState({ visible: false }) }}>{this.state.dict['header.cancel']}</Button>,
            <Button key="confirm" type="primary" onClick={this.handleSubmit}>{this.state.dict['header.confirm']}</Button>
          ]}
@@ -1999,6 +2244,7 @@
          visible={this.state.tableVisible}
          width={'65vw'}
          style={{minWidth: '900px', maxWidth: '1200px'}}
          cancelText={this.state.dict['header.close']}
          onOk={this.addFieldSubmit}
          onCancel={() => { // 取消添加
            this.setState({
@@ -2009,7 +2255,7 @@
          destroyOnClose
        >
          {this.state.addType && this.state.fields.length > 0 ?
            <EditCard data={this.state.fields} ref="searchcard" type={this.state.addType} /> : null
            <EditCard data={this.state.fields} ref="searchcard" type={this.state.addType} dict={this.state.dict} /> : null
          }
          {(!this.state.fields || this.state.fields.length === 0) &&
            <Empty />
src/templates/comtableconfig/source.jsx
@@ -25,7 +25,7 @@
        origin: true,
        id: 0,
        uuid: Utils.getuuid(),
        label: 'text',
        label: 'label',
        field: '',
        initval: '',
        type: 'text',
@@ -44,7 +44,7 @@
        origin: true,
        id: 1,
        uuid: Utils.getuuid(),
        label: 'select',
        label: 'label',
        field: '',
        initval: '',
        type: 'select',
@@ -63,7 +63,7 @@
        origin: true,
        id: 2,
        uuid: Utils.getuuid(),
        label: 'date',
        label: 'label',
        field: '',
        initval: '',
        type: 'date',
@@ -147,26 +147,6 @@
        url: '',
        icon: 'delete',
        class: 'red'
      }, {
        origin: true,
        id: 3,
        uuid: Utils.getuuid(),
        label: 'freeze',
        intertype: 'inner',
        innerFunc: '',
        interface: '',
        method: 'POST',
        outerFunc: '',
        sql: '',
        sqlType: '',
        callbackFunc: '',
        Ot: 'requiredOnce',
        position: 'toolbar',
        OpenType: 'exec',
        pageTemplate: '',
        url: '',
        icon: '',
        class: 'default'
      }
    ],
    columns: [
@@ -175,7 +155,7 @@
        id: 0,
        uuid: Utils.getuuid(),
        Align: 'left',
        label: 'fieldName1',
        label: 'label',
        field: '',
        Hide: 'false',
        IsSort: 'true',
@@ -186,7 +166,7 @@
        id: 1,
        uuid: Utils.getuuid(),
        Align: 'left',
        label: 'fieldName2',
        label: 'label',
        field: '',
        Hide: 'false',
        IsSort: 'true',
@@ -197,7 +177,7 @@
        id: 2,
        uuid: Utils.getuuid(),
        Align: 'left',
        label: 'fieldName3',
        label: 'label',
        field: '',
        Hide: 'false',
        IsSort: 'true',
@@ -208,7 +188,7 @@
        id: 3,
        uuid: Utils.getuuid(),
        Align: 'left',
        label: 'fieldName4',
        label: 'label',
        field: '',
        Hide: 'false',
        IsSort: 'true',
src/utils/utils.js
@@ -302,7 +302,7 @@
   * @return {String} name 存储过程名称
   */
  static dropfunc (name) {
    return `IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID('${name}') AND type in (N'P', N'PC'))  DROP PROCEDURE ${name}`
    return `IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID('${name}') AND type in (N'P', N'PC'))  mdrpk PROCEDURE ${name}`
  }
  /**
@@ -310,9 +310,31 @@
   * @return {String}
   */
  static getfunc (param) {
    param = {
      name: 'ls'
    let form = ''
    if (param.fields && param.fields.length > 0) {
      let _fields = []
      param.fields.forEach(item => {
        if (item.field) {
          _fields.push(item.field)
        }
      })
      let field1 = _fields.join(',')
      let field2 = _fields.join(',@')
      let field3 = _fields.map(cell => {
        return cell + '=@' + cell
      })
      field2 = field2 ? '@' + field2 : ''
      field3 = field3.join(',')
      form = `
        insert into ${param.name} (${field1}) select ${field2},@UserID
        update ${param.name} set ${field3},modifydate=getdate(),modifyuserid=@UserID
      `
    }
    let Ltext = `create proc ${param.name}
    (
    @BID nvarchar(50)='',
@@ -344,11 +366,7 @@
        declare @UserName  nvarchar(50),@FullName nvarchar(50) 
        
        select @UserName=UserName,@FullName=FullName from SUsers where UID=@UserID
        insert into 表名 (表单字段) select 对应入参,创建人
        update 表名 set 表单字段=对应入参,modifydate=getdate(),modifyuserid=@UserID
        ${form}
        if 1=2
        begin
          set @ErrorCode='E'
@@ -388,6 +406,8 @@
      ROLLBACK TRAN
      
    END`
    return Ltext.replace(/\n\s{4}/ig, '\'char(13)\'')
    Ltext = Ltext.replace(/\n\s{4}/ig, 'mchr13k')
    console.log(Ltext)
    return Ltext
  }
}