From d1aef4148f883d672671f6491368ee21b60ef7c7 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 21 六月 2024 17:51:27 +0800
Subject: [PATCH] Merge branch 'master' into positec

---
 src/views/basedesign/index.jsx |   59 ++++++++++++++++++++++-------------------------------------
 1 files changed, 22 insertions(+), 37 deletions(-)

diff --git a/src/views/basedesign/index.jsx b/src/views/basedesign/index.jsx
index 5e9d0f5..011b207 100644
--- a/src/views/basedesign/index.jsx
+++ b/src/views/basedesign/index.jsx
@@ -102,44 +102,29 @@
             console.warn('Parse Failure')
             _LongParam = ''
           }
-          editMenu.LongParam = _LongParam
-        } else if (editMenu.PageParam.copyMenuId) {
-          let _param = {
-            func: 'sPC_Get_LongParam',
-            MenuID: editMenu.PageParam.copyMenuId
-          }
-      
-          Api.getCloudConfig(_param).then(res => {
-            if (res.status) {
-              if (res.LongParam) {
-                let _LongParam = ''
-                try {
-                  _LongParam = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam)))
-                  _LongParam.type = 'user'
-                } catch (e) {
-                  console.warn('Parse Failure')
-                  _LongParam = ''
-                }
-                editMenu.LongParam = _LongParam
-              }
-              
-              this.setState({
-                editMenu: editMenu,
-                loading: false,
-                tabview: editMenu.type
-              })
-            } else {
-              this.setState({
-                loading: false
-              })
-              notification.warning({
-                top: 92,
-                message: res.message,
-                duration: 5
-              })
+
+          if (_LongParam && (_LongParam.Template === 'BaseTable' || _LongParam.Template === 'CustomPage')) {
+            let _param = {
+              MenuId: editMenu.MenuID,
+              MenuID: editMenu.MenuID,
+              ParentId: _LongParam.ParentId,
+              MenuName: _LongParam.MenuName,
+              MenuNo: _LongParam.MenuNo
             }
-          })
-          return
+            let url = ''
+            if (_LongParam.Template === 'BaseTable') {
+              url = window.location.href.split('#')[0] + `#/tabledesign/${window.btoa(window.encodeURIComponent(JSON.stringify(_param)))}`
+            } else {
+              _param.MenuType = 'custom'
+              _param = window.btoa(window.encodeURIComponent(JSON.stringify(_param)))
+              url = window.location.href.split('#')[0] + `#/menudesign/${_param}`
+            }
+            
+            window.history.replaceState(null, null, url)
+            window.location.reload()
+            return
+          }
+          editMenu.LongParam = _LongParam
         }
         
         this.setState({

--
Gitblit v1.8.0