From 34e7681fd12b1c4e4994d3bea1a553870e10bc50 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 11 三月 2023 17:58:54 +0800
Subject: [PATCH] 2023-03-11

---
 src/templates/formtabconfig/index.jsx |  101 +++++++++++++++++---------------------------------
 1 files changed, 34 insertions(+), 67 deletions(-)

diff --git a/src/templates/formtabconfig/index.jsx b/src/templates/formtabconfig/index.jsx
index 028b214..a3e43f0 100644
--- a/src/templates/formtabconfig/index.jsx
+++ b/src/templates/formtabconfig/index.jsx
@@ -364,7 +364,6 @@
 
     _inputfields = _formfields.filter(item => ['text', 'number', 'textarea', 'color'].includes(item.type) && card.field !== item.field)
     _tabfields = _formfields.filter(item => card.field !== item.field && item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type))
-    _tabfields.unshift({field: '', text: '鍘熻〃鍗�'})
     
     if (card.linkSubField && card.linkSubField.length > 0) {
       let fields = _inputfields.map(item => item.field)
@@ -380,12 +379,12 @@
         uniq.set(item.field, true)
 
         _linkableFields.push({
-          value: item.field,
-          text: item.label + ' (琛ㄥ崟)'
+          field: item.field,
+          label: item.label + '-琛ㄥ崟'
         })
         _linksupFields.push({
-          value: item.field,
-          text: item.label
+          field: item.field,
+          label: item.label
         })
       }
     })
@@ -396,8 +395,8 @@
           uniq.set(col.field, true)
 
           _linkableFields.push({
-            value: col.field,
-            text: col.label + ' (鏄剧ず鍒�)'
+            field: col.field,
+            label: col.label + '-鏄剧ず鍒�'
           })
         }
       })
@@ -519,7 +518,7 @@
           let param = {
             func: 's_debug_sql',
             exec_type: 'y',
-            LText: `declare @mk_organization nvarchar(512)
+            LText: `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)
               ${res.dataSource}`
           }
 
@@ -952,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',
@@ -1043,7 +1042,7 @@
                 originMenu: _config
               })
     
-              this.submitAction(btnParam, tabParam)
+              this.submitAction(btnParam)
             } else {
               this.setState({
                 menuloading: false,
@@ -1070,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)
@@ -1114,8 +1084,15 @@
             resolve(true)
           }
         })
+      } else {
+        resolve(true)
       }
     }).then(response => {
+      this.setState({
+        menuloading: false,
+        menucloseloading: false
+      })
+
       if (response) {
         notification.success({
           top: 92,
@@ -1124,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