From 1da6506bf58270bacc2a4345002c6b082835580e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 21 十月 2021 23:17:08 +0800
Subject: [PATCH] 2021-10-21

---
 src/menu/components/card/cardsimplecomponent/index.jsx |   40 +++++++++++++++++++++++++++++++++++-----
 1 files changed, 35 insertions(+), 5 deletions(-)

diff --git a/src/menu/components/card/cardsimplecomponent/index.jsx b/src/menu/components/card/cardsimplecomponent/index.jsx
index cdda53a..9267c59 100644
--- a/src/menu/components/card/cardsimplecomponent/index.jsx
+++ b/src/menu/components/card/cardsimplecomponent/index.jsx
@@ -27,6 +27,7 @@
   state = {
     card: null,            // 鍗$墖淇℃伅
     formlist: null,        // 璁剧疆琛ㄥ崟淇℃伅
+    appType: sessionStorage.getItem('appType')
   }
 
   /**
@@ -134,17 +135,46 @@
 
   getSettingForms = () => {
     const { cards } = this.props
-    const { setting } = this.state.card
+    const { card } = this.state
 
     if (cards.type !== 'carousel') {
-      return getTableSetting(setting, cards.columns)
+      let buttons = []
+      card.elements && card.elements.forEach(item => {
+        if (item.eleType === 'button') {
+          buttons.push({
+            value: item.uuid,
+            label: item.label
+          })
+        }
+      })
+      return getTableSetting(card.setting, cards.columns, buttons)
     } else {
-      return getCarouselSetting(setting, cards.subtype === 'propcard')
+      return getCarouselSetting(card.setting, cards.subtype === 'propcard')
     }
   }
 
   updateSetting = (res) => {
-    const { card } = this.state
+    const { card, appType } = this.state
+
+    if (appType === '' && res.menu) {
+      let list = null
+      try {
+        list = JSON.parse(sessionStorage.getItem('thdMenuList')) || []
+      } catch (e) {
+        list = []
+      }
+
+      let id = res.menu[res.menu.length - 1]
+
+      list.forEach(item => {
+        if (item.MenuID === id) {
+          res.MenuID = id
+          res.MenuName = item.MenuName
+          res.MenuNo = item.MenuNo
+          res.tabType = item.type
+        }
+      })
+    }
 
     let _card = {...card, setting: res}
 
@@ -173,7 +203,7 @@
               <div className="mk-popover-control">
                 <Icon className="plus" title="娣诲姞鍏冪礌" onClick={this.addElement} type="plus" />
                 <Icon className="plus" title="娣诲姞鎸夐挳" onClick={this.addButton} type="plus-square" />
-                <NormalForm title="鍗$墖璁剧疆" width={700} update={this.updateSetting} getForms={this.getSettingForms}>
+                <NormalForm title="鍗$墖璁剧疆" width={800} update={this.updateSetting} getForms={this.getSettingForms}>
                   <Icon type="edit" style={{color: '#1890ff'}} title="缂栬緫"/>
                 </NormalForm>
                 <CopyComponent type="cardcell" card={card}/>

--
Gitblit v1.8.0