| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Icon, Popover } from 'antd' |
| | | import { Icon, Popover, Menu } from 'antd' |
| | | |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | |
| | |
| | | const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent')) |
| | | |
| | | // const { confirm } = Modal |
| | | const { SubMenu } = Menu |
| | | |
| | | class NormalNavbar extends Component { |
| | | static propTpyes = { |
| | |
| | | changeStyle = () => { |
| | | const { card } = this.state |
| | | |
| | | MKEmitter.emit('changeStyle', [card.uuid], ['background', 'shadow'], card.style) |
| | | MKEmitter.emit('changeStyle', [card.uuid], ['font', 'background', 'shadow'], card.style) |
| | | } |
| | | |
| | | changeLogoStyle = () => { |
| | |
| | | e.stopPropagation() |
| | | MKEmitter.emit('clickComponent', this.state.card) |
| | | } |
| | | } |
| | | |
| | | changeMenu = (menu) => { |
| | | MKEmitter.emit('changeEditMenu', menu) |
| | | } |
| | | |
| | | changeLogoMenu = () => { |
| | | const { card } = this.state |
| | | |
| | | if (!card.wrap.logolink) return |
| | | |
| | | MKEmitter.emit('changeEditMenu', {MenuID: card.wrap.logolink}) |
| | | } |
| | | |
| | | render() { |
| | |
| | | <Icon className="style" title="调整样式" onClick={this.changeLogoStyle} type="font-colors" /> |
| | | </div> |
| | | } trigger="hover"> |
| | | <div className="logo" style={card.logoStyle}><img src={card.wrap.logo} alt=""/></div> |
| | | <div className={'logo' + (card.wrap.logolink ? ' pointer' : '')} style={card.logoStyle} onDoubleClick={this.changeLogoMenu}><img src={card.wrap.logo} alt=""/></div> |
| | | </Popover> : null} |
| | | <div className="menu">sdf</div> |
| | | <div className="menu"> |
| | | <Menu mode="horizontal"> |
| | | {card.menus.map(fst => { |
| | | if (fst.property === 'classify' && fst.sublist.length > 0) { |
| | | return ( |
| | | <SubMenu title={fst.name} key={fst.MenuID} popupClassName="normal-navbar-submenu"> |
| | | {fst.sublist.map(scd => { |
| | | if (scd.property === 'classify' && scd.sublist.length > 0) { |
| | | return ( |
| | | <Menu.ItemGroup key={scd.MenuID} title={scd.name}> |
| | | {scd.sublist.map(thd => { |
| | | return ( |
| | | <Menu.Item key={thd.MenuID} > |
| | | <span onClick={(e) => e.stopPropagation()} onDoubleClick={() => this.changeMenu(thd)}>{thd.name}</span> |
| | | </Menu.Item> |
| | | ) |
| | | })} |
| | | </Menu.ItemGroup> |
| | | ) |
| | | } else { |
| | | return ( |
| | | <Menu.Item key={scd.MenuID} onClick={(e) => e.stopPropagation()}> |
| | | <span onClick={(e) => e.stopPropagation()} onDoubleClick={() => this.changeMenu(scd)}>{scd.name}</span> |
| | | </Menu.Item> |
| | | ) |
| | | } |
| | | })} |
| | | </SubMenu> |
| | | ) |
| | | } else { |
| | | return ( |
| | | <Menu.Item key={fst.MenuID} onClick={(e) => e.stopPropagation()}> |
| | | <span onClick={(e) => e.stopPropagation()} onDoubleClick={() => this.changeMenu(fst)}>{fst.name}</span> |
| | | </Menu.Item> |
| | | ) |
| | | } |
| | | })} |
| | | </Menu> |
| | | </div> |
| | | <div className="link">asdfds</div> |
| | | </div> |
| | | </div> |