| | |
| | | const WrapComponent = asyncIconComponent(() => import('./wrapsetting')) |
| | | const MenuComponent = asyncIconComponent(() => import('./menusetting')) |
| | | const LinkComponent = asyncIconComponent(() => import('./linksetting')) |
| | | const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) |
| | | const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent')) |
| | | |
| | | const { SubMenu } = Menu |
| | | |
| | |
| | | } |
| | | |
| | | changeMenu = (menu) => { |
| | | if (menu.property === 'link') { |
| | | window.open(menu.link) |
| | | return |
| | | } |
| | | MKEmitter.emit('changeEditMenu', { |
| | | MenuID: menu.property === 'linkmenu' ? menu.linkMenuId : menu.MenuID, |
| | | copyMenuId: menu.property === 'menu' ? menu.copyMenuId : '', |
| | | MenuNo: menu.MenuNo, |
| | | MenuName: menu.name, |
| | | }) |
| | | } |
| | | |
| | | changeLogoMenu = () => { |
| | | const { card } = this.state |
| | | |
| | | if (!card.wrap.logolink) return |
| | | |
| | | MKEmitter.emit('changeEditMenu', {MenuID: card.wrap.logolink}) |
| | | |
| | | if (card.wrap.property === 'linkmenu') { |
| | | MKEmitter.emit('changeEditMenu', { |
| | | MenuID: card.wrap.linkmenu, |
| | | copyMenuId: '', |
| | | MenuNo: '', |
| | | MenuName: '' |
| | | }) |
| | | } |
| | | } |
| | | |
| | | render() { |
| | | const { card } = this.state |
| | | |
| | | let _style = {...card.style} |
| | | if (_style.shadow) { |
| | | _style.boxShadow = '0 0 4px ' + _style.shadow |
| | | } |
| | | |
| | | return ( |
| | | <div className="normal-navbar-edit-box" style={_style} onClick={this.clickComponent} id={card.uuid}> |
| | | <div className="normal-navbar-edit-box" style={card.style} onClick={this.clickComponent} id={card.uuid}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <MenuComponent config={card} updateConfig={this.updateComponent} /> |
| | | <LinkComponent config={card} updateConfig={this.updateComponent} /> |
| | | <WrapComponent config={card} updateConfig={this.updateComponent} /> |
| | | <CopyComponent type="normalnarbar" card={card}/> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | <UserComponent config={card}/> |
| | | <Icon className="close" title="删除组件" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | | </div> |
| | | } trigger="hover"> |
| | |
| | | ) |
| | | } else { |
| | | return ( |
| | | <Menu.Item key={fst.MenuID} onClick={(e) => e.stopPropagation()}> |
| | | <Menu.Item key={fst.MenuID}> |
| | | <span onClick={(e) => e.stopPropagation()} onDoubleClick={() => this.changeMenu(fst)}>{fst.name}</span> |
| | | </Menu.Item> |
| | | ) |