From f07c42a322f41e14ef5b1bf8f2fd66fc5d338cdd Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 28 六月 2023 18:17:09 +0800 Subject: [PATCH] 2023-06-28 --- src/menu/components/group/paste/index.jsx | 27 ++++++++++----------------- 1 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/menu/components/group/paste/index.jsx b/src/menu/components/group/paste/index.jsx index 7c5e52a..2660dd7 100644 --- a/src/menu/components/group/paste/index.jsx +++ b/src/menu/components/group/paste/index.jsx @@ -1,9 +1,9 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Icon, Modal, notification } from 'antd' +import { Modal, notification } from 'antd' +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' @@ -18,12 +18,9 @@ visible: false } - handleMenuClick = () => { - this.setState({visible: true}) - } - pasteSubmit = () => { - let options = ['datacard', 'propcard', 'balcony', 'timeline', 'stepform', 'tabform', 'normaltable', 'tablecard', 'line', 'bar', 'pie', 'dashboard', 'scatter', 'chart'] + let appType = sessionStorage.getItem('appType') + let options = ['datacard', 'propcard', 'balcony', 'timeline', 'simpleform', 'stepform', 'tabform', 'normaltable', 'tablecard', 'editor', 'line', 'bar', 'pie', 'scatter', 'sandbox'] let types = { login: '鐧诲綍', navbar: '瀵艰埅鏍�', @@ -33,6 +30,10 @@ mainsearch: '鎼滅储', group: '鍒嗙粍', menubar: '鑿滃崟' + } + + if (appType !== 'mob') { + options.push('editable', 'antvG6', 'antvX6', 'tree', 'dashboard', 'chart') } this.pasteFormRef.handleConfirm().then(res => { @@ -52,19 +53,11 @@ return } - let copyBtns = new Map() - - res = MenuUtils.resetComponentConfig(res, copyBtns) + res = MenuUtils.resetComponentConfig(res, appType) delete res.copyType this.props.insert(res) - - copyBtns = [...copyBtns.values()] - - if (copyBtns.length > 0) { - MKEmitter.emit('copyButtons', copyBtns) - } this.setState({visible: false}) @@ -81,7 +74,7 @@ return ( <div style={{display: 'inline-block'}}> - <Icon type="snippets" style={{color: 'purple'}} onClick={() => {this.setState({visible: true})}} /> + <SnippetsOutlined style={{color: 'purple'}} onClick={() => {this.setState({visible: true})}} /> <Modal title="绮樿创" visible={visible} -- Gitblit v1.8.0