| | |
| | | import React from 'react' |
| | | import { useDrag, useDrop } from 'react-dnd' |
| | | import { Icon } from 'antd' |
| | | import { EditOutlined, CloseOutlined } from '@ant-design/icons' |
| | | import ItemTypes from './itemtypes' |
| | | import MkIcon from '@/components/mk-icon' |
| | | import './index.scss' |
| | | |
| | | const Card = ({ id, card, moveCard, findCard, editCard, closeCard }) => { |
| | |
| | | return ( |
| | | <div className="side-card" style={{ opacity }}> |
| | | <div ref={node => drag(drop(node))}> |
| | | {card.PageParam && card.PageParam.Icon && <Icon type={card.PageParam.Icon} />} |
| | | {card.PageParam && card.PageParam.Icon && <MkIcon type={card.PageParam.Icon} />} |
| | | {card.MenuName} |
| | | </div> |
| | | {/* 自定义模板,在新页面编辑 */} |
| | | {!card.forbidden && card.type !== 'CustomPage' ? <Icon className="edit" type="edit" onClick={edit} /> : null} |
| | | {card.type === 'CustomPage' ? <Icon className="edit" onClick={() => {window.open(`#/menudesign/${_param}`)}} type="edit" /> : null} |
| | | <Icon className="close" type="close" onClick={close} /> |
| | | {!card.forbidden && card.type !== 'CustomPage' ? <EditOutlined className="edit" onClick={edit} /> : null} |
| | | {card.type === 'CustomPage' ? <EditOutlined className="edit" onClick={() => {window.open(`#/menudesign/${_param}`)}}/> : null} |
| | | <CloseOutlined className="close" onClick={close} /> |
| | | </div> |
| | | ) |
| | | } |