From 21167ece56edd628e6f6546d1d642947cc3a048f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 12 八月 2024 22:17:33 +0800 Subject: [PATCH] 2024-08-12 --- src/mob/components/menubar/normal-menubar/menucomponent/index.jsx | 15 +++------------ 1 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/mob/components/menubar/normal-menubar/menucomponent/index.jsx b/src/mob/components/menubar/normal-menubar/menucomponent/index.jsx index 3c28d9f..2382fb8 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 = () => { @@ -127,7 +118,7 @@ <Col span={card.setting.width || 6}> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> - <NormalForm title="鑿滃崟缂栬緫" width={900} update={this.updateSetting} getForms={this.getSettingForms}> + <NormalForm title="鑿滃崟缂栬緫" width={950} update={this.updateSetting} getForms={this.getSettingForms}> <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> <CopyComponent type="menucell" card={card}/> -- Gitblit v1.8.0