From 137fb8ea6af2789b3238b22bac31d80bced41dfe Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 28 七月 2021 11:39:39 +0800
Subject: [PATCH] 2021-07-28

---
 src/templates/menuconfig/editfirstmenu/index.jsx |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/templates/menuconfig/editfirstmenu/index.jsx b/src/templates/menuconfig/editfirstmenu/index.jsx
index 3df062c..200a619 100644
--- a/src/templates/menuconfig/editfirstmenu/index.jsx
+++ b/src/templates/menuconfig/editfirstmenu/index.jsx
@@ -39,6 +39,7 @@
     thawMvisible: false, // 瑙i櫎鍐荤粨妯℃�佹
     confirmLoading: false, // 鎻愪氦涓�傘�傘��
     dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
+    targetKeys: [] // 瑙e喕鑿滃崟鍒楄〃
   }
 
   handlePreviewList = (List) => {
@@ -165,7 +166,9 @@
   }
 
   thawMemuSubmit = () => {
-    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'],
@@ -175,7 +178,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',
@@ -201,6 +204,7 @@
           this.setState({
             confirmLoading: false,
             thawMvisible: false,
+            targetKeys: [],
             thawmenulist: null
           })
           this.props.reload()
@@ -212,6 +216,7 @@
   thawMemuCancel = () => {
     this.setState({
       thawMvisible: false,
+      targetKeys: [],
       thawmenulist: null
     })
   }
@@ -276,7 +281,8 @@
       })
     } else if (type === 'thawmenu') {
       this.setState({
-        thawMvisible: true
+        thawMvisible: true,
+        targetKeys: []
       })
       Api.getSystemConfig({
         func: 'sPC_Get_FrozenMenu',
@@ -378,7 +384,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