From 8d66ff34fae5b048a6b7923cc75d34f13a08be9d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 02 八月 2022 11:42:43 +0800 Subject: [PATCH] Merge branch 'develop' --- src/mob/components/menubar/normal-menubar/index.jsx | 35 ++++++++++++++++++++--------------- 1 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/mob/components/menubar/normal-menubar/index.jsx b/src/mob/components/menubar/normal-menubar/index.jsx index 0ff743d..53d4e1f 100644 --- a/src/mob/components/menubar/normal-menubar/index.jsx +++ b/src/mob/components/menubar/normal-menubar/index.jsx @@ -51,7 +51,7 @@ name: card.name, subtype: card.subtype, setting: { interType: 'system' }, - wrap: { name: card.name, width: card.width || 24, title: '' }, + wrap: { name: card.name, width: card.width || 24, title: '', permission: 'true' }, style: { marginLeft: '0px', marginRight: '0px', marginTop: '8px', marginBottom: '8px' }, headerStyle: { fontSize: '16px', borderBottomWidth: '1px', borderBottomColor: '#e8e8e8' }, subMenus: [{ @@ -225,6 +225,22 @@ }, 200) } + filterComponent = (config) => { + let item = null + config.subMenus.forEach(menu => { + if (menu.setting.type === 'linkmenu' && menu.setting.linkMenuId === '') { + item = menu + } + }) + + this.updateComponent(config) + + setTimeout(() => { + let node = document.getElementById(item.uuid) + node && node.click() + }, 200) + } + move = (item, direction) => { let card = fromJS(this.state.card).toJS() @@ -274,18 +290,6 @@ render() { const { card } = this.state - let offset = 0 - if (card.wrap.cardFloat && card.wrap.cardFloat !== 'left') { - let _width = 0 - card.subMenus.forEach(card => { - _width += card.setting.width - }) - offset = _width < 24 ? 24 - _width : 0 - if (card.wrap.cardFloat === 'center') { - offset = Math.floor(offset / 2) - } - } - let _style = resetStyle(card.style) return ( @@ -298,7 +302,7 @@ <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> <CopyComponent type="menubar" card={card}/> - <PasteComponent config={card} options={['menucell']} updateConfig={this.updateComponent} /> + <PasteComponent config={card} options={['menucell']} updateConfig={this.filterComponent} /> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} /> <UserComponent config={card}/> <DeleteOutlined className="close" title="鍒犻櫎缁勪欢" onClick={() => this.props.deletecomponent(card.uuid)} /> @@ -309,8 +313,9 @@ <ToolOutlined /> </Popover> <div className={(card.wrap.layout || 'grid') + '-layout'}> - {card.subMenus.map((menu, index) => (<MenuComponent key={menu.uuid} offset={!index ? offset : 0} cards={card} card={menu} move={this.move} updateElement={this.updateCard} deleteElement={this.deleteCard}/>))} + {card.subMenus.map((menu, index) => (<MenuComponent key={menu.uuid} cards={card} card={menu} move={this.move} updateElement={this.updateCard} deleteElement={this.deleteCard}/>))} </div> + <div className="component-name"><div className="center">{card.name}</div></div> </div> ) } -- Gitblit v1.8.0