king
2024-07-05 73b2dc5000b03cd150d91e0f6f1d1e3ba82cc97f
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 {
@@ -21,7 +23,12 @@
  }
  resetconfig = (item, appType, commonId) => {
    if (item.type === 'tabs') {
    if (item.type === 'navbar') {
      item.uuid = MenuUtils.getuuid()
      item.menus.forEach(menu => {
        menu.MenuID = MenuUtils.getuuid()
      })
    } else if (item.type === 'tabs') {
      item.uuid = md5(commonId + item.uuid)
      item.setting.name = (item.setting.name || '') + MenuUtils.getSignName()
      item.name = item.setting.name
@@ -253,7 +260,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 +343,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 +392,45 @@
      this.resetlink(res, commonId)
      
      this.props.insert(res)
      this.setState({visible: false})
      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
      })
      }
    })
  }