From f6626b05f1275cc2f8ca77f773d4f6a6af1b0a89 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 21 十一月 2022 16:11:55 +0800 Subject: [PATCH] 2022-11-21 --- src/menu/components/tabs/paste/index.jsx | 26 ++++++++++---------------- 1 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/menu/components/tabs/paste/index.jsx b/src/menu/components/tabs/paste/index.jsx index 5fadf9c..d8ae618 100644 --- a/src/menu/components/tabs/paste/index.jsx +++ b/src/menu/components/tabs/paste/index.jsx @@ -4,7 +4,6 @@ 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' @@ -24,7 +23,7 @@ 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] @@ -36,7 +35,7 @@ tab.uuid = uuids[tab.uuid] tab.components = tab.components.map(cell => { - cell = this.resetconfig(cell, copyBtns, uuids) + cell = this.resetconfig(cell, uuids) return cell }) }) @@ -47,12 +46,12 @@ 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 @@ -60,15 +59,18 @@ pasteSubmit = () => { const { Tab } = this.props - let options = ['tabs', 'group', 'datacard', 'propcard', 'timeline', 'balcony', 'normaltable', 'mainsearch', 'simpleform', 'stepform', 'tabform', 'tablecard', 'line', 'bar', 'pie', 'dashboard', 'scatter', 'chart'] + 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', 'sandbox'] let types = { login: '鐧诲綍', navbar: '瀵艰埅鏍�', topbar: '瀵艰埅鏍�' } - if (sessionStorage.getItem('appType') === 'mob') { + if (appType === 'mob') { options.push('menubar') + } else { + options.push('editable') } this.pasteFormRef.handleConfirm().then(res => { @@ -88,19 +90,11 @@ 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}) -- Gitblit v1.8.0