| | |
| | | import { SnippetsOutlined } from '@ant-design/icons' |
| | | |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | // import './index.scss' |
| | | |
| | |
| | | this.setState({visible: true}) |
| | | } |
| | | |
| | | resetconfig = (item, copyBtns, uuids = {}) => { |
| | | resetconfig = (item, uuids = {}) => { |
| | | if (item.type === 'tabs') { |
| | | uuids[item.uuid] = MenuUtils.getuuid() |
| | | item.uuid = uuids[item.uuid] |
| | |
| | | tab.uuid = uuids[tab.uuid] |
| | | |
| | | tab.components = tab.components.map(cell => { |
| | | cell = this.resetconfig(cell, copyBtns, uuids) |
| | | cell = this.resetconfig(cell, uuids) |
| | | return cell |
| | | }) |
| | | }) |
| | |
| | | item.name = item.setting.name |
| | | |
| | | item.components = item.components.map(cell => { |
| | | cell = MenuUtils.resetComponentConfig(cell, copyBtns, uuids) |
| | | cell = MenuUtils.resetComponentConfig(cell, uuids) |
| | | |
| | | return cell |
| | | }) |
| | | } else { |
| | | item = MenuUtils.resetComponentConfig(item, copyBtns, uuids) |
| | | item = MenuUtils.resetComponentConfig(item, uuids) |
| | | } |
| | | |
| | | return item |
| | |
| | | |
| | | pasteSubmit = () => { |
| | | const { Tab } = this.props |
| | | let appType = sessionStorage.getItem('appType') |
| | | let options = ['tabs', 'group', 'datacard', 'propcard', 'timeline', 'balcony', 'normaltable', 'mainsearch', 'simpleform', 'stepform', 'tabform', 'tablecard', 'line', 'bar', 'pie', 'dashboard', 'scatter', 'chart'] |
| | | let types = { |
| | | login: '登录', |
| | |
| | | topbar: '导航栏' |
| | | } |
| | | |
| | | if (sessionStorage.getItem('appType') === 'mob') { |
| | | if (appType === 'mob') { |
| | | options.push('menubar') |
| | | } else { |
| | | options.push('editable') |
| | | } |
| | | |
| | | this.pasteFormRef.handleConfirm().then(res => { |
| | |
| | | return |
| | | } |
| | | |
| | | let copyBtns = new Map() |
| | | |
| | | res = this.resetconfig(res, copyBtns, {}) |
| | | res = this.resetconfig(res, {}) |
| | | |
| | | delete res.copyType |
| | | |
| | | this.props.insert(res, Tab) |
| | | |
| | | copyBtns = [...copyBtns.values()] |
| | | |
| | | if (copyBtns.length > 0) { |
| | | MKEmitter.emit('copyButtons', copyBtns) |
| | | } |
| | | |
| | | this.setState({visible: false}) |
| | | |