From 5d1e5dc9b248f91b33105dc838200af07947cdb2 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 04 一月 2022 18:07:40 +0800
Subject: [PATCH] 2022-01-04

---
 src/menu/components/card/cardcellcomponent/dragaction/action.jsx |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/menu/components/card/cardcellcomponent/dragaction/action.jsx b/src/menu/components/card/cardcellcomponent/dragaction/action.jsx
index 7b28f71..346ad40 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,13 @@
 
   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>)

--
Gitblit v1.8.0