king
2024-07-06 8e5e35eac41ba16f4b875bbcf07bab3878d8e2e4
src/menu/pastecontroller/index.jsx
@@ -9,6 +9,8 @@
import asyncComponent from '@/utils/asyncComponent'
// import './index.scss'
const { confirm } = Modal
const PasteForm = asyncComponent(() => import('@/templates/zshare/pasteform'))
class PasteController extends Component {
@@ -253,7 +255,7 @@
      options = ['tabs', 'timeline', 'datacard', 'doublecard', 'propcard', 'cardatacard', 'carpropcard', 'simpleform', 'stepform', 'tabform', 'balcony', 'group', 'normaltable', 'tablecard', 'line', 'editor', 'pie', 'scatter', 'iframe', 'sandbox']
  
      if (appType === 'mob') {
        options.push('menubar', 'singleSearch')
        options.push('menubar', 'singleSearch', 'mobnavbar')
        if (sessionStorage.getItem('editMenuType') !== 'popview') {
          options.push('topbar')
        }
@@ -336,6 +338,15 @@
            })
            return
          }
        } else if (res.type === 'navbar') {
          if (menu.components.findIndex(m => m.type === 'navbar') > -1) {
            notification.warning({
              top: 92,
              message: '菜单栏不可重复添加!',
              duration: 5
            })
            return
          }
        }
      } else if (res.type === 'search') {
        if (tab) {
@@ -376,15 +387,45 @@
      this.resetlink(res, commonId)
      
      this.props.insert(res)
      this.setState({visible: false})
      notification.success({
        top: 92,
        message: '粘贴成功!',
        duration: 2
      })
      let skip = true
      if (appType === 'mob' && res.type === 'navbar') {
        let appMenus = sessionStorage.getItem('appViewList')
        if (appMenus) {
          try {
            appMenus = JSON.parse(appMenus)
            appMenus = appMenus.filter(item => item.keys_type === 'navbar')
          } catch (e) {
            appMenus = []
          }
        } else {
          appMenus = []
        }
        if (appMenus.length) {
          const that = this
          skip = false
          confirm({
            title: '如需使用当前应用中已有的菜单栏,请点击右侧关联菜单栏,如需添加请点确定。',
            onOk() {
              that.props.insert(res)
            },
            onCancel() {}
          })
        }
      }
      if (skip) {
        this.props.insert(res)
        notification.success({
          top: 92,
          message: '粘贴成功!',
          duration: 2
        })
      }
    })
  }