From cb9ade2afd2a367ad767bc605ab7086c695dd010 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 09 十二月 2022 15:53:32 +0800 Subject: [PATCH] 2022-12-09 --- src/mob/components/menubar/normal-menubar/menucomponent/index.jsx | 17 ++++------------- 1 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/mob/components/menubar/normal-menubar/menucomponent/index.jsx b/src/mob/components/menubar/normal-menubar/menucomponent/index.jsx index daac1c6..53aa073 100644 --- a/src/mob/components/menubar/normal-menubar/menucomponent/index.jsx +++ b/src/mob/components/menubar/normal-menubar/menucomponent/index.jsx @@ -36,10 +36,6 @@ }) } - componentDidMount () { - MKEmitter.addListener('submitStyle', this.getStyle) - } - shouldComponentUpdate (nextProps, nextState) { return !is(fromJS(this.state), fromJS(nextState)) } @@ -51,14 +47,10 @@ this.setState = () => { return } - MKEmitter.removeListener('submitStyle', this.getStyle) } - getStyle = (comIds, style) => { - const { cards } = this.props + getStyle = (style) => { const { card } = this.state - - if (comIds.length !== 2 || comIds[0] !== cards.uuid || comIds[1] !== card.uuid) return let _card = fromJS(card).toJS() _card.style = style @@ -71,13 +63,12 @@ } changeStyle = () => { - const { cards } = this.props const { card } = this.state let _style = card.style ? fromJS(card.style).toJS() : {} let options = ['font', 'border', 'padding', 'margin', 'background'] - MKEmitter.emit('changeStyle', [cards.uuid, card.uuid], options, _style) + MKEmitter.emit('changeStyle', options, _style, this.getStyle) } getSettingForms = () => { @@ -110,7 +101,7 @@ MenuID: card.setting.type === 'linkmenu' ? card.setting.linkMenuId : card.uuid, copyMenuId: card.setting.type === 'menu' ? card.setting.copyMenuId : '', clearMenu: card.setting.clearMenu || 'true', - MenuNo: card.setting.MenuNo || '', + // MenuNo: card.setting.MenuNo || '', MenuName: card.setting.name, }) } @@ -160,7 +151,7 @@ </div>} <div className="menu-name" style={{opacity: !card.setting.name ? 0 : 1}}>{card.setting.name || '鏄庣'}</div> <RightOutlined className="menu-right" /> - {!card.setting.name ? <NormalForm title="鑿滃崟缂栬緫" width={900} update={this.updateSetting} cancel={() => this.props.deleteElement(card, 'direct')} getForms={this.getSettingForms}> + {!card.setting.name || (card.setting.type === 'linkmenu' && card.setting.linkMenuId === '') ? <NormalForm title="鑿滃崟缂栬緫" width={900} update={this.updateSetting} cancel={() => this.props.deleteElement(card, 'direct')} getForms={this.getSettingForms}> <span id={card.uuid}></span> </NormalForm> : null} </div> -- Gitblit v1.8.0