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/timeline/normal-timeline/index.jsx | 16 ++++------------ 1 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/menu/components/timeline/normal-timeline/index.jsx b/src/menu/components/timeline/normal-timeline/index.jsx index 2dbf0ab..87c2fe4 100644 --- a/src/menu/components/timeline/normal-timeline/index.jsx +++ b/src/menu/components/timeline/normal-timeline/index.jsx @@ -50,6 +50,7 @@ setting: { interType: 'system' }, wrap: { title: '', name: card.name, direction: 'vertical', width: card.width || 24, color: '#1890ff', mode: 'left' }, style: { marginLeft: '0px', marginRight: '0px', marginTop: '0px', marginBottom: '0px' }, + headerStyle: { fontSize: '16px', borderBottomWidth: '1px', borderBottomColor: '#e8e8e8' }, subcards: [{ uuid: Utils.getuuid(), setting: { width: 24, type: 'simple'}, @@ -91,10 +92,6 @@ } } - componentDidMount () { - MKEmitter.addListener('submitStyle', this.getStyle) - } - shouldComponentUpdate (nextProps, nextState) { return !is(fromJS(this.state), fromJS(nextState)) } @@ -106,7 +103,6 @@ this.setState = () => { return } - MKEmitter.removeListener('submitStyle', this.getStyle) } /** @@ -181,15 +177,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 } = this.state - - 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