king
2020-09-16 c34bcb0a3054bdab29fbaff17e587c19d7b5de28
src/views/menudesign/index.jsx
@@ -31,7 +31,7 @@
sessionStorage.setItem('isEditState', 'true')
class Mobile extends Component {
class MenuDesign extends Component {
  state = {
    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    MenuId: this.props.match.params.MenuId,
@@ -45,9 +45,12 @@
  }
  UNSAFE_componentWillMount() {
    this.getMenuParam()
    // this.testFunc()
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.state), fromJS(nextState))
  }
  /**
@@ -132,7 +135,7 @@
    }
    param.LText = Utils.formatOptions(param.LText)
    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    param.secretkey = Utils.encrypt(param.LText, param.timestamp)
    if (openEdition) { // 版本管理
@@ -310,8 +313,14 @@
    }
    config.components.forEach(item => {
      if (!error && (!item.setting || !item.setting.dataresource)) {
        error = `组件《${item.setting.name}》未设置数据源`
      if (!error && item.setting) {
        if (item.setting.interType === 'system' && item.setting.execute !== 'false' && !item.setting.dataresource) {
          error = `组件《${item.setting.name}》未设置数据源`
        } else if (item.setting.interType === 'system' && item.setting.execute === 'false' && item.scripts.length === 0) {
          error = `组件《${item.setting.name}》未设置数据源`
        } else if (item.setting.interType && !item.setting.primaryKey) {
          error = `组件《${item.setting.name}》未设置主键`
        }
      }
    })
@@ -397,7 +406,8 @@
                    <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{dict['mob.save']}</Button>
                  </div>
                } style={{ width: '100%' }}>
                  {config && config.components ? <MenuShell config={config} handleList={this.updateConfig} deleteCard={this.deleteCard} /> : null}
                  {/* {config && config.components ? <MenuShell menu={config} handleList={this.updateConfig} deleteCard={this.deleteCard} /> : null} */}
                  {config && config.components ? <MenuShell name="Glass" menu={config} handleList={this.updateConfig} deleteCard={this.deleteCard} /> : null}
                </Card>
              </div>
            </div>
@@ -416,4 +426,4 @@
  return {}
}
export default connect(mapStateToProps, mapDispatchToProps)(Mobile)
export default connect(mapStateToProps, mapDispatchToProps)(MenuDesign)