From b68697ccdce3f7de67c3a918701c814497b6b41a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 12 十一月 2019 22:05:24 +0800 Subject: [PATCH] 2019-11-12 --- src/components/sidemenu/comtableconfig/dragelement/index.jsx | 55 +++++++++++++++++++++++++++++++++---------------------- 1 files changed, 33 insertions(+), 22 deletions(-) diff --git a/src/components/sidemenu/comtableconfig/dragelement/index.jsx b/src/components/sidemenu/comtableconfig/dragelement/index.jsx index bd73910..7b0e33a 100644 --- a/src/components/sidemenu/comtableconfig/dragelement/index.jsx +++ b/src/components/sidemenu/comtableconfig/dragelement/index.jsx @@ -12,7 +12,7 @@ const { card, index } = findCard(id) const _cards = update(cards, { $splice: [[index, 1], [atIndex, 0, card]] }) setCards(_cards) - handleList(_cards) + handleList({[type]: _cards}) } const findCard = id => { @@ -27,27 +27,22 @@ const { card } = findCard(id) handleMenu(card) } - - const [, drop] = useDrop({ accept: ItemTypes.CARD }) + const [, drop] = useDrop({ accept: ItemTypes[type] }) return ( - <div ref={drop} className="ant-row"> - {type === 'search' && cards.map(card => ( - <Col key={card.uuid} span={6}> - <Card - key={card.uuid} - id={`${card.id}`} - type={type} - card={card} - moveCard={moveCard} - editCard={editCard} - findCard={findCard} - /> - </Col> - ))} - {/* {type === 'search' && <Col key="add" span={6}> - <Icon className="element-add" type="plus"/> - </Col>} */} - {type === 'action' && cards.map(card => ( + <div ref={drop} className="ant-row" style={type === 'columns' ? {display: 'flex'} : {}}> + {type === 'action' && cards.map(card => ( + <Card + key={card.uuid} + id={`${card.id}`} + type={type} + card={card} + moveCard={moveCard} + editCard={editCard} + findCard={findCard} + /> + ))} + {type === 'search' && cards.map(card => ( + <Col key={card.uuid} span={6}> <Card key={card.uuid} id={`${card.id}`} @@ -57,7 +52,23 @@ editCard={editCard} findCard={findCard} /> - ))} + </Col> + ))} + {type === 'columns' && cards.length > 0 && + <div className="page-card" style={{flex: 60}}> + <span className="ant-checkbox-inner"></span> + </div>} + {type === 'columns' && cards.map(card => ( + <Card + key={card.uuid} + id={`${card.id}`} + type={type} + card={card} + moveCard={moveCard} + editCard={editCard} + findCard={findCard} + /> + ))} </div> ) } -- Gitblit v1.8.0