File was renamed from src/templates/headerconfig/dragelement/index.jsx |
| | |
| | | import React, { useState } from 'react' |
| | | import { useDrop } from 'react-dnd' |
| | | import { Icon, Button } from 'antd' |
| | | import { is, fromJS } from 'immutable' |
| | | import update from 'immutability-helper' |
| | | import Card from './card' |
| | | import ItemTypes from './itemtypes' |
| | |
| | | handlePreviewList(_cards) |
| | | } |
| | | |
| | | if (!is(fromJS(cards), fromJS(list))) { |
| | | setCards(list) |
| | | } |
| | | |
| | | const findCard = id => { |
| | | const card = cards.filter(c => `${c.id}` === id)[0] |
| | | const card = cards.filter(c => c.MenuID === id)[0] |
| | | return { |
| | | card, |
| | | index: cards.indexOf(card), |
| | |
| | | <div ref={drop} className="dragdashboard"> |
| | | {cards.map(card => ( |
| | | <Card |
| | | key={card.id} |
| | | id={`${card.id}`} |
| | | text={card.text} |
| | | key={card.MenuID} |
| | | id={`${card.MenuID}`} |
| | | text={card.MenuName} |
| | | moveCard={moveCard} |
| | | editCard={editCard} |
| | | delCard={delCard} |
| | | findCard={findCard} |
| | | /> |
| | | ))} |
| | | <div className="btn-group"> |
| | | <div className="card-add" onClick={add}> |
| | | <Icon type="plus" /> |
| | | </div> |
| | | <Button type="primary" onClick={thawmenu}>{dict['model.thaw'] + dict['model.menu']}</Button> |
| | | <Button type="primary" onClick={confirm}>{dict['model.confirm']}</Button> |
| | | <Button onClick={cancel}>{dict['model.close']}</Button> |
| | | <div className="card-add" onClick={add}> |
| | | <Icon type="plus" /> |
| | | </div> |
| | | <Button type="primary" onClick={thawmenu}>{dict['model.thaw'] + dict['model.menu']}</Button> |
| | | <Button type="primary" onClick={confirm}>{dict['model.confirm']}</Button> |
| | | <Button onClick={cancel}>{dict['model.close']}</Button> |
| | | </div> |
| | | ) |
| | | } |