| | |
| | | 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 |
| | |
| | | }) |
| | | } 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 |
| | | }) |
| | | } |
| | |
| | | |
| | | 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 |