From 3b103caa6bfc9ed410e67156c3ca1785bf1cecc9 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 19 八月 2022 01:15:31 +0800 Subject: [PATCH] 2022-08-19 --- src/menu/components/form/tab-form/index.jsx | 26 +++----------------------- 1 files changed, 3 insertions(+), 23 deletions(-) diff --git a/src/menu/components/form/tab-form/index.jsx b/src/menu/components/form/tab-form/index.jsx index ad47dea..ff6e32b 100644 --- a/src/menu/components/form/tab-form/index.jsx +++ b/src/menu/components/form/tab-form/index.jsx @@ -131,7 +131,6 @@ } componentDidMount () { - MKEmitter.addListener('submitStyle', this.getStyle) MKEmitter.addListener('submitComponentStyle', this.updateComponentStyle) } @@ -146,7 +145,6 @@ this.setState = () => { return } - MKEmitter.removeListener('submitStyle', this.getStyle) MKEmitter.removeListener('submitComponentStyle', this.updateComponentStyle) } @@ -240,29 +238,11 @@ changeStyle = () => { const { card } = this.state - MKEmitter.emit('changeStyle', [card.uuid], ['height', 'background', 'border', 'padding', 'margin', 'shadow'], card.style) + MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow'], card.style, this.getStyle) } - getStyle = (comIds, style) => { - const { card, group } = this.state - - if (comIds[0] === 'form') { - let Index = group.fields.findIndex(n => n.uuid === comIds[1]) - - if (Index === -1) return - - let _group = fromJS(group).toJS() - - _group.fields[Index].style = style - - this.updateGroup(_group) - - return - } - - if (comIds.length !== 1 || comIds[0] !== card.uuid) return - - let _card = {...card, style} + getStyle = (style) => { + let _card = {...this.state.card, style} this.updateComponent(_card) } -- Gitblit v1.8.0