From 73c0258e4e30f1d2e407cb067feea8e79fad081d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 16 九月 2021 14:37:10 +0800
Subject: [PATCH] 2021-09-16

---
 src/menu/components/card/cardcomponent/index.jsx |   62 ++++++++++++++++++++++++++----
 1 files changed, 53 insertions(+), 9 deletions(-)

diff --git a/src/menu/components/card/cardcomponent/index.jsx b/src/menu/components/card/cardcomponent/index.jsx
index e2adfc7..449bec8 100644
--- a/src/menu/components/card/cardcomponent/index.jsx
+++ b/src/menu/components/card/cardcomponent/index.jsx
@@ -30,7 +30,8 @@
     card: null,            // 鍗$墖淇℃伅锛屽寘鎷鍙嶉潰
     formlist: null,        // 璁剧疆琛ㄥ崟淇℃伅
     elements: null,        // 缂栬緫缁�
-    side: 'front'
+    side: 'front',
+    appType: sessionStorage.getItem('appType')
   }
 
   /**
@@ -170,13 +171,53 @@
 
   getSettingForms = () => {
     const { cards } = this.props
-    const { setting } = this.state.card
+    const { card, appType } = this.state
 
-    return getSettingForm(setting, cards.subtype === 'propcard')
+    let buttons = []
+    card.elements && card.elements.forEach(item => {
+      if (item.eleType === 'button') {
+        buttons.push({
+          value: item.uuid,
+          label: item.label
+        })
+      }
+    })
+    if (appType !== 'mob' && card.backElements) {
+      card.backElements.forEach(item => {
+        if (item.eleType === 'button') {
+          buttons.push({
+            value: item.uuid,
+            label: item.label
+          })
+        }
+      })
+    }
+
+    return getSettingForm(card.setting, cards.subtype === 'propcard', buttons)
   }
 
   updateSetting = (res) => {
-    const { card, side } = this.state
+    const { card, side, 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
+        }
+      })
+    }
 
     this.setState({
       card: {...card, setting: res}
@@ -198,11 +239,14 @@
 
     let _uuid = Utils.getuuid()
     
-    if (element.copyType === 'action' && element.OpenType === 'popview') { // 寮圭獥鏍囩澶嶅埗
-      let _cell = fromJS(element).toJS()
-      _cell.$originUuid = element.uuid
-      _cell.uuid = _uuid
-      MKEmitter.emit('copyButtons', [_cell])
+    if (element.copyType === 'action') {
+      element.eleType = 'button'
+      if (element.OpenType === 'popview') { // 寮圭獥鏍囩澶嶅埗
+        let _cell = fromJS(element).toJS()
+        _cell.$originUuid = element.uuid
+        _cell.uuid = _uuid
+        MKEmitter.emit('copyButtons', [_cell])
+      }
     }
 
     element.uuid = _uuid

--
Gitblit v1.8.0