From 973dd90ad4fb5061fbc8db0b2cb8ade7217328bf Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 04 二月 2020 17:18:37 +0800
Subject: [PATCH] 2020-02-04

---
 src/templates/comtableconfig/index.jsx |   30 +++++++++++++++++++++++++++---
 1 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx
index 6718bf5..8d41a7a 100644
--- a/src/templates/comtableconfig/index.jsx
+++ b/src/templates/comtableconfig/index.jsx
@@ -544,6 +544,28 @@
             MenuID: card.originCard.uuid
           }).then(result => {
             if (result.status && result.LongParam) {
+              let _LongParam = ''
+
+              // 瑙f瀽閰嶇疆锛屼慨鏀规ā鎬佹鏍囬鍚嶇О
+              if (result.LongParam) {
+                try {
+                  _LongParam = window.decodeURIComponent(window.atob(result.LongParam))
+                  _LongParam = JSON.parse(_LongParam)
+                } catch (e) {
+                  _LongParam = ''
+                }
+              }
+              if (_LongParam && _LongParam.type === 'Modal') {
+                try {
+                  _LongParam.setting.title = res.label
+                  _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_LongParam)))
+                } catch {
+                  _LongParam = ''
+                }
+              } else {
+                _LongParam = ''
+              }
+
               let param = {
                 func: 'sPC_ButtonParam_AddUpt',
                 ParentID: menu.MenuID,
@@ -552,7 +574,7 @@
                 Template: 'Modal',
                 MenuName: res.label,
                 PageParam: JSON.stringify({Template: 'Modal'}),
-                LongParam: result.LongParam
+                LongParam: _LongParam
               }
               Api.getSystemConfig(param).then(response => {
                 if (!response.status) {
@@ -1550,16 +1572,18 @@
       if (oriActions.length === 0) return 'true'
 
       oriActions.forEach(action => {
+        if (!action.prebtn || !action.prebtn.uuid) return
+
         Api.getSystemConfig({
           func: 'sPC_Get_LongParam',
-          MenuID: action.prebtn ? action.prebtn.uuid : ''
+          MenuID: action.prebtn.uuid
         }).then(result => {
           if (result.status && result.LongParam) {
             let _LongParam = ''
   
             if (result.LongParam) {
-              _LongParam = window.decodeURIComponent(window.atob(result.LongParam))
               try {
+                _LongParam = window.decodeURIComponent(window.atob(result.LongParam))
                 _LongParam = JSON.parse(_LongParam)
               } catch (e) {
                 _LongParam = ''

--
Gitblit v1.8.0