From c3f562696aae30188e84e6686e6a7286d9cad676 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 24 十二月 2021 18:52:16 +0800
Subject: [PATCH] 2021-12-24

---
 src/tabviews/zshare/actionList/excelInbutton/index.jsx |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/src/tabviews/zshare/actionList/excelInbutton/index.jsx b/src/tabviews/zshare/actionList/excelInbutton/index.jsx
index 09c9f84..617357d 100644
--- a/src/tabviews/zshare/actionList/excelInbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/excelInbutton/index.jsx
@@ -36,7 +36,7 @@
   }
 
   UNSAFE_componentWillMount () {
-    const { btn, selectedData } = this.props
+    const { btn, selectedData, BData } = this.props
     let disabled = false
 
     if (btn.controlField && selectedData && selectedData.length > 0) { // 琛ㄦ牸涓寜閽殣钘忔帶鍒�
@@ -47,6 +47,17 @@
         }
       })
       this.setState({disabled, hidden: disabled && btn.control === 'hidden'})
+    } else if (btn.control === 'parent') {
+      if (!BData || !BData.hasOwnProperty(btn.controlField)) {
+        this.setState({hidden: true})
+      } else {
+        let s = BData[btn.controlField] + ''
+        if (s === btn.controlVal || (btn.controlVal && btn.controlVal.split(',').includes(s))) {
+          this.setState({hidden: true})
+        } else {
+          this.setState({hidden: false})
+        }
+      }
     }
   }
 
@@ -73,6 +84,17 @@
         })
       }
       this.setState({disabled, hidden: disabled && btn.control === 'hidden'})
+    } else if (btn.control === 'parent') {
+      if (!nextProps.BData || !nextProps.BData.hasOwnProperty(btn.controlField)) {
+        this.setState({hidden: true})
+      } else {
+        let s = nextProps.BData[btn.controlField] + ''
+        if (s === btn.controlVal || (btn.controlVal && btn.controlVal.split(',').includes(s))) {
+          this.setState({hidden: true})
+        } else {
+          this.setState({hidden: false})
+        }
+      }
     }
   }
 

--
Gitblit v1.8.0