From 32b84012bb8e2f05295c4237d17224700b149c8f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 31 十二月 2020 16:33:27 +0800 Subject: [PATCH] merge 2020-12-31 --- src/menu/components/tabs/antv-tabs/index.jsx | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/src/menu/components/tabs/antv-tabs/index.jsx b/src/menu/components/tabs/antv-tabs/index.jsx index 720b8b4..7aaaeef 100644 --- a/src/menu/components/tabs/antv-tabs/index.jsx +++ b/src/menu/components/tabs/antv-tabs/index.jsx @@ -15,6 +15,8 @@ import './index.scss' const SettingComponent = asyncIconComponent(() => import('../tabsetting')) +const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) +const PasteController = asyncIconComponent(() => import('@/menu/pastecontroller')) const TabLabelComponent = asyncComponent(() => import('../tablabelform')) const TabComponents = asyncComponent(() => import('../tabcomponents')) @@ -238,6 +240,19 @@ this.props.updateConfig(tabs) } + insert = (item, tab) => { + let tabs = fromJS(this.state.tabs).toJS() + + tabs.subtabs.forEach(stab => { + if (stab.uuid === tab.uuid) { + stab.components.push(item) + } + }) + + this.setState({tabs}) + this.props.updateConfig(tabs) + } + render() { const { tabs, dict, labelvisible, editab } = this.state @@ -249,6 +264,7 @@ <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> <Icon className="edit" title="edit" type="edit" onClick={() => this.editTab(tab)} /> + <PasteController type="tab" Tab={tab} insert={this.insert} /> <Icon className="close" title="delete" type="close" onClick={() => this.delTab(tab)} /> </div> } trigger="hover"> @@ -263,6 +279,7 @@ <div className="mk-popover-control"> <Icon className="plus" title="娣诲姞鏍囩" type="plus" onClick={this.tabAdd} /> <SettingComponent config={tabs} updateConfig={this.updateComponent} /> + <CopyComponent type="tabs" card={tabs}/> <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors" /> <Icon className="close" title="delete" type="delete" onClick={() => this.props.deletecomponent(tabs.uuid)} /> </div> -- Gitblit v1.8.0