king
2021-11-18 c98e45bfac25e9110ad0383faac54a54d98ea9d5
src/menu/pastecontroller/index.jsx
@@ -5,7 +5,7 @@
import MenuUtils from '@/utils/utils-custom.js'
import MKEmitter from '@/utils/events.js'
import asyncComponent from '@/utils/asyncComponent'
import './index.scss'
// import './index.scss'
const PasteForm = asyncComponent(() => import('@/templates/zshare/pasteform'))
@@ -18,20 +18,18 @@
    visible: false
  }
  handleMenuClick = () => {
    this.setState({visible: true})
  }
  resetconfig = (item, copyBtns) => {
  resetconfig = (item, copyBtns, uuids = {}) => {
    let appType = sessionStorage.getItem('appType')
    
    if (item.type === 'tabs') {
      item.uuid = MenuUtils.getuuid()
      uuids[item.uuid] = MenuUtils.getuuid()
      item.uuid = uuids[item.uuid]
      item.setting.name = item.setting.name + MenuUtils.getdataName().toUpperCase().substr(-4)
      item.name = item.setting.name
      item.subtabs.forEach(tab => {
        tab.uuid = MenuUtils.getuuid()
        uuids[tab.uuid] = MenuUtils.getuuid()
        tab.uuid = uuids[tab.uuid]
        tab.parentId = item.uuid
        if (appType !== 'mob') {
@@ -43,12 +41,13 @@
          cell.tabId = tab.uuid
          cell.parentId = tab.parentId
          cell = this.resetconfig(cell, copyBtns)
          cell = this.resetconfig(cell, copyBtns, uuids)
          return cell
        })
      })
    } else if (item.type === 'group') {
      item.uuid = MenuUtils.getuuid()
      uuids[item.uuid] = MenuUtils.getuuid()
      item.uuid = uuids[item.uuid]
      item.setting.name = item.setting.name + MenuUtils.getdataName().toUpperCase().substr(-4)
      item.name = item.setting.name
@@ -57,18 +56,18 @@
        cell.tabId = item.tabId || ''
        cell.parentId = item.parentId || ''
        cell = MenuUtils.resetComponentConfig(cell, copyBtns)
        cell = MenuUtils.resetComponentConfig(cell, copyBtns, uuids)
        return cell
      })
    } else {
      item = MenuUtils.resetComponentConfig(item, copyBtns)
      item = MenuUtils.resetComponentConfig(item, copyBtns, uuids)
    }
    return item
  }
  pasteSubmit = () => {
    let options = ['tabs', 'menubar', 'topbar', 'datacard', 'propcard', 'mainsearch', 'stepform', 'tabform', 'balcony', 'group', 'normaltable', 'tablecard', 'line', 'bar', 'pie', 'dashboard', 'scatter']
    let options = ['tabs', 'menubar', 'topbar', 'timeline', 'datacard', 'propcard', 'mainsearch', 'stepform', 'tabform', 'balcony', 'group', 'normaltable', 'tablecard', 'line', 'bar', 'pie', 'dashboard', 'scatter']
    this.pasteFormRef.handleConfirm().then(res => {
      if ((res.copyType === 'menubar' || res.copyType === 'topbar') && sessionStorage.getItem('appType') !== 'mob') {
@@ -110,7 +109,7 @@
    return (
      <div style={{display: 'inline-block'}}>
        <Button className="menu-config-paste" icon="snippets" onClick={() => {this.setState({visible: true})}}>粘贴</Button>
        <Button style={{borderColor: '#40a9ff', color: '#40a9ff'}} icon="snippets" onClick={() => {this.setState({visible: true})}}>粘贴</Button>
        <Modal
          title="粘贴"
          visible={visible}