| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import DraggableTabs from './dragabletabs' |
| | | |
| | | import Utils from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | |
| | | }) |
| | | } |
| | | |
| | | moveSwitch = (index, index1) => { |
| | | moveSwitch = (order) => { |
| | | let tabs = fromJS(this.state.tabs).toJS() |
| | | tabs.subtabs[index] = tabs.subtabs.splice(index1, 1, tabs.subtabs[index])[0] |
| | | let subtab = {} |
| | | tabs.subtabs.forEach(item => { |
| | | subtab[item.uuid] = item |
| | | }) |
| | | |
| | | tabs.subtabs = [] |
| | | |
| | | order.forEach(item => { |
| | | if (subtab[item]) { |
| | | tabs.subtabs.push(subtab[item]) |
| | | } |
| | | }) |
| | | |
| | | this.setState({tabs}) |
| | | this.props.updateConfig(tabs) |
| | |
| | | |
| | | return ( |
| | | <div className="menu-tabs-edit-box" style={tabs.style}> |
| | | <Tabs defaultActiveKey="1" tabPosition={tabs.setting.position} type={tabs.setting.tabStyle}> |
| | | {tabs.subtabs.map((tab, index) => ( |
| | | <DraggableTabs tabPosition={tabs.setting.position} type={tabs.setting.tabStyle} tabsMove={this.moveSwitch}> |
| | | {tabs.subtabs.map(tab => ( |
| | | <TabPane tab={ |
| | | <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)} /> |
| | | {index !== 0 ? <Icon className="edit" type="arrow-left" onClick={() => this.moveSwitch(index, index - 1)} /> : null} |
| | | {(index + 1) !== tabs.subtabs.length ? <Icon className="edit" type="arrow-right" onClick={() => this.moveSwitch(index, index + 1)} /> : null} |
| | | <Icon className="close" title="delete" type="close" onClick={() => this.delTab(tab)} /> |
| | | </div> |
| | | } trigger="hover"> |
| | |
| | | </Popover> |
| | | } key="tool"> |
| | | </TabPane> |
| | | </Tabs> |
| | | </DraggableTabs> |
| | | <Modal |
| | | wrapClassName="popview-modal" |
| | | title={'标签编辑'} |