| | |
| | | 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' |
| | |
| | | |
| | | class CardBoxComponent extends Component { |
| | | static propTpyes = { |
| | | offset: PropTypes.any, // 偏移量 |
| | | MenuType: PropTypes.any, // 菜单类型 |
| | | cards: PropTypes.object, // 卡片行配置信息 |
| | | card: PropTypes.object, // 卡片配置信息 |
| | |
| | | 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') { |
| | |
| | | } |
| | | |
| | | 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"> |
| | |
| | | wrappedComponentRef={(inst) => this.settingRef = inst} |
| | | /> |
| | | </Modal> |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } |
| | | } |