From 57da72c823fab94a3ec6fadab2bc75173c8a03b1 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 01 十二月 2020 13:45:25 +0800
Subject: [PATCH] 2020-12-01

---
 src/templates/treepageconfig/index.jsx |  124 +++++++++++++++++++++--------------------
 1 files changed, 64 insertions(+), 60 deletions(-)

diff --git a/src/templates/treepageconfig/index.jsx b/src/templates/treepageconfig/index.jsx
index 4b887e6..24d2716 100644
--- a/src/templates/treepageconfig/index.jsx
+++ b/src/templates/treepageconfig/index.jsx
@@ -166,19 +166,19 @@
 
   getFuncNames = (data, funcNames, tableNames) => {
     data.forEach(item => {
-      if (item.subfuncs) {
-        this.getFuncNames(item.subfuncs, funcNames, tableNames)
-      } else {
-        if (item.tableName) {
-          tableNames.push(item.tableName)
-        }
-        if (item.innerFunc) {
-          funcNames.push({func: item.innerFunc, label: item.label || ''})
-        }
+      // if (item.subfuncs) {
+      //   this.getFuncNames(item.subfuncs, funcNames, tableNames)
+      //   return
+      // }
+      if (item.tableName) {
+        tableNames.push(item.tableName)
+      }
+      if (item.innerFunc) {
+        funcNames.push({func: item.innerFunc, label: item.label || ''})
+      }
 
-        if (item.callbackFunc) {
-          funcNames.push({func: item.callbackFunc, label: item.label || ''})
-        }
+      if (item.callbackFunc) {
+        funcNames.push({func: item.callbackFunc, label: item.label || ''})
       }
     })
 
@@ -267,46 +267,47 @@
     }
 
     new Promise(resolve => {
-      let deffers = []
-      _config.funcs.forEach(item => {
-        if (item.type === 'tab') {
-          let deffer = new Promise(resolve => {
-            Api.getSystemConfig({
-              func: 'sPC_Get_LongParam',
-              MenuID: item.linkTab
-            }).then(result => {
-              if (result.status && result.LongParam) {
-                let _LongParam = ''
+      // let deffers = []
+      // _config.funcs.forEach(item => {
+      //   if (item.type === 'tab') {
+      //     let deffer = new Promise(resolve => {
+      //       Api.getSystemConfig({
+      //         func: 'sPC_Get_LongParam',
+      //         MenuID: item.linkTab
+      //       }).then(result => {
+      //         if (result.status && result.LongParam) {
+      //           let _LongParam = ''
       
-                if (result.LongParam) {
-                  try {
-                    _LongParam = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam)))
-                  } catch (e) {
-                    console.warn('Parse Failure')
-                    _LongParam = ''
-                  }
-                }
+      //           if (result.LongParam) {
+      //             try {
+      //               _LongParam = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam)))
+      //             } catch (e) {
+      //               console.warn('Parse Failure')
+      //               _LongParam = ''
+      //             }
+      //           }
     
-                if (_LongParam) {
-                  item.menuNo = _LongParam.tabNo || ''
-                  item.subfuncs = _LongParam.funcs || []
-                }
-              }
-              resolve()
-            })
-          })
+      //           if (_LongParam) {
+      //             item.menuNo = _LongParam.tabNo || ''
+      //             item.subfuncs = _LongParam.funcs || []
+      //           }
+      //         }
+      //         resolve()
+      //       })
+      //     })
 
-          deffers.push(deffer)
-        }
-      })
+      //     deffers.push(deffer)
+      //   }
+      // })
 
-      if (deffers.length === 0) {
-        resolve()
-      } else {
-        Promise.all(deffers).then(() => {
-          resolve()
-        })
-      }
+      // if (deffers.length === 0) {
+      //   resolve()
+      // } else {
+      //   Promise.all(deffers).then(() => {
+      //     resolve()
+      //   })
+      // }
+      resolve()
     }).then(() => {
       // 淇濆瓨鏃跺垹闄ら厤缃被鍨嬶紝system 銆乽ser
       delete _config.type
@@ -437,6 +438,13 @@
       }).then(resp => {
         if (resp === false) return
         let localParam = fromJS(param).toJS()
+        localParam.func = 'sPC_TrdMenu_AddUpt_For_Local'
+        delete localParam.LongParam
+        delete localParam.PageParam
+        delete localParam.Template
+        delete localParam.Sort
+        delete localParam.EasyCode
+        delete localParam.open_edition
 
         Api.getSystemConfig(param).then(response => {
           if (response.status) {
@@ -446,8 +454,6 @@
               originMenu: fromJS(_config).toJS()
             })
 
-            this.props.reloadmenu()
-            
             // 瀛樺湪鏍囩椤垫椂
             if (tabParam.LText) {
               Api.getSystemConfig(tabParam).then(result => {
@@ -457,6 +463,10 @@
                     message: '淇濆瓨鎴愬姛',
                     duration: 2
                   })
+
+                  this.props.reloadmenu()
+                  Api.getLocalConfig(localParam)
+
                   if (this.state.closeVisible) {
                     this.props.handleView()
                   } else {
@@ -483,6 +493,10 @@
                 message: '淇濆瓨鎴愬姛',
                 duration: 2
               })
+
+              this.props.reloadmenu()
+              Api.getLocalConfig(localParam)
+
               if (this.state.closeVisible) {
                 this.props.handleView()
               } else {
@@ -492,16 +506,6 @@
                 })
               }
             }
-
-            localParam.func = 'sPC_TrdMenu_AddUpt_For_Local'
-            delete localParam.LongParam
-            delete localParam.PageParam
-            delete localParam.Template
-            delete localParam.Sort
-            delete localParam.EasyCode
-            delete localParam.open_edition
-
-            Api.getLocalConfig(localParam)
           } else {
             this.setState({
               menuloading: false,

--
Gitblit v1.8.0