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/normalbutton/index.jsx | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletions(-) diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index ba6f77f..5d0b6c5 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -52,7 +52,7 @@ moduleParams = null UNSAFE_componentWillMount () { - const { btn, selectedData } = this.props + const { btn, selectedData, BData } = this.props let disabled = false if (btn.controlField && selectedData && selectedData.length > 0) { // 琛ㄦ牸涓寜閽殣钘忔帶鍒� @@ -63,6 +63,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}) + } + } } } @@ -99,6 +110,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