From 54fc813f586fda01f823ea32f796027809d3e11b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 15 三月 2023 17:22:33 +0800 Subject: [PATCH] 2023-03-15 --- src/menu/components/share/pastecomponent/index.jsx | 43 ++++++++++--------------------------------- 1 files changed, 10 insertions(+), 33 deletions(-) diff --git a/src/menu/components/share/pastecomponent/index.jsx b/src/menu/components/share/pastecomponent/index.jsx index b0c79bb..477e3e0 100644 --- a/src/menu/components/share/pastecomponent/index.jsx +++ b/src/menu/components/share/pastecomponent/index.jsx @@ -21,19 +21,8 @@ visible: false } - handleMenuClick = () => { - this.setState({visible: true}) - } - - resetconfig = (item, copyBtns, config) => { + resetconfig = (item, config) => { let _uuid = Utils.getuuid() - - if (item.OpenType === 'popview') { - let _cell = fromJS(item).toJS() - _cell.$originUuid = _cell.uuid - _cell.uuid = _uuid - copyBtns.set(_uuid, _cell) - } if (item.uuid) { item.uuid = _uuid @@ -109,14 +98,7 @@ }) } else if (_item.type === 'action' && _item.elements) { _item.elements = _item.elements.map(cell => { - let _uuid = Utils.getuuid() - if (cell.OpenType === 'popview') { - let _cell = fromJS(cell).toJS() - _cell.$originUuid = _cell.uuid - _cell.uuid = _uuid - copyBtns.set(_uuid, _cell) - } - cell.uuid = _uuid + cell.uuid = Utils.getuuid() return cell }) } @@ -130,33 +112,28 @@ pasteSubmit = () => { const { options } = this.props this.pasteFormRef.handleConfirm().then(res => { - if (!options.includes(res.copyType)) { notification.warning({ top: 92, message: '閰嶇疆淇℃伅鏍煎紡閿欒锛�', duration: 5 }) return } + if (!this.props.config) { + this.props.updateConfig(res) + this.setState({visible: false}) + return + } + let type = res.copyType let config = fromJS(this.props.config).toJS() - let copyBtns = new Map() - res = this.resetconfig(res, copyBtns, config) + res = this.resetconfig(res, config) delete res.copyType - - copyBtns = [...copyBtns.values()] - - if (copyBtns.length > 0) { - MKEmitter.emit('copyButtons', copyBtns) - } if (config.type === 'form') { this.props.updateConfig(res) this.setState({visible: false}) return } else if (type === 'action') { - config.action = config.action || [] - config.action = config.action.filter(item => !item.origin) - if (['line', 'bar', 'scatter'].includes(config.type) && !['excelOut', 'excelIn'].includes(res.OpenType)) { notification.warning({ top: 92, message: '鍥捐〃涓笉鏀寔姝ょ被鎸夐挳锛�', duration: 5 }) return @@ -205,7 +182,7 @@ }) } - this.props.updateConfig(config) + this.props.updateConfig(config, type) this.setState({visible: false}) notification.success({ -- Gitblit v1.8.0