king
2022-02-22 de516477e7c11d667b3d77f6a37b5df8e893bd29
src/views/mobdesign/index.jsx
@@ -1102,13 +1102,17 @@
      let roleParam = {type: 'view', key: config.uuid, title: config.MenuName, children: []}
      roleParam.children = this.getMenuMessage()
      config.loginview = false
      config.tabview = false
      if (config.components.findIndex(item => item.type === 'login') > -1) {
        roleParam.login = true
        config.loginview = true
      } else {
        config.loginview = false
      }
      config.components.forEach(item => {
        if (item.type === 'login') {
          roleParam.login = true
          config.loginview = true
        } else if (item.type === 'navbar') {
          config.tabview = true
        }
      })
      if (adapters.includes('wxmini')) {
        config = this.getMiniStyle(config)
@@ -1402,6 +1406,7 @@
          swipes.push(item.name)
        }
        if (['voucher'].includes(item.subtype)) return
        if (['propcard', 'brafteditor', 'sandbox', 'tabbar', 'stepform', 'tabform'].includes(item.subtype) && item.wrap.datatype === 'static') return
        if (['balcony'].includes(item.type) && item.wrap.datatype === 'static') return
        if (['menubar'].includes(item.type) && item.wrap.datatype !== 'dynamic') return
@@ -1464,14 +1469,28 @@
  insert = (item) => {
    let config = fromJS(this.state.config).toJS()
    if (item.type === 'topbar' && config.components.findIndex(m => m.type === 'topbar') > -1) {
    if (item.type === 'search') {
      notification.warning({
        top: 92,
        message: '导航栏不可重复添加!',
        message: '移动端搜索组件不可粘贴!',
        duration: 5
      })
      return
    }
    if (item.type === 'topbar') {
      if (config.components.findIndex(m => m.type === 'topbar') > -1) {
        notification.warning({
          top: 92,
          message: '导航栏不可重复添加!',
          duration: 5
        })
        return
      }
      if (!config.style.paddingTop) {
        config.style.paddingTop = '50px'
      }
    }
    config.components.push(item)