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/index.jsx | 57 ++++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 44 insertions(+), 13 deletions(-) diff --git a/src/menu/components/card/cardcellcomponent/dragaction/index.jsx b/src/menu/components/card/cardcellcomponent/dragaction/index.jsx index 313a8af..88955b9 100644 --- a/src/menu/components/card/cardcellcomponent/dragaction/index.jsx +++ b/src/menu/components/card/cardcellcomponent/dragaction/index.jsx @@ -4,9 +4,10 @@ import update from 'immutability-helper' import Card from './card' +import Action from './action' import './index.scss' -const Container = ({list, handleList, handleMenu, deleteMenu }) => { +const Container = ({list, handleList, handleMenu, deleteMenu, profileAction, handleStyle }) => { const [cards, setCards] = useState(list) const moveCard = (id, atIndex) => { const { card, index } = findCard(id) @@ -31,6 +32,16 @@ handleMenu(card) } + const changeStyle = id => { + const { card } = findCard(id) + handleStyle(card) + } + + const profileCard = id => { + const { card } = findCard(id) + profileAction(card) + } + const delCard = id => { const { card } = findCard(id) deleteMenu(card) @@ -45,18 +56,38 @@ return ( <div ref={drop} className="ant-row card-detail-row"> - {cards.map(card => ( - <Card - id={card.uuid} - key={card.uuid} - cardIds={cardIds} - card={card} - moveCard={moveCard} - editCard={editCard} - delCard={delCard} - findCard={findCard} - /> - ))} + {cards.map(card => { + if (card.eleType === 'button') { + return ( + <Action + id={card.uuid} + key={card.uuid} + cardIds={cardIds} + card={card} + moveCard={moveCard} + editCard={editCard} + changeStyle={changeStyle} + profileCard={profileCard} + delCard={delCard} + findCard={findCard} + /> + ) + } else { + return ( + <Card + id={card.uuid} + key={card.uuid} + cardIds={cardIds} + card={card} + moveCard={moveCard} + editCard={editCard} + changeStyle={changeStyle} + delCard={delCard} + findCard={findCard} + /> + ) + } + })} </div> ) } -- Gitblit v1.8.0