From 3bdcb8da222aaedcc1b6b279d1d038fe3b714570 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 03 十月 2021 12:10:36 +0800
Subject: [PATCH] 2021-10-03

---
 src/tabviews/zshare/mutilform/index.jsx                     |   24 ++++---
 src/tabviews/zshare/actionList/tabbutton/index.jsx          |    3 
 src/tabviews/zshare/actionList/newpagebutton/index.jsx      |    3 
 src/tabviews/zshare/actionList/popupbutton/index.jsx        |    4 
 src/tabviews/zshare/topSearch/index.jsx                     |   24 ++++---
 src/tabviews/custom/components/table/normal-table/index.jsx |   12 ++--
 src/tabviews/zshare/actionList/normalbutton/index.jsx       |    4 
 src/tabviews/zshare/actionList/changeuserbutton/index.jsx   |    4 
 src/tabviews/custom/components/card/data-card/index.jsx     |   36 +++++++++--
 src/tabviews/zshare/actionList/excelInbutton/index.jsx      |    4 
 src/tabviews/zshare/actionList/printbutton/index.jsx        |    4 
 11 files changed, 75 insertions(+), 47 deletions(-)

diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx
index 9f8963a..83cd92d 100644
--- a/src/tabviews/custom/components/card/data-card/index.jsx
+++ b/src/tabviews/custom/components/card/data-card/index.jsx
@@ -256,7 +256,19 @@
   checkTopLine = () => {
     const { config, data } = this.state
 
-    if (!data || data.length === 0) return
+    if (!data || data.length === 0) {
+      this.setState({
+        activeKey: '',
+        selectKeys: [],
+        selectedData: []
+      })
+  
+      MKEmitter.emit('resetSelectLine', config.uuid, '', '')
+      if (config.setting.$hasSyncModule) {
+        MKEmitter.emit('syncBalconyData', config.uuid, [], false)
+      }
+      return
+    }
 
     this.setState({
       activeKey: 0,
@@ -364,9 +376,19 @@
         total: 0,
         loading: false
       })
-      MKEmitter.emit('resetSelectLine', config.uuid, '', '')
-      if (config.setting.$hasSyncModule) {
-        MKEmitter.emit('syncBalconyData', config.uuid, [], false)
+      
+      if (selected !== 'false') {
+        setTimeout(() => {
+          this.checkTopLine()
+        }, 200)
+        if (selected === 'init') {
+          this.setState({selected: 'false'})
+        }
+      } else {
+        MKEmitter.emit('resetSelectLine', config.uuid, '', '')
+        if (config.setting.$hasSyncModule) {
+          MKEmitter.emit('syncBalconyData', config.uuid, [], false)
+        }
       }
       return
     }
@@ -409,9 +431,9 @@
         }
       } else {
         MKEmitter.emit('resetSelectLine', config.uuid, '', '')
-      }
-      if (config.setting.$hasSyncModule) {
-        MKEmitter.emit('syncBalconyData', config.uuid, [], false)
+        if (config.setting.$hasSyncModule) {
+          MKEmitter.emit('syncBalconyData', config.uuid, [], false)
+        }
       }
 
       this.setState({
diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx
index 9adf4bf..3173619 100644
--- a/src/tabviews/custom/components/table/normal-table/index.jsx
+++ b/src/tabviews/custom/components/table/normal-table/index.jsx
@@ -85,7 +85,7 @@
         return item
       })
 
