From 5902ba5c3ff85efc78c95364196cd6ab5d2d1601 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 11 十月 2020 12:21:17 +0800 Subject: [PATCH] 2020-10-11 --- src/menu/components/card/cardcellcomponent/dragaction/card.jsx | 17 ++++------------- 1 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx index a39e9df..3aac343 100644 --- a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx +++ b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx @@ -9,7 +9,7 @@ import demo4 from '@/assets/img/demo4.jpg' import demo5 from '@/assets/img/demo5.jpg' -const Card = ({ id, cardIds, card, moveCard, findCard, editCard, delCard }) => { +const Card = ({ id, cardIds, card, moveCard, findCard, editCard, delCard, changeStyle }) => { const originalIndex = findCard(id).index const [{ isDragging }, drag] = useDrag({ item: { type: 'action', id, originalIndex }, @@ -32,18 +32,9 @@ }) let _style = {opacity: isDragging ? 0 : 1} - - _style.textAlign = card.align - _style.color = card.color - if (card.padding) { - _style.padding = card.padding - } - if (card.fontSize) { - _style.fontSize = card.fontSize + 'px' - } - if (card.fontWeight) { - _style.fontWeight = card.fontWeight + if (card.style) { + _style = {...card.style, opacity: isDragging ? 0 : 1} } const getContent = () => { @@ -102,7 +93,7 @@ <div className="mk-popover-control"> <Icon className="edit" title="edit" type="edit" onClick={() => editCard(id)} /> <Icon className="close" title="close" type="close" onClick={() => delCard(id)} /> - {/* <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors" /> */} + <Icon className="style" title="璋冩暣鏍峰紡" onClick={() => changeStyle(id)} type="font-colors" /> </div> } trigger="hover"> <div ref={node => drag(drop(node))} className={'ant-col card-cell ant-col-' + card.width} style={_style}> -- Gitblit v1.8.0