From c5a378919ea922fd3216e70d9c5479edfe0d7178 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 04 八月 2021 15:44:34 +0800
Subject: [PATCH] 2021-08-04

---
 src/menu/components/card/balcony/index.jsx |   45 +++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 43 insertions(+), 2 deletions(-)

diff --git a/src/menu/components/card/balcony/index.jsx b/src/menu/components/card/balcony/index.jsx
index 9b2971a..6ab10d0 100644
--- a/src/menu/components/card/balcony/index.jsx
+++ b/src/menu/components/card/balcony/index.jsx
@@ -8,12 +8,14 @@
 import { resetStyle } from '@/utils/utils-custom.js'
 import MKEmitter from '@/utils/events.js'
 import Utils from '@/utils/utils.js'
+import MenuUtils from '@/utils/utils-custom.js'
+import { balconyWrapForm } from './options'
 import zhCN from '@/locales/zh-CN/model.js'
 import enUS from '@/locales/en-US/model.js'
 import './index.scss'
 
 const SettingComponent = asyncIconComponent(() => import('@/menu/datasource'))
-const WrapComponent = asyncIconComponent(() => import('./wrapsetting'))
+const NormalForm = asyncIconComponent(() => import('@/components/normalform'))
 const CardCellComponent = asyncComponent(() => import('../cardcellcomponent'))
 const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent'))
 const PasteComponent = asyncIconComponent(() => import('@/components/paste'))
@@ -204,6 +206,43 @@
     resolve({status: true})
   }
 
+  getWrapForms = () => {
+    const { wrap } = this.state.card
+    
+    let modules = MenuUtils.getLinkModules(fromJS(window.GLOB.customMenu).toJS().components) || []
+    let supmodules = MenuUtils.getSupModules(fromJS(window.GLOB.customMenu).toJS().components, '') || []
+    let roleList = sessionStorage.getItem('sysRoles')
+
+    if (roleList) {
+      try {
+        roleList = JSON.parse(roleList)
+      } catch {
+        roleList = []
+      }
+    } else {
+      roleList = []
+    }
+
+    return fromJS(balconyWrapForm).toJS().map(item => {
+      item.initval = wrap[item.field] || item.initval
+
+      if (item.field === 'blacklist') {
+        item.options = roleList
+      } else if (item.field === 'syncModule') {
+        item.options = modules
+      } else if (item.field === 'supModule') {
+        item.options = supmodules
+      }
+
+      return item
+    })
+  }
+
+  updateWrap = (res) => {
+    delete res.quick
+    this.updateComponent({...this.state.card, wrap: res})
+  }
+
   render() {
     const { card } = this.state
 
@@ -215,7 +254,9 @@
           <div className="mk-popover-control">
             <Icon className="plus" title="娣诲姞鍏冪礌" onClick={this.addElement} type="plus" />
             <Icon className="plus" title="娣诲姞鎸夐挳" onClick={this.addButton} type="plus-square" />
-            <WrapComponent config={card} updateConfig={this.updateComponent} />
+            <NormalForm title="鍗$墖璁剧疆" width={800} update={this.updateWrap} getForms={this.getWrapForms}>
+              <Icon type="edit" style={{color: '#1890ff'}} title="缂栬緫"/>
+            </NormalForm>
             <CopyComponent type="balcony" card={card}/>
             <PasteComponent options={['action', 'customCardElement']} updateConfig={this.pasteComponent} />
             <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors" />

--
Gitblit v1.8.0