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/printbutton/index.jsx | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletions(-) diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx index 20c7891..26e90e8 100644 --- a/src/tabviews/zshare/actionList/printbutton/index.jsx +++ b/src/tabviews/zshare/actionList/printbutton/index.jsx @@ -47,7 +47,7 @@ } UNSAFE_componentWillMount () { - const { btn, selectedData } = this.props + const { btn, selectedData, BData } = this.props let disabled = false if (btn.controlField && selectedData && selectedData.length > 0) { // 琛ㄦ牸涓寜閽殣钘忔帶鍒� @@ -58,6 +58,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}) + } + } } } @@ -90,6 +101,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