king
2020-12-25 5232d34f026f72eb90a5ba6fff33d30cf9d961aa
src/menu/popview/index.jsx
@@ -11,6 +11,7 @@
import Utils from '@/utils/utils.js'
import zhCN from '@/locales/zh-CN/mob.js'
import enUS from '@/locales/en-US/mob.js'
import MKEmitter from '@/utils/events.js'
import asyncComponent from '@/utils/asyncComponent'
import { modifyCustomMenu } from '@/store/action'
@@ -58,6 +59,10 @@
    })
  }
  componentDidMount () {
    MKEmitter.addListener('delButtons', this.delButtons)
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.state), fromJS(nextState))
  }
@@ -69,6 +74,11 @@
    this.setState = () => {
      return
    }
    MKEmitter.removeListener('delButtons', this.delButtons)
  }
  delButtons = (items) => {
    this.setState({delButtons: [...this.state.delButtons, ...items]})
  }
  closeView = () => {
@@ -98,7 +108,8 @@
  }
  getMenuParam = () => {
    const { MenuId, MenuType } = this.state
    const { btn } = this.props
    const { MenuId } = this.state
    let param = {
      func: 'sPC_Get_LongParam',
@@ -123,18 +134,19 @@
            MenuID: MenuId,
            Template: 'CustomPage',
            enabled: false,
            MenuName: btn.config.MenuName + '-' + btn.label,
            MenuNo: '',
            tables: [],
            components: [],
            viewType: 'popview',
            style: {
              backgroundColor: '#ffffff', backgroundImage: '',
              paddingTop: '16px', paddingBottom: '80px', paddingLeft: '16px', paddingRight: '16px'
            },
            MenuType: MenuType
          }
        } else {
          config.uuid = MenuId
          config.MenuID = MenuId
          config.MenuType = config.MenuType || MenuType
        }
        this.setState({
@@ -225,11 +237,10 @@
  }
  submitConfig = () => {
    // const { btn } = this.props
    const { openEdition, delButtons } = this.state
    let config = fromJS(this.state.config).toJS()
    if (config.cacheUseful === 'true' && !config.cacheTime) {
    if ((config.cacheUseful === 'true' && !config.cacheTime) || !config.MenuNo || !config.MenuName) {
      notification.warning({
        top: 92,
        message: '请完善菜单基本信息!',
@@ -250,9 +261,9 @@
    let param = {
      func: 'sPC_Tab_AddUpt',
      MenuID: _config.uuid,
      MenuNo: _config.tabNo,
      MenuNo: _config.MenuNo,
      Template: 'CustomPage',
      MenuName: _config.tabName,
      MenuName: _config.MenuName,
      Remark: '',
      Sort: 0,
      PageParam: JSON.stringify({Template: 'CustomPage'}),
@@ -265,7 +276,7 @@
    let btnParam = {             // 添加菜单按钮
      func: 'sPC_Button_AddUpt',
      Type: 40,                  // 添加菜单下的按钮type为40,按钮下的按钮type为60
      Type: 60,                  // 添加菜单下的按钮type为40,按钮下的按钮type为60
      ParentID: _config.uuid,
      MenuNo: _config.MenuNo,
      Template: 'CustomPage',