king
2025-01-13 8e3b4c6dede34e8be6ba47a20ecd9a70576675cf
src/menu/pastecontroller/index.jsx
@@ -5,6 +5,7 @@
import { SnippetsOutlined } from '@ant-design/icons'
import md5 from 'md5'
import Utils from '@/utils/utils.js'
import MenuUtils from '@/utils/utils-custom.js'
import asyncComponent from '@/utils/asyncComponent'
// import './index.scss'
@@ -291,7 +292,7 @@
    }
    this.pasteFormRef.handleConfirm().then(res => {
      if (!res.copyType) {
      if (!res.copyType || (res.copyType === 'components' && this.props.vType !== res.type)) {
        notification.warning({
          top: 92,
          message: '配置信息格式错误!',
@@ -307,6 +308,54 @@
      let menu = fromJS(window.GLOB.customMenu).toJS()
      
      if (res.copyType === 'components') {
        let commonId = Utils.getuuid()
        res.interfaces = res.interfaces.map(inter => {
          inter.uuid = md5(commonId + inter.uuid)
          return inter
        })
        res.components = MenuUtils.resetConfig(res.components, commonId, true)
        if (menu.components.length) {
          if (
            menu.components.findIndex(m => m.type === 'search' || (m.type === 'topbar' && m.wrap.type !== 'navbar')) > -1 &&
            res.components.findIndex(m => m.type === 'search' || (m.type === 'topbar' && m.wrap.type !== 'navbar')) > -1
          ) {
            notification.warning({
              top: 92,
              message: '搜索条件不可重复添加!',
              duration: 5
            })
            return
          }
          if (
            menu.components.findIndex(m => m.type === 'topbar') > -1 &&
            res.components.findIndex(m => m.type === 'topbar') > -1
          ) {
            notification.warning({
              top: 92,
              message: '导航栏不可重复添加!',
              duration: 5
            })
            return
          }
        }
        this.setState({visible: false})
        this.props.insert(res)
        notification.success({
          top: 92,
          message: '粘贴成功!',
          duration: 2
        })
        return
      }
      if (!options.includes(res.copyType)) {
        if (type && types[res.copyType]) {
          notification.warning({