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/editsecmenu/index.jsx | 32 +++++++++++++++++++------------- 1 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/templates/menuconfig/editsecmenu/index.jsx b/src/templates/menuconfig/editsecmenu/index.jsx index 6d9733e..a30f148 100644 --- a/src/templates/menuconfig/editsecmenu/index.jsx +++ b/src/templates/menuconfig/editsecmenu/index.jsx @@ -33,15 +33,16 @@ state = { dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, - menulist: null, // 鑿滃崟鍒楄〃 - type: '', // 缂栬緫绫诲瀷锛宎dd or edit - title: '', // 妯℃�佹鏍囬 - visible: null, // 妯℃�佹鏄惁鍙 - formlist: null, // 琛ㄥ崟淇℃伅 - editMenu: null, // 缂栬緫鑿滃崟 - thawmenulist: null, // 宸插喕缁撶殑浜岀骇鑿滃崟 - thawMvisible: false, // 瑙i櫎鍐荤粨妯℃�佹 - confirmLoading: false // 鎻愪氦涓�傘�傘�� + menulist: null, // 鑿滃崟鍒楄〃 + type: '', // 缂栬緫绫诲瀷锛宎dd or edit + title: '', // 妯℃�佹鏍囬 + visible: null, // 妯℃�佹鏄惁鍙 + formlist: null, // 琛ㄥ崟淇℃伅 + editMenu: null, // 缂栬緫鑿滃崟 + thawmenulist: null, // 宸插喕缁撶殑浜岀骇鑿滃崟 + thawMvisible: false, // 瑙i櫎鍐荤粨妯℃�佹 + confirmLoading: false, // 鎻愪氦涓�傘�傘�� + targetKeys: [] // 瑙e喕鑿滃崟鍒楄〃 } handlePreviewList = (List) => { @@ -170,7 +171,8 @@ }) } else if (type === 'thaw') { // 瑙e喕宸叉湁鑿滃崟 this.setState({ - thawMvisible: true + thawMvisible: true, + targetKeys: [] }) Api.getSystemConfig({ func: 'sPC_Get_FrozenMenu', @@ -329,7 +331,9 @@ } thawMemuSubmit = () => { // 瑙e喕鑿滃崟锛屾彁浜わ紝瀛樺湪澶氫釜鏃讹紝寰幆鎻愪氦 - if (this.refs.trawmenu.state.targetKeys.length === 0) { + const { targetKeys } = this.state + + if (targetKeys.length === 0) { notification.warning({ top: 92, message: this.state.dict['form.required.select'] + this.state.dict['model.menu'], @@ -339,7 +343,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', @@ -365,6 +369,7 @@ this.setState({ confirmLoading: false, thawMvisible: false, + targetKeys: [], thawmenulist: null }) this.props.reload() @@ -376,6 +381,7 @@ thawMemuCancel = () => { // 瑙e喕鑿滃崟鍙栨秷 this.setState({ thawMvisible: false, + targetKeys: [], thawmenulist: null }) } @@ -458,7 +464,7 @@ onCancel={this.thawMemuCancel} > {!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> </div> ) -- Gitblit v1.8.0