-      if (setting.selected !== 'false') {
+      if (setting.selected !== 'false' && _data && _data.length > 0) {
         setTimeout(() => {
           MKEmitter.emit('mkCheckTopLine', _config.uuid)
         }, 200)
@@ -193,7 +193,7 @@
 
     let result = await Api.genericInterface(param)
     if (result.status) {
-      if (setting.selected !== 'false') {
+      if (setting.selected !== 'false' && result.data && result.data.length > 0) {
         setTimeout(() => {
           MKEmitter.emit('mkCheckTopLine', config.uuid)
         }, 200)
@@ -202,6 +202,9 @@
         }
       } else {
         MKEmitter.emit('resetSelectLine', config.uuid, '', '') // 骞挎挱鏁版嵁鍒囨崲
+        if (setting.$hasSyncModule) {
+          MKEmitter.emit('syncBalconyData', config.uuid, [], false)
+        }
       }
       
       reset && MKEmitter.emit('resetTable', config.uuid, repage) // 鍒楄〃閲嶇疆
@@ -224,9 +227,6 @@
         total: result.total,
         loading: false
       })
-      if (setting.$hasSyncModule) {
-        MKEmitter.emit('syncBalconyData', config.uuid, [], false)
-      }
     } else {
       this.setState({
         loading: false
@@ -538,7 +538,7 @@
           return item
         })
 
-        if (setting.selected !== 'false') {
+        if (setting.selected !== 'false' && _data && _data.length > 0) {
           setTimeout(() => {
             MKEmitter.emit('mkCheckTopLine', config.uuid)
           }, 200)
diff --git a/src/tabviews/zshare/actionList/changeuserbutton/index.jsx b/src/tabviews/zshare/actionList/changeuserbutton/index.jsx
index 6b4f238..c9913da 100644
--- a/src/tabviews/zshare/actionList/changeuserbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/changeuserbutton/index.jsx
@@ -81,9 +81,9 @@
    */
   actionTrigger = (triggerId, record, type) => {
     const { setting, selectedData, btn, MenuID } = this.props
-    const { loading } = this.state
+    const { loading, disabled } = this.state
     
-    if ((triggerId && btn.uuid !== triggerId) || loading) return
+    if ((triggerId && btn.uuid !== triggerId) || loading || disabled) return
 
     if (btn.funcType === 'closetab') {
       MKEmitter.emit('closeTabView', MenuID || btn.$MenuID)
diff --git a/src/tabviews/zshare/actionList/excelInbutton/index.jsx b/src/tabviews/zshare/actionList/excelInbutton/index.jsx
index e4b395d..aff76d3 100644
--- a/src/tabviews/zshare/actionList/excelInbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/excelInbutton/index.jsx
@@ -100,9 +100,9 @@
    */
   actionTrigger = (triggerId, record, type) => {
     const { setting, Tab, BID, btn, selectedData } = this.props
-    const { loading } = this.state
+    const { loading, disabled } = this.state
 
-    if ((triggerId && btn.uuid !== triggerId) || loading) return
+    if ((triggerId && btn.uuid !== triggerId) || loading || disabled) return
 
     if (((Tab && Tab.supMenu) || setting.supModule) && !BID) {
       notification.warning({
diff --git a/src/tabviews/zshare/actionList/newpagebutton/index.jsx b/src/tabviews/zshare/actionList/newpagebutton/index.jsx
index 4d35579..6a0547d 100644
--- a/src/tabviews/zshare/actionList/newpagebutton/index.jsx
+++ b/src/tabviews/zshare/actionList/newpagebutton/index.jsx
@@ -78,8 +78,9 @@
    */
   actionTrigger = (triggerId, record, type) => {
     const { setting, btn, selectedData } = this.props
+    const { disabled } = this.state
 
-    if (triggerId && btn.uuid !== triggerId) return
+    if ((triggerId && btn.uuid !== triggerId) || disabled) return
 
     if (type === 'linkbtn' && selectedData && selectedData.length === 1) {
       if (record[0].$Index !== selectedData[0].$Index) {
diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx
index b6101a4..0a9d684 100644
--- a/src/tabviews/zshare/actionList/normalbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -138,9 +138,9 @@
    */
   actionTrigger = (triggerId, record, type) => {
     const { Tab, BID, btn, selectedData, setting } = this.props
-    const { loading } = this.state
+    const { loading, disabled } = this.state
 
-    if ((triggerId && btn.uuid !== triggerId) || loading) return
+    if ((triggerId && btn.uuid !== triggerId) || loading || disabled) return
 
     if (((Tab && Tab.supMenu) || setting.supModule) && !BID) {
       notification.warning({
diff --git a/src/tabviews/zshare/actionList/popupbutton/index.jsx b/src/tabviews/zshare/actionList/popupbutton/index.jsx
index 672597b..779669f 100644
--- a/src/tabviews/zshare/actionList/popupbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/popupbutton/index.jsx
@@ -119,9 +119,9 @@
    */
   actionTrigger = (triggerId, record, type) => {
     const { setting, Tab, BID, btn, selectedData } = this.props
-    const { loading } = this.state
+    const { loading, disabled } = this.state
 
-    if ((triggerId && btn.uuid !== triggerId) || loading) return
+    if ((triggerId && btn.uuid !== triggerId) || loading || disabled) return
 
     if (((Tab && Tab.supMenu) || setting.supModule) && !BID) {
       notification.warning({
diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx
index 1889cf8..ef3fe55 100644
--- a/src/tabviews/zshare/actionList/printbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -97,9 +97,9 @@
    */
   actionTrigger = (triggerId, record, type) => {
     const { Tab, BID, btn, selectedData, setting } = this.props
-    const { loading } = this.state
+    const { loading, disabled } = this.state
 
-    if ((triggerId && btn.uuid !== triggerId) || loading) return
+    if ((triggerId && btn.uuid !== triggerId) || loading || disabled) return
 
     if (((Tab && Tab.supMenu) || setting.supModule) && !BID) {
       notification.warning({
diff --git a/src/tabviews/zshare/actionList/tabbutton/index.jsx b/src/tabviews/zshare/actionList/tabbutton/index.jsx
index ca9986b..1c02362 100644
--- a/src/tabviews/zshare/actionList/tabbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/tabbutton/index.jsx
@@ -78,8 +78,9 @@
    */
   actionTrigger = (triggerId, record, type) => {
     const { setting, btn, selectedData } = this.props
+    const { disabled } = this.state
 
-    if (triggerId && btn.uuid !== triggerId) return
+    if ((triggerId && btn.uuid !== triggerId) || disabled) return
 
     if (type === 'linkbtn' && selectedData && selectedData.length === 1) {
       if (record[0].$Index !== selectedData[0].$Index) {
diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx
index 184bddf..5e8af54 100644
--- a/src/tabviews/zshare/mutilform/index.jsx
+++ b/src/tabviews/zshare/mutilform/index.jsx
@@ -491,7 +491,7 @@
    * @description 娴嬭瘯绯荤粺鑾峰彇涓嬫媺琛ㄥ崟閫夐」淇℃伅
    */
   improveSimpleActionForm = (deForms) => {
-    let deffers = deForms.map(form => {
+    let deffers = deForms.map((form, index) => {
       let param = {
         func: 'sPC_Get_SelectedList',
         LText: form.data_sql,
@@ -505,16 +505,18 @@
   
       return (
         new Promise(resolve => {
-          Api.getSystemCacheConfig(param).then(res => {
-            if (!res.status) {
-              notification.warning({
-                top: 92,
-                message: res.message,
-                duration: 5
-              })
-            }
-            resolve(res)
-          })
+          setTimeout(() => {
+            Api.getSystemCacheConfig(param).then(res => {
+              if (!res.status) {
+                notification.warning({
+                  top: 92,
+                  message: res.message,
+                  duration: 5
+                })
+              }
+              resolve(res)
+            })
+          }, index * 30)
         })
       )
     })
diff --git a/src/tabviews/zshare/topSearch/index.jsx b/src/tabviews/zshare/topSearch/index.jsx
index c2cf4ad..c1403af 100644
--- a/src/tabviews/zshare/topSearch/index.jsx
+++ b/src/tabviews/zshare/topSearch/index.jsx
@@ -318,7 +318,7 @@
   improveSimpleSearch = (deForms) => {
     if (deForms.length === 0) return
 
-    let deffers = deForms.map(item => {
+    let deffers = deForms.map((item, index) => {
       let param = {
         func: 'sPC_Get_SelectedList',
         LText: item.data_sql,
@@ -335,16 +335,18 @@
 
       return (
         new Promise(resolve => {
-          Api.getSystemCacheConfig(param).then(res => {
-            if (!res.status) {
-              notification.warning({
-                top: 92,
-                message: res.message,
-                duration: 5
-              })
-            }
-            resolve(res)
-          })
+          setTimeout(() => {
+            Api.getSystemCacheConfig(param).then(res => {
+              if (!res.status) {
+                notification.warning({
+                  top: 92,
+                  message: res.message,
+                  duration: 5
+                })
+              }
+              resolve(res)
+            })
+          }, index * 30)
         })
       )
     })

--
Gitblit v1.8.0