king
2022-10-04 41c55c1f103658b997f7a828a7067bdb228f1df0
src/menu/components/share/actioncomponent/dragaction/card.jsx
@@ -1,7 +1,7 @@
import React from 'react'
import { useDrag, useDrop } from 'react-dnd'
import { Button, Popover } from 'antd'
import { CopyOutlined, EditOutlined, FontColorsOutlined, CloseOutlined, ProfileOutlined } from '@ant-design/icons'
import { CopyOutlined, EditOutlined, FontColorsOutlined, CloseOutlined, ProfileOutlined, WarningOutlined } from '@ant-design/icons'
import MkIcon from '@/components/mk-icon'
import { resetStyle } from '@/utils/utils-custom.js'
@@ -28,7 +28,7 @@
      moveCard(draggedId, overIndex)
    },
  })
  const opacity = isDragging ? 0 : 1
  const opacity = isDragging ? 0.5 : 1
  let hasProfile = false
  if (['pop', 'prompt', 'exec'].includes(card.OpenType)) {
@@ -36,6 +36,8 @@
  } else if (card.OpenType === 'excelIn' || card.OpenType === 'excelOut') {
    hasProfile = true
  } else if (card.funcType === 'print') {
    hasProfile = true
  } else if (card.funcType === 'megvii') {
    hasProfile = true
  }
@@ -48,6 +50,13 @@
    _class = 'swiper swiper-' + card.color
    show = 'button'
  }
  if (card.hidden === 'true') {
    _class += ' mk-hidden'
  }
  let warning = null
  if (card.OpenType === 'innerpage' && !card.pageTemplate) {
    warning = <WarningOutlined style={{color: 'orange', marginLeft: '5px'}}/>
  }
  if (show === 'icon') {
    btnElement = (
@@ -56,7 +65,7 @@
        style={_style}
        className={_class}
        onDoubleClick={() => doubleClickCard(id)}
      >{card.icon ? <MkIcon type={card.icon}/> : card.label}</Button>
      >{card.icon ? <MkIcon type={card.icon}/> : card.label}{warning}</Button>
    )
  } else if (show === 'link') {
    btnElement = (
@@ -65,7 +74,7 @@
        style={_style}
        className={_class}
        onDoubleClick={() => doubleClickCard(id)}
      >{card.label}{card.icon ? <MkIcon type={card.icon}/> : null}</Button>
      >{card.label}{card.icon ? <MkIcon type={card.icon}/> : null}{warning}</Button>
    )
  } else {
    btnElement = (
@@ -74,7 +83,7 @@
        className={_class}
        onDoubleClick={() => doubleClickCard(id)}
      >
        <MkIcon type={card.icon}/>{card.label}
        <MkIcon type={card.icon}/>{card.label}{warning}
      </Button>
    )
  }