king
2024-05-08 db731b1d8b3ed1fcce588307b8bd5eccc4f805b2
src/views/mobdesign/popview/index.jsx
@@ -12,7 +12,6 @@
const { Panel } = Collapse
const { confirm } = Modal
const MenuForm = asyncComponent(() => import('./menuform'))
const MobShell = asyncComponent(() => import('@/mob/mobshell'))
const SourceWrap = asyncComponent(() => import('@/mob/modulesource'))
const Modulecell = asyncComponent(() => import('@/menu/modulecell'))
@@ -75,13 +74,13 @@
    const { oriConfig, config } = this.state
    if (!is(fromJS(oriConfig), fromJS(config))) {
      const _this = this
      const that = this
      confirm({
        title: '配置已修改,放弃保存吗?',
        content: '',
        onOk() {
          _this.props.cancel()
          that.props.cancel()
        },
        onCancel() {}
      })
@@ -132,8 +131,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 +156,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 +198,7 @@
    check(config.components)
    if (show && error) {
    if (config.enabled && error) {
      notification.warning({
        top: 92,
        message: error,
@@ -196,7 +206,7 @@
      })
    }
    return error
    return error === ''
  }
  // 更新配置信息
@@ -238,12 +248,6 @@
    this.setState({config})
    window.GLOB.customMenu = config
    notification.success({
      top: 92,
      message: '粘贴成功!',
      duration: 2
    })
  }
  render () {
@@ -260,8 +264,6 @@
            <Collapse accordion defaultActiveKey="component" bordered={false}>
              {/* 基本信息 */}
              <Panel header="基本信息" forceRender className="basedata" key="basedata">
                {/* 菜单信息 */}
                <MenuForm config={config} updateConfig={this.updateConfig}/>
                {/* 表名添加 */}
                <TableComponent config={config} updatetable={this.updateConfig}/>
              </Panel>
@@ -272,8 +274,8 @@
              <Panel header="元素" key="element">
                <Modulecell />
              </Panel>
              <Panel header={'页面样式'} key="background">
                <BgController config={config} updateConfig={this.updateConfig} />
              <Panel header="页面样式" key="background">
                <BgController config={config} type="mob_popview" updateConfig={this.updateConfig} />
              </Panel>
            </Collapse>
          </div>