File was renamed from src/templates/menuconfig/editfirstmenu/dragelement/index.jsx |
| | |
| | | import React, { useState } from 'react' |
| | | import { useDrop } from 'react-dnd' |
| | | import { Button } from 'antd' |
| | | import { PlusOutlined } from '@ant-design/icons' |
| | | import { is, fromJS } from 'immutable' |
| | | import update from 'immutability-helper' |
| | | import Card from './card' |
| | | import ItemTypes from './itemtypes' |
| | | import './index.scss' |
| | | |
| | | const Container = ({dict, list, handlePreviewList, handleMenu, deleteMemu, handleButton }) => { |
| | | const Container = ({change, list, handlePreviewList, handleMenu, deleteMemu, handleButton }) => { |
| | | const [cards, setCards] = useState(list) |
| | | const moveCard = (id, atIndex) => { |
| | | const { card, index } = findCard(id) |
| | |
| | | deleteMemu(card) |
| | | } |
| | | |
| | | const add = () => { |
| | | handleButton('add') |
| | | } |
| | | |
| | | const confirm = () => { |
| | | handleButton('confirm') |
| | | } |
| | | |
| | | const cancel = () => { |
| | | handleButton('cancel') |
| | | } |
| | | |
| | | const thawmenu = () => { |
| | | handleButton('thawmenu') |
| | | } |
| | | |
| | | const [, drop] = useDrop({ accept: ItemTypes.CARD }) |
| | |
| | | findCard={findCard} |
| | | /> |
| | | ))} |
| | | <div className="card-add" onClick={add}> |
| | | <PlusOutlined /> |
| | | </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> |
| | | <Button type="primary" className="mk-save-menu" disabled={!change} onClick={confirm}>保存</Button> |
| | | <Button onClick={cancel}>关闭</Button> |
| | | </div> |
| | | ) |
| | | } |