From 98ee5d4c76d2802c552851e46bd4bb43505b4416 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 11 十一月 2020 13:28:05 +0800 Subject: [PATCH] 2020-11-11 --- src/menu/components/card/cardcomponent/index.jsx | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/menu/components/card/cardcomponent/index.jsx b/src/menu/components/card/cardcomponent/index.jsx index 63637d4..ecffdf5 100644 --- a/src/menu/components/card/cardcomponent/index.jsx +++ b/src/menu/components/card/cardcomponent/index.jsx @@ -16,6 +16,7 @@ class CardBoxComponent extends Component { static propTpyes = { + MenuType: PropTypes.any, // 鑿滃崟绫诲瀷 cards: PropTypes.object, // 鍗$墖琛岄厤缃俊鎭� card: PropTypes.object, // 鍗$墖閰嶇疆淇℃伅 deleteElement: PropTypes.func, // 鍗$墖鍒犻櫎 @@ -49,7 +50,9 @@ } shouldComponentUpdate (nextProps, nextState) { - return !is(fromJS(this.props.cards), fromJS(nextProps.cards)) || !is(fromJS(this.state), fromJS(nextState)) + const { cards, MenuType } = this.props + + return !is(fromJS(cards), fromJS(nextProps.cards)) || !is(fromJS(this.state), fromJS(nextState)) || MenuType !== nextProps.MenuType } /** @@ -204,7 +207,7 @@ } render() { - const { cards } = this.props + const { cards, MenuType } = this.props const { card, elements, side, settingVisible, dict } = this.state let _style = card.style @@ -220,11 +223,11 @@ <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> <Icon className="plus" title="娣诲姞鍏冪礌" onClick={this.addElement} type="plus" /> - <Icon className="plus" title="娣诲姞鎸夐挳" onClick={this.addButton} type="plus-square" /> + {MenuType !== 'billPrint' ? <Icon className="plus" title="娣诲姞鎸夐挳" onClick={this.addButton} type="plus-square" /> : null} <Icon className="edit" type="edit" onClick={() => this.setState({settingVisible: true})} /> <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors" /> {cards.subtype === 'propcard' ? <Icon className="close" title="鍒犻櫎鍗$墖" type="delete" onClick={() => this.props.deleteElement(card)} /> : null} - {card.setting.type === 'multi' ? <Switch size="small" onClick={this.changeSide} defaultChecked /> : null} + {MenuType !== 'billPrint' && card.setting.type === 'multi' ? <Switch size="small" onClick={this.changeSide} defaultChecked /> : null} </div> } trigger="hover"> <Icon type="tool" /> @@ -245,6 +248,7 @@ <SettingForm dict={dict} cards={cards} + MenuType={MenuType} setting={card.setting} inputSubmit={this.settingSubmit} wrappedComponentRef={(inst) => this.settingRef = inst} -- Gitblit v1.8.0