| | |
| | | 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' |
| | |
| | | } |
| | | |
| | | this.pasteFormRef.handleConfirm().then(res => { |
| | | if (!res.copyType) { |
| | | if (!res.copyType || (res.copyType === 'components' && this.props.vType !== res.type)) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '配置信息格式错误!', |
| | |
| | | |
| | | 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({ |