From b6cbfb08b51e87e6eac995be8e7751815715e6a1 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 29 三月 2022 15:36:21 +0800
Subject: [PATCH] 2022-03-29

---
 src/menu/components/card/cardcellcomponent/dragaction/action.jsx |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/menu/components/card/cardcellcomponent/dragaction/action.jsx b/src/menu/components/card/cardcellcomponent/dragaction/action.jsx
index 7b28f71..364400e 100644
--- a/src/menu/components/card/cardcellcomponent/dragaction/action.jsx
+++ b/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>

--
Gitblit v1.8.0