king
2024-06-28 c8804ceb1fe2dea76f9949c5ea04423876ee2c81
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, WarningOutlined } from '@ant-design/icons'
import { CopyOutlined, EditOutlined, FontColorsOutlined, CloseOutlined, ProfileOutlined, WarningOutlined, DisconnectOutlined } from '@ant-design/icons'
import MkIcon from '@/components/mk-icon'
import { resetStyle } from '@/utils/utils-custom.js'
@@ -28,16 +28,25 @@
      moveCard(draggedId, overIndex)
    },
  })
  const opacity = isDragging ? 0 : 1
  const opacity = isDragging ? 0.5 : 1
  let hasProfile = false
  let forbidSql = false
  if (['pop', 'prompt', 'exec'].includes(card.OpenType)) {
    hasProfile = true
    if (card.verify && card.verify.default === 'false') {
      forbidSql = true
    }
  } else if (card.OpenType === 'excelIn' || card.OpenType === 'excelOut') {
    hasProfile = true
    if (card.verify && card.verify.default === 'false') {
      forbidSql = true
    }
  } else if (card.funcType === 'print') {
    hasProfile = true
  } else if (card.funcType === 'megvii') {
    hasProfile = true
  } else if (card.payMode === 'system') {
    hasProfile = true
  }
@@ -45,7 +54,7 @@
  let _style = resetStyle(card.style)
  let _class = ''
  let show = card.show
  if (type === 'datacard') {
  if (type === 'datacard' || type === 'dualdatacard') {
    _style = null
    _class = 'swiper swiper-' + card.color
    show = 'button'
@@ -56,6 +65,8 @@
  let warning = null
  if (card.OpenType === 'innerpage' && !card.pageTemplate) {
    warning = <WarningOutlined style={{color: 'orange', marginLeft: '5px'}}/>
  } else if (forbidSql) {
    warning = <DisconnectOutlined className="mk-disconnect"/>
  }
  if (show === 'icon') {
@@ -88,14 +99,20 @@
    )
  }
  let updateTime = null
  if (card.updateTime && card.updateTime.indexOf(window.GLOB.curDate) > -1) {
    updateTime = card.updateTime.substr(11)
  }
  return (
    <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
      <div className="mk-popover-control">
        <EditOutlined className="edit" onClick={() => editCard(id)} />
        <CopyOutlined className="copy" onClick={() => copyCard(id)} />
        <CloseOutlined className="close" onClick={() => delCard(id)} />
        {type !== 'datacard' ? <FontColorsOutlined className="style" title="调整样式" onClick={() => changeStyle(id)}/> : ''}
        {!card.$fixed ? <CopyOutlined className="copy" onClick={() => copyCard(id)} /> : null}
        {!card.$fixed ? <CloseOutlined className="close" onClick={() => delCard(id)} /> : null}
        {type !== 'datacard' && type !== 'basetable' && !card.$fixed ? <FontColorsOutlined className="style" title="调整样式" onClick={() => changeStyle(id)}/> : ''}
        {hasProfile ? <ProfileOutlined className="profile" title="验证" onClick={() => profileCard(id)} /> : null}
        {updateTime}
      </div>
    } trigger="hover">
      <div className="page-card" style={{ opacity: opacity}}>