king
2022-01-21 46f79b491173d284a4900d19e7aecf7509481438
src/templates/menuconfig/menuelement/card.jsx
@@ -1,7 +1,8 @@
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 }) => {
@@ -47,13 +48,13 @@
  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>
  )
}