king
2020-01-22 c54724b0590729c677057736bd2d04715dc0c3fb
src/templates/modalconfig/index.jsx
@@ -28,9 +28,9 @@
  static propTpyes = {
    menu: PropTypes.any,
    editTab: PropTypes.any,
    btnParam: PropTypes.object,
    subConfig: PropTypes.any,
    editAction: PropTypes.object,
    handleConfig: PropTypes.func
    handleView: PropTypes.func
  }
  state = {
@@ -64,10 +64,10 @@
   * 4、设置按钮基本信息
   */
  UNSAFE_componentWillMount () {
    const {menu, editAction, editTab, btnParam} = this.props
    const {menu, editAction, editTab, subConfig} = this.props
    let _config = ''
    let _menu = {
    let _menu = { // 上级菜单是三级菜单或标签页
      type: editTab ? editTab.Template : menu.type,
      tables: editTab ? editTab.tables : menu.LongParam.tables,
      MenuID: editTab ? editTab.uuid : menu.MenuID,
@@ -75,8 +75,8 @@
      MenuName: editTab ? editTab.tabName : menu.MenuName
    }
    if (btnParam) {
      _config = btnParam
    if (subConfig) {
      _config = subConfig
    } else {
      _config = JSON.parse(JSON.stringify((Source.baseConfig)))
    }
@@ -208,9 +208,23 @@
   * @description 组件销毁,清除state更新
   */
  componentWillUnmount () {
    this.setState = (state, callback) => {
    this.setState = () => {
      return
    }
  }
  // 页面返回
  handleViewBack = () => {
    const {menu, editTab} = this.props
    let param = {
      editMenu: menu,
      editTab: editTab,
      editAction: '',
      subConfig: '',
      tabview: editTab ? editTab.Template : menu.LongParam.Template
    }
    this.props.handleView(param)
  }
  /**
@@ -733,7 +747,7 @@
  }
  cancelConfig = () => {
    const { menu, config, originConfig } = this.state
    const { config, originConfig } = this.state
    let _this = this
    let isOrigin = config.fields.filter(item => item.origin).length > 0
@@ -743,7 +757,7 @@
        okText: this.state.dict['header.confirm'],
        cancelText: this.state.dict['header.cancel'],
        onOk() {
          _this.props.handleConfig(menu.type)
          _this.handleViewBack()
        },
        onCancel() {}
      })
@@ -754,7 +768,7 @@
          closeVisible: true
        })
      } else {
        this.props.handleConfig(menu.type)
        this.handleViewBack()
      }
    }
  }
@@ -1138,7 +1152,7 @@
  }
  render () {
    const { menu, config } = this.state
    const { config } = this.state
    return (
      <div className="modal-form-board">
@@ -1313,7 +1327,7 @@
          onCancel={() => { this.setState({closeVisible: false}) }}
          footer={[
            <Button key="save" className="mk-btn mk-green" loading={this.state.closeloading} onClick={this.submitConfig}>{this.state.dict['header.save']}</Button>,
            <Button key="confirm" className="mk-btn mk-yellow" onClick={() => {this.props.handleConfig(menu.type)}}>{this.state.dict['header.notsave']}</Button>,
            <Button key="confirm" className="mk-btn mk-yellow" onClick={this.handleViewBack}>{this.state.dict['header.notsave']}</Button>,
            <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>{this.state.dict['header.cancel']}</Button>
          ]}
          destroyOnClose