king
2022-03-29 b6cbfb08b51e87e6eac995be8e7751815715e6a1
src/menu/components/card/cardcellcomponent/dragaction/action.jsx
@@ -1,6 +1,6 @@
import React from 'react'
import { useDrag, useDrop } from 'react-dnd'
import { Popover, Button } from 'antd'
import { Popover, Button, Switch, Checkbox } from 'antd'
import { EditOutlined, CopyOutlined, CloseOutlined, FontColorsOutlined, ProfileOutlined } from '@ant-design/icons'
import { resetStyle } from '@/utils/utils-custom.js'
@@ -30,7 +30,7 @@
  })
  let hasProfile = false
  if (['pop', 'prompt', 'exec'].includes(card.OpenType)) {
  if (['pop', 'prompt', 'exec', 'form'].includes(card.OpenType)) {
    hasProfile = true
  } else if (card.OpenType === 'excelIn' || card.OpenType === 'excelOut') {
    hasProfile = true
@@ -40,7 +40,14 @@
  let btnElement = null
  let _style = resetStyle(card.style)
  if (card.show === 'icon') {
  if (card.OpenType === 'form') {
    if (card.formType === 'switch') {
      btnElement = (<Switch style={_style} size={card.size} checkedChildren={card.openText || ''} unCheckedChildren={card.closeText || ''}/>)
    } else {
      btnElement = (<Checkbox style={_style}></Checkbox>)
    }
  } else if (card.show === 'icon') {
    btnElement = (<Button style={_style} type="link"><MkIcon type={card.icon}/></Button>)
  } else if (card.show === 'link') {
    btnElement = (<Button style={_style} type="link">{card.label}{card.icon ? <MkIcon type={card.icon}/> : null}</Button>)
@@ -59,7 +66,7 @@
      </div>
    } trigger="hover">
      <div ref={node => drag(drop(node))} className={'ant-col card-button-cell ant-col-' + card.width} onDoubleClick={(e) => {e.stopPropagation(); doubleClickCard(id)}}>
        <div style={{opacity: isDragging ? 0 : 1}}>
        <div style={{opacity: isDragging ? 0 : 1, ...card.wrapStyle}}>
          {btnElement}
        </div>
      </div>