king
2023-07-25 2a3cc4e6cecfc6dab8b60adf93f7fde898ddc939
src/views/menudesign/popview/index.jsx
@@ -12,7 +12,6 @@
const { Panel } = Collapse
const { confirm } = Modal
const MenuForm = asyncComponent(() => import('./menuform'))
const SourceWrap = asyncComponent(() => import('@/menu/modulesource'))
const Modulecell = asyncComponent(() => import('@/menu/modulecell'))
const MenuShell = asyncComponent(() => import('@/menu/menushell'))
@@ -113,6 +112,7 @@
  completeSave = () => {
    this.setState({
      oriConfig: fromJS(this.state.config).toJS(),
      menuloading: false
    })
  }
@@ -129,8 +129,14 @@
      return
    }
    if (config.enabled && this.verifyConfig()) {
    let _pass = this.verifyConfig(config)
    if (config.enabled && !_pass) {
      config.enabled = false
      config.force = true
    } else if (!config.enabled && config.force && _pass) {
      config.enabled = true
      delete config.force
    }
    this.getMenuMessage(config)
@@ -142,23 +148,28 @@
    window.GLOB.customMenu = config
    this.props.save(config)
    this.props.save(fromJS(config).toJS())
  }
  onEnabledChange = () => {
    const { config } = this.state
    if (!config.enabled && this.verifyConfig(true)) {
      return
    }
    let _config = {...config, enabled: !config.enabled}
    this.setState({
      config: {...config, enabled: !config.enabled}
    })
    delete _config.force
    if (!_config.enabled) {
      this.setState({
        config: _config
      })
    } else if (this.verifyConfig(_config)) {
      this.setState({
        config: _config
      })
    }
  }
  verifyConfig = (show) => {
    const { config } = this.state
  verifyConfig = (config) => {
    let error = ''
    let check = (components) => {
@@ -185,7 +196,7 @@
    check(config.components)
    if (show && error) {
    if (config.enabled && error) {
      notification.warning({
        top: 92,
        message: error,
@@ -193,7 +204,7 @@
      })
    }
    return error
    return error === ''
  }
  // 更新配置信息
@@ -253,8 +264,6 @@
            <Collapse accordion defaultActiveKey="basedata" bordered={false}>
              {/* 基本信息 */}
              <Panel header="基本信息" key="basedata">
                {/* 菜单信息 */}
                <MenuForm config={config} updateConfig={this.updateConfig}/>
                {/* 表名添加 */}
                <TableComponent config={config} updatetable={this.updatetable}/>
              </Panel>