king
2020-12-23 e9640ccdc9fe57f91919e3f51462c780e44fadb0
src/menu/components/card/cardcomponent/index.jsx
@@ -17,7 +17,6 @@
class CardBoxComponent extends Component {
  static propTpyes = {
    offset: PropTypes.any,           // 偏移量
    MenuType: PropTypes.any,         // 菜单类型
    cards: PropTypes.object,         // 卡片行配置信息
    card: PropTypes.object,          // 卡片配置信息
    deleteElement: PropTypes.func,   // 卡片删除
@@ -51,9 +50,9 @@
  }
  shouldComponentUpdate (nextProps, nextState) {
    const { cards, MenuType } = this.props
    const { cards } = this.props
    
    return !is(fromJS(cards), fromJS(nextProps.cards)) || !is(fromJS(this.state), fromJS(nextState)) || MenuType !== nextProps.MenuType
    return !is(fromJS(cards), fromJS(nextProps.cards)) || !is(fromJS(this.state), fromJS(nextState))
  }
  /**
@@ -205,7 +204,7 @@
  }
  render() {
    const { cards, MenuType, offset } = this.props
    const { cards, offset } = this.props
    const { card, elements, side, settingVisible, dict } = this.state
    let _style = {...card.style}
@@ -226,11 +225,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" />
                {MenuType !== 'billPrint' ? <Icon className="plus" title="添加按钮" onClick={this.addButton} type="plus-square" /> : null}
                <Icon className="plus" title="添加按钮" onClick={this.addButton} type="plus-square" />
                <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}
                {MenuType !== 'billPrint' && card.setting.type === 'multi' ? <Switch size="small" onClick={this.changeSide} defaultChecked /> : null}
                {card.setting.type === 'multi' ? <Switch size="small" onClick={this.changeSide} defaultChecked /> : null}
              </div>
            } trigger="hover">
              <Icon type="tool" />
@@ -251,7 +250,6 @@
          <SettingForm
            dict={dict}
            cards={cards}
            MenuType={MenuType}
            setting={card.setting}
            inputSubmit={this.settingSubmit}
            wrappedComponentRef={(inst) => this.settingRef = inst}