king
2020-12-17 a4ef35bb323b5f8300f15a4eb604d61ff39a194a
src/menu/components/card/cardcomponent/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Modal, Popover, Icon, Switch } from 'antd'
import { Modal, Popover, Icon, Switch, Col } from 'antd'
import asyncComponent from '@/utils/asyncComponent'
import zhCN from '@/locales/zh-CN/model.js'
@@ -16,6 +16,7 @@
class CardBoxComponent extends Component {
  static propTpyes = {
    offset: PropTypes.any,           // 偏移量
    MenuType: PropTypes.any,         // 菜单类型
    cards: PropTypes.object,         // 卡片行配置信息
    card: PropTypes.object,          // 卡片配置信息
@@ -172,7 +173,7 @@
    const { card, side } = this.state
    let _style = null
    let options = ['height', 'background', 'border', 'padding', 'margin']
    let options = ['height', 'background', 'border', 'padding', 'margin', 'shadow']
    if (side === 'front') {
      _style = card.style ? fromJS(card.style).toJS() : {}
    } else if (side === 'back') {
@@ -204,16 +205,21 @@
  }
  render() {
    const { cards, MenuType } = this.props
    const { cards, MenuType, offset } = this.props
    const { card, elements, side, settingVisible, dict } = this.state
    let _style = card.style
    let _style = {...card.style}
    if (_style.shadow) {
      _style.boxShadow = '0 0 4px ' + _style.shadow
    }
    if (side === 'back') {
      _style = {...card.backStyle, height: card.style.height}
    }
    return (
      <div className={'ant-col ant-col-' + (card.setting.width || 6)}>
      <Col span={card.setting.width || 6} offset={offset || 0}>
        <div className="card-item" style={_style}>
          <CardCellComponent cards={cards} cardCell={card} side={side} elements={elements} updateElement={this.updateCard}/>
          <div className="card-control">
@@ -251,7 +257,7 @@
            wrappedComponentRef={(inst) => this.settingRef = inst}
          />
        </Modal>
      </div>
      </Col>
    )
  }
}