From 6055fa01416fc57ee33b291a8103ccc1a8edce44 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 20 七月 2021 23:21:14 +0800 Subject: [PATCH] 2021-07-20 --- src/templates/menuconfig/editthdmenu/index.jsx | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/templates/menuconfig/editthdmenu/index.jsx b/src/templates/menuconfig/editthdmenu/index.jsx index 8cf7aa8..76cc412 100644 --- a/src/templates/menuconfig/editthdmenu/index.jsx +++ b/src/templates/menuconfig/editthdmenu/index.jsx @@ -79,6 +79,7 @@ btnTabConfig: null, // 鎵撳紑鏂版爣绛炬寜閽厤缃� handleMVisible: false, // 娣诲姞鎴栦慨鏀硅彍鍗曟ā鎬佹锛堣鑹叉潈闄愬垎閰嶇瓑锛� sysMenu: false, // 娣诲姞鎴栫紪杈戣彍鍗曪紙瑙掕壊鏉冮檺鍒嗛厤绛夛級 + targetKeys: [] // 瑙e喕鑿滃崟鍒楄〃 } /** @@ -268,7 +269,8 @@ return } this.setState({ - thawMvisible: true + thawMvisible: true, + targetKeys: [] }) Api.getSystemConfig({ func: 'sPC_Get_FrozenMenu', @@ -347,8 +349,9 @@ } thawMemuSubmit = () => { + const { targetKeys } = this.state // 涓夌骇鑿滃崟瑙i櫎鍐荤粨 - if (this.refs.trawmenu.state.targetKeys.length === 0) { + if (targetKeys.length === 0) { notification.warning({ top: 92, message: this.state.dict['form.required.select'] + this.state.dict['model.menu'], @@ -358,7 +361,7 @@ this.setState({ confirmLoading: true }) - let defers = this.refs.trawmenu.state.targetKeys.map(item => { + let defers = targetKeys.map(item => { return new Promise((resolve) => { Api.getSystemConfig({ func: 'sPC_MainMenu_ReDel', @@ -384,6 +387,7 @@ this.setState({ confirmLoading: false, thawMvisible: false, + targetKeys: [], thawmenulist: null }) this.props.reload() @@ -396,7 +400,8 @@ // 瑙i櫎鍐荤粨-鍙栨秷 this.setState({ thawMvisible: false, - thawmenulist: null + thawmenulist: null, + targetKeys: [] }) } @@ -934,7 +939,7 @@ destroyOnClose > {!this.state.thawmenulist && <Spin style={{marginLeft: 'calc(50% - 22px)', marginTop: '70px', marginBottom: '70px'}} size="large" />} - {this.state.thawmenulist && <TransferForm ref="trawmenu" menulist={this.state.thawmenulist}/>} + {this.state.thawmenulist && <TransferForm onChange={(vals) => this.setState({targetKeys: vals})} menulist={this.state.thawmenulist}/>} </Modal> {/* 娣诲姞绯荤粺鑿滃崟 */} <Modal -- Gitblit v1.8.0