From a4ef35bb323b5f8300f15a4eb604d61ff39a194a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 17 十二月 2020 17:35:39 +0800 Subject: [PATCH] 2020-12-17 --- src/menu/components/card/cardcomponent/index.jsx | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/menu/components/card/cardcomponent/index.jsx b/src/menu/components/card/cardcomponent/index.jsx index 8d6d660..f99c712 100644 --- a/src/menu/components/card/cardcomponent/index.jsx +++ b/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> ) } } -- Gitblit v1.8.0