From dddb2c96f42d9c852dba26ff9a27daa12bd85008 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 14 十月 2021 00:07:20 +0800
Subject: [PATCH] 2021-10-14

---
 src/menu/components/card/cardcomponent/index.jsx |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/menu/components/card/cardcomponent/index.jsx b/src/menu/components/card/cardcomponent/index.jsx
index 449bec8..eabda1c 100644
--- a/src/menu/components/card/cardcomponent/index.jsx
+++ b/src/menu/components/card/cardcomponent/index.jsx
@@ -13,6 +13,7 @@
 
 const NormalForm = asyncIconComponent(() => import('@/components/normalform'))
 const CardCellComponent = asyncComponent(() => import('../cardcellcomponent'))
+const CardMenus = asyncComponent(() => import('./menus-wrap'))
 const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent'))
 const PasteController = asyncIconComponent(() => import('@/components/paste'))
 
@@ -192,8 +193,7 @@
         }
       })
     }
-
-    return getSettingForm(card.setting, cards.subtype === 'propcard', buttons)
+    return getSettingForm(card.setting, cards.subtype, buttons, card.$cardType, cards.columns)
   }
 
   updateSetting = (res) => {
@@ -273,6 +273,16 @@
     }
   }
 
+  updateMenus = (res) => {
+    const { card } = this.state
+
+    this.setState({
+      card: {...card, menus: res}
+    })
+
+    this.props.updateElement({...card, menus: res})
+  }
+
   render() {
     const { cards, offset } = this.props
     const { card, elements, side } = this.state
@@ -303,6 +313,8 @@
                 <NormalForm title="鍗$墖璁剧疆" width={800} update={this.updateSetting} getForms={this.getSettingForms}>
                   <Icon type="edit" className="edit" title="缂栬緫"/>
                 </NormalForm>
+                {cards.subtype === 'datacard' && card.$cardType !== 'extendCard' && card.setting.click === 'menus' ?
+                  <CardMenus card={card} updateMenus={this.updateMenus}/> : null}
                 <CopyComponent type="cardcell" card={card}/>
                 <PasteController options={['action', 'customCardElement']} updateConfig={this.paste} />
                 <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors" />

--
Gitblit v1.8.0