From bde2916433c7830e2879e6524e32b9f6c8bd0bab Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 02 一月 2022 16:31:32 +0800
Subject: [PATCH] 2022-01-02

---
 src/tabviews/zshare/actionList/normalbutton/index.jsx |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx
index c29c578..c28aaa3 100644
--- a/src/tabviews/zshare/actionList/normalbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -32,6 +32,7 @@
     columns: PropTypes.any,           // 瀛楁鍒�
     setting: PropTypes.any,           // 椤甸潰閫氱敤璁剧疆
     ContainerId: PropTypes.any,       // tab椤甸潰ID锛岀敤浜庡脊绐楁帶鍒�
+    disabled: PropTypes.any,          // 琛屾寜閽鐢�
   }
 
   state = {
@@ -62,7 +63,7 @@
           disabled = true
         }
       })
-      this.setState({disabled, hidden: disabled && btn.control === 'hidden'})
+      this.setState({hidden: disabled && btn.control === 'hidden'})
     } else if (btn.control === 'parent') {
       if (!BData || !BData.hasOwnProperty(btn.controlField)) {
         this.setState({hidden: true})
@@ -74,6 +75,9 @@
           this.setState({hidden: false})
         }
       }
+    }
+    if (this.props.disabled || disabled) {
+      this.setState({disabled: true})
     }
   }
 
@@ -98,9 +102,8 @@
   UNSAFE_componentWillReceiveProps (nextProps) {
     const { btn, selectedData, BData } = this.props
 
+    let disabled = false
     if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) {
-      let disabled = false
-
       if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 琛ㄦ牸涓寜閽殣钘忔帶鍒�
         nextProps.selectedData.forEach(item => {
           let s = item[btn.controlField] + ''
@@ -109,7 +112,7 @@
           }
         })
       }
-      this.setState({disabled, hidden: disabled && btn.control === 'hidden'})
+      this.setState({hidden: disabled && btn.control === 'hidden'})
     } else if (btn.control === 'parent' && !is(fromJS(nextProps.BData || {}), fromJS(BData || {}))) {
       if (!nextProps.BData || !nextProps.BData.hasOwnProperty(btn.controlField)) {
         this.setState({hidden: true})
@@ -122,6 +125,12 @@
         }
       }
     }
+
+    if (nextProps.disabled || disabled) {
+      this.setState({disabled: true})
+    } else {
+      this.setState({disabled: false})
+    }
   }
 
   componentWillUnmount () {

--
Gitblit v1.8.0