From 5df578ff69f6b02e821d59a8883bc75d78695a62 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 10 十一月 2020 11:07:31 +0800
Subject: [PATCH] 2020-11-10

---
 src/menu/menuform/index.jsx |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/menu/menuform/index.jsx b/src/menu/menuform/index.jsx
index 9f714ff..a0fe3e8 100644
--- a/src/menu/menuform/index.jsx
+++ b/src/menu/menuform/index.jsx
@@ -1,5 +1,6 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
+import { fromJS } from 'immutable'
 import { Form, Row, Col, Input, Select, notification } from 'antd'
 
 import Api from '@/api'
@@ -14,6 +15,7 @@
     MenuName: PropTypes.string,
     MenuNo: PropTypes.string,
     parentId: PropTypes.string,
+    initMenuList: PropTypes.func,
     updateConfig: PropTypes.func
   }
 
@@ -55,6 +57,8 @@
             smenulist = item.options
           }
         })
+
+        this.props.initMenuList({fstMenuList: fromJS(menulist).toJS(), fstMenuId: result.FstIDSeleted})
 
         this.setState({
           fstMenuId: result.FstIDSeleted,
@@ -101,8 +105,8 @@
       }, () => {
         let _id = smenulist[0] ? smenulist[0].value : ''
         this.props.form.setFieldsValue({parentId: _id})
+        this.props.updateConfig({...config, fstMenuId: value, parentId: _id})
       })
-      this.props.updateConfig({...config, fstMenuId: value})
     } else if (key === 'parentId') {
       this.props.updateConfig({...config, parentId: value})
     }
@@ -124,7 +128,7 @@
   }
 
   render() {
-    const { dict, MenuName, MenuNo } = this.props
+    const { dict, MenuName, MenuNo, config } = this.props
     const { menulist, smenulist } = this.state
     const { getFieldDecorator } = this.props.form
     const formItemLayout = {
@@ -212,7 +216,7 @@
           <Col span={24}>
             <Form.Item label={dict['mob.menu.easycode']}>
               {getFieldDecorator('easyCode', {
-                initialValue: ''
+                initialValue: config.easyCode
               })(<Input placeholder="" autoComplete="off" onChange={this.changeEasyCode}/>)}
             </Form.Item>
           </Col>

--
Gitblit v1.8.0