From 7c98691f1917c63077b153bd63d4e2db5ba09e4a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 02 三月 2023 17:56:20 +0800
Subject: [PATCH] 2023-03-02

---
 src/templates/formtabconfig/index.jsx |   86 +++++++++++++-----------------------------
 1 files changed, 27 insertions(+), 59 deletions(-)

diff --git a/src/templates/formtabconfig/index.jsx b/src/templates/formtabconfig/index.jsx
index 851fb46..7e9a3b1 100644
--- a/src/templates/formtabconfig/index.jsx
+++ b/src/templates/formtabconfig/index.jsx
@@ -951,26 +951,26 @@
         btnParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
         btnParam.secretkey = Utils.encrypt(btnParam.LText, btnParam.timestamp)
         
-        let tabParam = { // 娣诲姞鑿滃崟tab椤�
-          func: 'sPC_sMenusTab_AddUpt',
-          MenuID: btnTab.uuid
-        }
+        // let tabParam = { // 娣诲姞鑿滃崟tab椤�
+        //   func: 'sPC_sMenusTab_AddUpt',
+        //   MenuID: btnTab.uuid
+        // }
         
-        let _LText = []
+        // let _LText = []
 
-        config.tabgroups.forEach(group => {
-          group.sublist.forEach(item => {
-            _sort++
-            _LText.push(`select '${btnTab.uuid}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${_sort * 10}' as Sort`)
-          })
-        })
+        // config.tabgroups.forEach(group => {
+        //   group.sublist.forEach(item => {
+        //     _sort++
+        //     _LText.push(`select '${btnTab.uuid}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${_sort * 10}' as Sort`)
+        //   })
+        // })
 
-        _LText = _LText.join(' union all ')
+        // _LText = _LText.join(' union all ')
 
-        tabParam.LText = Utils.formatOptions(_LText)
+        // tabParam.LText = Utils.formatOptions(_LText)
 
-        tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
-        tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp)
+        // tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
+        // tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp)
   
         let param = {
           func: 'sPC_ButtonParam_AddUpt',
@@ -1042,7 +1042,7 @@
                 originMenu: _config
               })
     
-              this.submitAction(btnParam, tabParam)
+              this.submitAction(btnParam)
             } else {
               this.setState({
                 menuloading: false,
@@ -1069,43 +1069,14 @@
   /**
    * @description 淇濆瓨鎴栦慨鏀硅彍鍗曟寜閽�
    */
-  submitAction = (btnParam, tabParam) => {
+  submitAction = (btnParam) => {
     new Promise(resolve => {
-      let deffers = []
-
-      if (tabParam.LText) {
-        let defer = new Promise(resolve => {
-          Api.getSystemConfig(tabParam).then(result => {
-            resolve(result)
-          })
-        })
-        deffers.push(defer)
-      }
-
       if (btnParam.LText) {
-        let defer = new Promise(resolve => {
-          Api.getSystemConfig(btnParam).then(result => {
-            resolve(result)
-          })
-        })
-        deffers.push(defer)
-      }
-
-      if (deffers.length === 0) {
-        resolve(true)
-      } else {
-        Promise.all(deffers).then(result => {
-          let error = false
-          result.forEach(res => {
-            if (!res.status) {
-              error = res
-            }
-          })
-
-          if (error) {
+        Api.getSystemConfig(btnParam).then(result => {
+          if (!result.status) {
             notification.warning({
               top: 92,
-              message: error.message,
+              message: result.message,
               duration: 5
             })
             resolve(false)
@@ -1113,8 +1084,15 @@
             resolve(true)
           }
         })
+      } else {
+        resolve(true)
       }
     }).then(response => {
+      this.setState({
+        menuloading: false,
+        menucloseloading: false
+      })
+
       if (response) {
         notification.success({
           top: 92,
@@ -1123,17 +1101,7 @@
         })
         if (this.state.closeVisible) {
           this.handleViewBack()
-        } else {
-          this.setState({
-            menuloading: false,
-            menucloseloading: false
-          })
         }
-      } else {
-        this.setState({
-          menuloading: false,
-          menucloseloading: false
-        })
       }
     })
   }

--
Gitblit v1.8.0