king
2022-07-28 639fad34874ff57f1de713a44bf2e796ea35f734
src/views/design/sidemenu/editthdmenu/index.jsx
@@ -3,7 +3,6 @@
import { is, fromJS } from 'immutable'
import { connect } from 'react-redux'
import { DndProvider } from 'react-dnd'
import { withRouter } from 'react-router-dom'
import HTML5Backend from 'react-dnd-html5-backend'
import { notification, Modal, Button } from 'antd'
import moment from 'moment'
@@ -12,7 +11,6 @@
import MKEmitter from '@/utils/events.js'
import MkIcon from '@/components/mk-icon'
import Utils from '@/utils/utils.js'
import MenuUtils from '@/utils/utils-custom.js'
import DragElement from '../menuelement'
import asyncLoadComponent from '@/utils/asyncLoadComponent'
import './index.scss'
@@ -246,68 +244,6 @@
    })
  }
  copyMenu = (param, MenuId) => {
    Api.getSystemConfig({
      func: 'sPC_Get_LongParam',
      MenuID: MenuId
    }).then(result => {
      if (result.status) {
        let config = null
        try {
          config = result.LongParam ? JSON.parse(window.decodeURIComponent(window.atob(result.LongParam))) : null
        } catch (e) {
          console.warn('Parse Failure')
          config = null
        }
        if (config) {
          config.uuid = param.MenuID
          config.MenuID = param.MenuID
          config.parentId = param.ParentID
          config.MenuName = param.MenuName
          config.MenuNo = param.MenuNo
          config.easyCode = ''
          config.components = MenuUtils.resetConfig(config.components)
          config.enabled = false
          param.LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(config)))
        }
        Api.getSystemConfig(param).then(response => {
          if (response.status) {
            this.setState({
              confirmLoading: false,
              handleMVisible: false,
              sysMenu: null
            })
            MKEmitter.emit('mkUpdateMenuList')
            document.getElementById('root').style.overflowY = 'unset'
          } else {
            this.setState({
              confirmLoading: false
            })
            notification.warning({
              top: 92,
              message: response.message,
              duration: 5
            })
          }
        })
      } else {
        this.setState({
          confirmLoading: false
        })
        notification.warning({
          top: 92,
          message: result.message,
          duration: 5
        })
      }
    })
  }
  UNSAFE_componentWillMount () {
    this.setState({
      menulist: this.props.menulist
@@ -375,4 +311,4 @@
  return {}
}
export default withRouter(connect(mapStateToProps, mapDispatchToProps)(EditMenu))
export default connect(mapStateToProps, mapDispatchToProps)(EditMenu)