king
2023-06-14 08cce3334a2dc81d690b518136b0aaea64e48b0b
src/views/mobdesign/popview/index.jsx
@@ -132,8 +132,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)
@@ -151,17 +157,22 @@
  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) => {
@@ -188,7 +199,7 @@
    check(config.components)
    if (show && error) {
    if (config.enabled && error) {
      notification.warning({
        top: 92,
        message: error,
@@ -196,7 +207,7 @@
      })
    }
    return error
    return error === ''
  }
  // 更新配置信息