From bdfec44c9f3a37dbbe05bf14a252ffec04132a86 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 06 九月 2022 21:24:28 +0800 Subject: [PATCH] Merge branch 'develop' --- src/menu/components/module/voucher/index.jsx | 17 ++++------------- 1 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/menu/components/module/voucher/index.jsx b/src/menu/components/module/voucher/index.jsx index 30d250f..ccc29e7 100644 --- a/src/menu/components/module/voucher/index.jsx +++ b/src/menu/components/module/voucher/index.jsx @@ -42,7 +42,7 @@ width: card.width || 12, name: '鍑瘉', subtype: card.subtype, - // setting: { interType: 'system' }, + setting: { interType: 'system' }, wrap: { name: '鍑瘉', title: '', width: card.width || 12, type: 'edit' }, style: { marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px' }, headerStyle: {}, @@ -58,10 +58,6 @@ } } - componentDidMount () { - MKEmitter.addListener('submitStyle', this.getStyle) - } - shouldComponentUpdate (nextProps, nextState) { return !is(fromJS(this.state), fromJS(nextState)) } @@ -73,7 +69,6 @@ this.setState = () => { return } - MKEmitter.removeListener('submitStyle', this.getStyle) } /** @@ -93,15 +88,11 @@ changeStyle = () => { const { card } = this.state - MKEmitter.emit('changeStyle', [card.uuid], ['background', 'border', 'padding', 'margin', 'shadow'], card.style) + MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow'], card.style, this.getStyle) } - getStyle = (comIds, style) => { - const { card } = this.state - - if (comIds[0] !== card.uuid || comIds.length !== 1) return - - let _card = {...card, style} + getStyle = (style) => { + let _card = {...this.state.card, style} this.updateComponent(_card) } -- Gitblit v1.8.0