king
2020-01-22 c54724b0590729c677057736bd2d04715dc0c3fb
2020-01-22
8个文件已修改
461 ■■■■ 已修改文件
src/api/index.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sidemenu/editthdmenu/index.jsx 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/en-US/comtable.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/zh-CN/comtable.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.jsx 193 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/source.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.jsx 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/index.jsx 85 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js
@@ -26,10 +26,10 @@
})
const setCurrentUrl = () => {
  // if (!!(window.history && window.history.pushState)) {
  //   window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login')
  //   window.location.reload()
  // }
  if (!!(window.history && window.history.pushState)) {
    window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login')
    window.location.reload()
  }
}
let GlobMap = new Map()
src/components/sidemenu/editthdmenu/index.jsx
@@ -41,23 +41,24 @@
  state = {
    dict: (!localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN') ? zhCN : enUS,
    thawmenulist: null,    // 已冻结的二级菜单
    type: '',              // 操作类型,新建或编辑菜单
    tabview: '',           // 选择模板窗口(template)、基础表格配置(CommonTable)、表单(Modal)、子表(SubTable)
    editMenu: null,        // 编辑菜单
    editAction: null,      // 编辑按钮
    editTab: null,         // 编辑标签
    thawMvisible: false,   // 解除冻结模态框
    confirmLoading: false, // 提交中。。。
    selectTemp: '',        // 选择模板
    usedTemplates: null,   // 已使用模板列表
    tempSearchKey: '',     // 菜单名称过滤值
    loading: false,        // 编辑菜单或使用已使用模板时,获取配置信息
    preview: null,         // 图片预览url
    pretemplate: null,     // 预览模板
    btnParam: null,        // 编辑按钮的配置信息
    menulist: null,        // 编辑中的菜单
    sysTemplates: sysTemps // 系统模板
    thawmenulist: null,     // 已冻结的二级菜单
    type: '',               // 操作类型,新建或编辑菜单
    thawMvisible: false,    // 解除冻结模态框
    confirmLoading: false,  // 提交中。。。
    selectTemp: '',         // 选择模板
    usedTemplates: null,    // 已使用模板列表
    tempSearchKey: '',      // 菜单名称过滤值
    loading: false,         // 编辑菜单或使用已使用模板时,获取配置信息
    preview: null,          // 图片预览url
    pretemplate: null,      // 预览模板
    btnParam: null,         // 编辑按钮的配置信息
    menulist: null,         // 编辑中的菜单
    sysTemplates: sysTemps, // 系统模板
    tabview: '',            // 选择模板窗口(template)、基础表格配置(CommonTable)、表单(Modal)、子表(SubTable)
    editMenu: null,         // 编辑菜单
    editAction: null,       // 编辑按钮
    editTab: null,          // 编辑标签
    subConfig: null         // 子配置信息
  }
  /**
@@ -177,7 +178,19 @@
        })
        return
      }
      this.setState({tabview: 'template', type: 'add'})
      this.setState({
        tabview: 'template',
        editMenu: {
          MenuID: '',
          MenuName: '',
          MenuNo: '',
          type: '',
          PageParam: '',
          LongParam: '',
          isSubtable: '', // 是否为主子表
          ParentID: this.props.supMenu.MenuID
        }
      })
      document.getElementById('root').style.overflowY = 'hidden'
    } else if (type === 'thaw') {
      if (!is(fromJS(this.props.menulist), fromJS(this.state.menulist))) {
@@ -325,8 +338,13 @@
    })
  }
  /**
   * @description 使用模板
   * 1、使用系统模板时,使用系统配置
   * 2、使用已有菜单模板时,获取菜单配置信息,标记为user(复制菜单按钮)
   */
  useTemplate = (template, useType) => {
    const { type, editMenu } = this.state
    const { editMenu } = this.state
    new Promise(resolve => {
      if (useType === 'sys') {
@@ -375,41 +393,30 @@
        })
      }
    }).then(res => {
      if (!res) {
      if (!res) { // 错误时,重置状态
        this.setState({
          loading: false
        })
        return
      }
      // 选择模板:添加菜单时
      if (type === 'add') {
        this.setState({
          tabview: template.type,
          loading: false,
          editMenu: {
            MenuID: Utils.getuuid(),
            MenuName: '',
            MenuNo: '',
            id: this.props.menulist.length,
            src: '',
            text: '',
            type: template.type,
            PageParam: {OpenType: 'newtab', Template: template.type},
            LongParam: template.baseconfig,
            isSubtable: template.isSubtable, // 是否为主子表
            ParentID: this.props.supMenu.MenuID
          }
        })
      } else {
        let _PageParam = {OpenType: editMenu.PageParam.OpenType || 'newtab', Template: template.type}
        this.setState({
          loading: false,
          tabview: template.type,
          editMenu: {...editMenu, LongParam: template.baseconfig, PageParam: _PageParam, type: template.type}
        })
      // 选择模板:添加菜单时(不存在menuId)
      let _PageParam = {
        OpenType: editMenu.PageParam ? editMenu.PageParam.OpenType : 'newtab',
        Template: template.type
      }
      this.setState({
        loading: false,
        tabview: template.type,
        editMenu: {
          ...editMenu,
          type: template.type,
          PageParam: _PageParam,
          LongParam: template.baseconfig,
          isSubtable: template.isSubtable
        }
      })
      document.getElementById('root').style.overflowY = 'hidden'
    })
  }
@@ -444,8 +451,17 @@
    }
  }
  tabHandleConfig = () => {
  handleView = (param) => {
    this.setState({
      tabview: ''
    }, () => {
      if (param) {
        this.setState(param)
        document.getElementById('root').style.overflowY = 'hidden'
      } else {
        document.getElementById('root').style.overflowY = 'unset'
      }
    })
  }
  handleSubConfig = (item, originMenu, config, type) => {
@@ -636,12 +652,10 @@
        </div>}
        {this.state.tabview === 'CommonTable' &&
          <ComTableConfig
            type={this.state.type}
            menu={this.state.editMenu}
            supMenuList={this.props.supMenuList}
            handleConfig={this.handleConfig}
            reloadmenu={() => {this.props.reload()}}
            handleSubConfig={this.handleSubConfig}
            handleView={this.handleView}
          />
        }
        {this.state.tabview === 'Modal' &&
@@ -649,16 +663,16 @@
            menu={this.state.editMenu}
            editTab={this.state.editTab}
            editAction={this.state.editAction}
            btnParam={this.state.btnParam}
            handleConfig={this.handleConfig}
            subConfig={this.state.subConfig}
            handleView={this.handleView}
          />
        }
        {this.state.tabview === 'SubTable' &&
          <SubTable
            config={this.state.editTab}
            menu={this.state.editMenu}
            handleConfig={this.handleConfig}
            handleSubConfig={this.handleSubConfig}
            editTab={this.state.editTab}
            config={this.state.subConfig}
            handleView={this.handleView}
          />
        }
        {this.state.tabview === 'FormTab' &&
src/locales/en-US/comtable.js
@@ -17,6 +17,8 @@
  'header.menu.table.add': 'Add tables',
  'header.menu.table.placeholder': 'Please select a table',
  'header.menu.config.placeholder': 'Configuration has been modified, do you want to save configuration information ?',
  'header.menu.config.notsave': '菜单尚未保存,请保存菜单配置!',
  'header.menu.config.update': '菜单配置已修改,请保存!',
  'header.menu.form': 'The form',
  'header.menu.form.add': 'Add form',
  'header.menu.form.configurable': 'Configuration of forms',
@@ -116,6 +118,8 @@
  'header.form.popform': '弹窗(表单)',
  'header.form.popview': '弹窗(页面)',
  'header.form.tab': '标签页',
  'header.form.linkTab': '关联标签',
  'header.form.subTab': '下级标签',
  'header.form.currenttab': '当前菜单',
  'header.form.excelIn': 'Excel导入',
  'header.form.excelOut': 'Excel导出',
src/locales/zh-CN/comtable.js
@@ -17,6 +17,8 @@
  'header.menu.table.add': '添加表名',
  'header.menu.table.placeholder': '请选择表名',
  'header.menu.config.placeholder': '配置已修改,是否保存配置信息?',
  'header.menu.config.notsave': '菜单尚未保存,请保存菜单配置!',
  'header.menu.config.update': '菜单配置已修改,请保存!',
  'header.menu.form': '表单',
  'header.menu.form.add': '添加表单',
  'header.menu.form.configurable': '表单配置',
@@ -116,6 +118,8 @@
  'header.form.popform': '弹窗(表单)',
  'header.form.popview': '弹窗(页面)',
  'header.form.tab': '标签页',
  'header.form.linkTab': '关联标签',
  'header.form.subTab': '下级标签',
  'header.form.currenttab': '当前菜单',
  'header.form.excelIn': '导入Excel',
  'header.form.excelOut': '导出Excel',
src/templates/comtableconfig/index.jsx
@@ -36,12 +36,10 @@
class ComTableConfig extends Component {
  static propTpyes = {
    type: PropTypes.string,
    menu: PropTypes.any,
    supMenuList: PropTypes.array,
    reloadmenu: PropTypes.func,
    handleConfig: PropTypes.func,
    handleSubConfig: PropTypes.func,
    supMenuList: PropTypes.array
    handleView: PropTypes.func
  }
  state = {
@@ -79,7 +77,7 @@
   */
  UNSAFE_componentWillMount () {
    const { menu } = this.props
    console.log(menu)
    let _LongParam = menu.LongParam
    let _config = ''
@@ -91,6 +89,12 @@
    } else {
      _config = _LongParam
    }
    // 配置默认值,兼容
    _config.tabs = _config.tabs || []
    _config.tabgroups = _config.tabgroups || ['tabs']
    _config.setting.subtabs = _config.setting.subtabs || []
    _config.Template = 'CommonTable'
    
    let _oriActions = []
    if (_config.type === 'user') {
@@ -106,14 +110,18 @@
        }
        item.uuid = uuid
        return item
      })
    }
    _config.tabs = _config.tabs || []
    _config.tabgroups = _config.tabgroups || ['tabs']
    _config.setting.subtabs = _config.setting.subtabs || []
      // 重置标签ID
      _config.tabgroups.forEach(group => {
        _config[group] = _config[group].map(tab => {
          tab.uuid = Utils.getuuid()
          return tab
        })
      })
    }
    this.setState({
      config: _config,
@@ -438,7 +446,7 @@
        {
          type: 'select',
          key: 'linkTab',
          label: '关联标签',
          label: this.state.dict['header.form.linkTab'],
          initVal: card.linkTab || '',
          required: false,
          options: []
@@ -469,7 +477,7 @@
        {
          type: 'mutilselect',
          key: 'subtabs',
          label: '下级标签',
          label: this.state.dict['header.form.subTab'],
          initVal: subtabs,
          required: false,
          options: menus
@@ -1271,7 +1279,7 @@
   * @description 三级菜单切换模板
   */
  changeTemplate = () => {
    this.props.handleConfig('template')
    this.props.handleView({tabview: 'template'})
  }
  /**
@@ -1579,7 +1587,7 @@
          duration: 2
        })
        if (this.state.closeVisible) {
          this.props.handleConfig('')
          this.props.handleView()
        } else {
          this.setState({
            menuloading: false,
@@ -1620,7 +1628,7 @@
        okText: this.state.dict['header.confirm'],
        cancelText: this.state.dict['header.cancel'],
        onOk() {
          _this.props.handleConfig('')
          _this.props.handleView()
        },
        onCancel() {}
      })
@@ -1642,7 +1650,7 @@
            closeVisible: true
          })
        } else {
          this.props.handleConfig('')
          this.props.handleView()
        }
      }, () => {
        this.setState({
@@ -1973,25 +1981,14 @@
  /**
   * @description 设置可配置按钮
   */
  setSubConfig = (btn, type) => {
  setSubConfig = (item, type) => {
    const { menu } = this.props
    const { config, originMenu } = this.state
    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) ||
      (config.tabs[0] && config.tabs[0].origin)
    ) {
      isAdd = true
    }
    if (isAdd) {
    if (!originMenu.MenuID) { // menuID不存在时,为新建菜单,提示菜单尚未保存
      notification.warning({
        top: 92,
        message: '菜单尚未保存,请保存菜单配置!',
        message: this.state.dict['header.menu.config.notsave'],
        duration: 10
      })
    } else {
@@ -2007,74 +2004,88 @@
          ParentID: res.parentId
        }
        if (!is(fromJS(originMenu), fromJS(_originMenu))) {
        if (!is(fromJS(originMenu), fromJS(_originMenu))) { // 菜单信息变化时,提示保存
          notification.warning({
            top: 92,
            message: '菜单配置已修改,请保存!',
            message: this.state.dict['header.menu.config.update'],
            duration: 10
          })
        } else {
          this.setState({
            loading: true
          })
          let uuid = ''
          let _type = type
          if (type === 'button' && btn.OpenType === 'popview') {
            _type = 'tab'
          } else if (type === 'button' && (btn.OpenType === 'tab' || btn.OpenType === 'blank')) {
            _type = 'tabview'
          }
          if (_type === 'tab') {
            uuid = btn.linkTab
          } else {
            uuid = btn.uuid
          }
          Api.getSystemConfig({
            func: 'sPC_Get_LongParam',
            MenuID: uuid
          }).then(res => {
            if (res.status) {
              this.setState({
                loading: false
              })
              let _LongParam = ''
              if (res.LongParam) {
                _LongParam = window.decodeURIComponent(window.atob(res.LongParam))
                try {
                  _LongParam = JSON.parse(_LongParam)
                } catch (e) {
                  _LongParam = ''
                }
              }
              if (_type === 'tab' && !_LongParam) {
                _LongParam = {
                  ...btn,
                  uuid: btn.linkTab,
                  create: true
                }
              }
              this.props.handleSubConfig(btn, originMenu, _LongParam, _type)
            } else {
              this.setState({
                loading: false
              })
              notification.warning({
                top: 92,
                message: res.message,
                duration: 10
              })
            }
          })
          return
        }
        console.log(item)
        // 菜单信息验证通过后,跳转子配置页面
        let _view = ''
        let uuid = item.uuid
        let isbutton = true
        if (type === 'button' && item.OpenType === 'pop') {
          _view = 'Modal'             // 表单页面
        } else if (type === 'button' && (item.OpenType === 'tab' || item.OpenType === 'blank')) {
          _view = item.tabTemplate    // 新标签页模板
        } else if (type === 'button' && item.OpenType === 'popview') {
          _view = item.tabType        // 新弹窗标签模板
          uuid = item.linkTab
          isbutton = false
        } else if (type === 'tab') {
          _view = item.type           // 标签模板
          uuid = item.linkTab
          isbutton = false
        }
        let param = {
          editMenu: _originMenu,
          editTab: !isbutton ? item : '',
          editAction: isbutton ? item : '',
          subConfig: '',
          tabview: _view
        }
        this.setState({
          loading: true
        })
        Api.getSystemConfig({
          func: 'sPC_Get_LongParam',
          MenuID: uuid
        }).then(res => {
          if (res.status) {
            this.setState({
              loading: false
            })
            let _LongParam = ''
            if (res.LongParam) {
              _LongParam = window.decodeURIComponent(window.atob(res.LongParam))
              try {
                _LongParam = JSON.parse(_LongParam)
              } catch (e) {
                _LongParam = ''
              }
            }
            if (_LongParam && param.tabview === 'Modal' && _LongParam.type === 'Modal') {
              param.subConfig = _LongParam
            } else if (_LongParam && param.tabview === 'FormTab' && _LongParam.type === 'FormTab') {
              param.subConfig = _LongParam
            } else if (_LongParam && param.tabview === 'SubTable' && _LongParam.Template === 'SubTable') {
              param.subConfig = _LongParam
            }
            this.props.handleView(param)
          } else {
            this.setState({
              loading: false
            })
            notification.warning({
              top: 92,
              message: res.message,
              duration: 10
            })
          }
        })
      }, () => {
        notification.warning({
          top: 92,
          message: '菜单基本信息已修改,请保存!',
          message: this.state.dict['header.menu.config.update'],
          duration: 10
        })
      })
@@ -2186,7 +2197,7 @@
      }
      Api.getSystemConfig(_param)
    })
    this.props.handleConfig('')
    this.props.handleView()
  }
  render () {
src/templates/comtableconfig/source.jsx
@@ -7,6 +7,7 @@
class CommonTableBaseData {
  baseConfig = {
    type: 'system',
    Template: 'CommonTable',
    enabled: false,
    setting: {
      actionfixed: false,
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
src/templates/subtableconfig/index.jsx
@@ -34,9 +34,9 @@
class SubTableConfig extends Component {
  static propTpyes = {
    config: PropTypes.object,
    menu: PropTypes.any,
    handleConfig: PropTypes.func,
    editTab: PropTypes.any,
    config: PropTypes.any,
    handleSubConfig: PropTypes.func,
    supMenuList: PropTypes.array
  }
@@ -78,25 +78,24 @@
   * 2、设置操作类型、原始菜单信息(每次保存后重置)、已使用表及基本信息表单
   */
  UNSAFE_componentWillMount () {
    const { config } = this.props
    const { config, editTab } = this.props
    let _config = null
    if (!config || config.create) {
    if (!config) {
      _config = JSON.parse(JSON.stringify(Source.baseConfig))
      if (config.uuid) {
        _config.uuid = config.uuid
        _config.tabName = config.label
      }
      _config.uuid = editTab.linkTab
      _config.tabName = editTab.label
      _config.isAdd = true
    } else {
      _config = JSON.parse(JSON.stringify(config))
    }
    
    let _oriActions = []
    if (_config.type === 'user') {
      _config.action = _config.action.map(item => {
        let uuid = Utils.getuuid()
        if (item.OpenType === 'pop') { // 含有子配置项的按钮
          _oriActions.push({
            prebtn: JSON.parse(JSON.stringify(item)),
@@ -106,7 +105,6 @@
        }
        item.uuid = uuid
        return item
      })
    }
@@ -267,6 +265,20 @@
    this.setState = (state, callback) => {
      return
    }
  }
  // 页面返回
  handleViewBack = () => {
    const {menu} = this.props
    let param = {
      editMenu: menu,
      editTab: '',
      editAction: '',
      subConfig: '',
      tabview: menu ? menu.LongParam.Template : ''
    }
    this.props.handleView(param)
  }
  /**
@@ -1081,27 +1093,25 @@
    })
  }
  // changeTemplate = () => {
  //   this.props.handleConfig('template')
  // }
  /**
   * @description 标签页保存
   */
  submitConfig = () => {
    const { delActions } = this.state
    const { delActions, originConfig } = this.state
    let config = JSON.parse(JSON.stringify(this.state.config))
    this.menuformRef.handleConfirm().then(res => {
      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)
      if (originConfig.isAdd) {
        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 = ''
@@ -1109,6 +1119,7 @@
      // 保存时删除配置类型,system 、user
      delete _config.type
      delete _config.isAdd
      try {
        _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_config)))
@@ -1123,6 +1134,7 @@
      let btnParam = {
        func: 'sPC_Button_AddUpt',
        Type: 40,
        ParentID: _config.uuid,
        MenuNo: res.tabNo,
        Template: 'SubTable',
@@ -1323,8 +1335,7 @@
          duration: 2
        })
        if (this.state.closeVisible) {
          let view = this.props.menu ? this.props.menu.type : ''
          this.props.handleConfig(view)
          this.handleViewBack()
        } else {
          this.setState({
            menuloading: false,
@@ -1344,24 +1355,14 @@
    const { config, originConfig } = this.state
    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) {
    if (originConfig.isAdd) {
      confirm({
        content: '菜单尚未提交,确定放弃保存吗?',
        okText: this.state.dict['header.confirm'],
        cancelText: this.state.dict['header.cancel'],
        onOk() {
          let view = _this.props.menu ? _this.props.menu.type : ''
          _this.props.handleConfig(view)
          _this.handleViewBack()
        },
        onCancel() {}
      })
@@ -1374,8 +1375,7 @@
            closeVisible: true
          })
        } else {
          let view = this.props.menu ? this.props.menu.type : ''
          this.props.handleConfig(view)
          this.handleViewBack()
        }
      }, () => {
        this.setState({
@@ -1781,11 +1781,6 @@
    })
  }
  dontsave = () => {
    let view = this.props.menu ? this.props.menu.type : ''
    this.props.handleConfig(view)
  }
  render () {
    const { modaltype } = this.state
    const configAction = this.state.config.action.filter(_action =>
@@ -2105,7 +2100,7 @@
          onCancel={() => { this.setState({closeVisible: false}) }}
          footer={[
            <Button key="save" className="mk-btn mk-green" loading={this.state.menucloseloading} onClick={this.submitConfig}>{this.state.dict['header.save']}</Button>,
            <Button key="confirm" className="mk-btn mk-yellow" onClick={this.dontsave}>{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