From 32b84012bb8e2f05295c4237d17224700b149c8f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 31 十二月 2020 16:33:27 +0800 Subject: [PATCH] merge 2020-12-31 --- src/menu/components/card/cardcomponent/index.jsx | 25 ++++++++++++++++++++++--- 1 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/menu/components/card/cardcomponent/index.jsx b/src/menu/components/card/cardcomponent/index.jsx index 891d87f..b16e051 100644 --- a/src/menu/components/card/cardcomponent/index.jsx +++ b/src/menu/components/card/cardcomponent/index.jsx @@ -4,6 +4,7 @@ import { Modal, Popover, Icon, Switch, Col } from 'antd' import asyncComponent from '@/utils/asyncComponent' +import asyncIconComponent from '@/utils/asyncIconComponent' import zhCN from '@/locales/zh-CN/model.js' import enUS from '@/locales/en-US/model.js' import SettingForm from './settingform' @@ -13,12 +14,14 @@ import './index.scss' const CardCellComponent = asyncComponent(() => import('../cardcellcomponent')) +const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) class CardBoxComponent extends Component { static propTpyes = { offset: PropTypes.any, // 鍋忕Щ閲� cards: PropTypes.object, // 鍗$墖琛岄厤缃俊鎭� card: PropTypes.object, // 鍗$墖閰嶇疆淇℃伅 + move: PropTypes.func, // 鍗$墖绉诲姩 deleteElement: PropTypes.func, // 鍗$墖鍒犻櫎 updateElement: PropTypes.func // 鑿滃崟閰嶇疆鏇存柊 } @@ -212,9 +215,16 @@ if (_style.shadow) { _style.boxShadow = '0 0 4px ' + _style.shadow } - + if (side === 'back') { - _style = {...card.backStyle, height: card.style.height} + _style = { + ...card.backStyle, + height: card.style.height, + marginBottom: card.style.marginBottom, + marginLeft: card.style.marginLeft, + marginRight: card.style.marginRight, + marginTop: card.style.marginTop + } } return ( @@ -226,8 +236,17 @@ <div className="mk-popover-control"> <Icon className="plus" title="娣诲姞鍏冪礌" onClick={this.addElement} type="plus" /> <Icon className="plus" title="娣诲姞鎸夐挳" onClick={this.addButton} type="plus-square" /> - <Icon className="edit" type="edit" onClick={() => this.setState({settingVisible: true})} /> + <Icon className="edit" title="缂栬緫" type="edit" onClick={() => this.setState({settingVisible: true})} /> + <CopyComponent type="cardcell" card={card}/> <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors" /> + {cards.subtype === 'propcard' ? <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ + <div className="mk-popover-control"> + <Icon className="plus" title="宸︾Щ" type="arrow-left" onClick={() => this.props.move(card, 'left')} /> + <Icon className="close" title="鍙崇Щ" type="arrow-right" onClick={() => this.props.move(card, 'right')} /> + </div> + } trigger="hover" getPopupContainer={() => document.getElementById(card.uuid)}> + <Icon type="swap" id={card.uuid}/> + </Popover> : null} {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} </div> -- Gitblit v1.8.0