From 89949fc82a0194f985cb542abb7118724804bd5b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 19 五月 2020 11:41:06 +0800 Subject: [PATCH] 2020-05-19 --- src/templates/sharecomponent/settingcomponent/index.jsx | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/templates/sharecomponent/settingcomponent/index.jsx b/src/templates/sharecomponent/settingcomponent/index.jsx index bc09bd0..2b08369 100644 --- a/src/templates/sharecomponent/settingcomponent/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/index.jsx @@ -17,6 +17,7 @@ class SettingComponent extends Component { static propTpyes = { type: PropTypes.string, // 鑿滃崟绫诲瀷 + mainsearch: PropTypes.any, // 涓昏〃鐨勬悳绱㈡潯浠讹紝褰撳瓙琛ㄨ缃帴鏀朵富琛ㄦ潯浠舵椂鏈夋晥 MenuID: PropTypes.string, // 鑿滃崟ID config: PropTypes.object, // 鑿滃崟閰嶇疆淇℃伅 permFuncField: PropTypes.array, // 瀛樺偍杩囩▼鍙敤寮�澶村瓧娈� @@ -36,7 +37,7 @@ * @description 鍏ㄥ眬璁剧疆瑙﹀彂 */ changeSetting = () => { - const { menuformRef, MenuID, config, type, permFuncField } = this.props + const { menuformRef, MenuID, config, type, permFuncField, mainsearch } = this.props let menu = {MenuID: MenuID} @@ -65,10 +66,17 @@ _columns.unshift({value: '', text: '鏈缃�'}) + let _config = fromJS(config).toJS() + + if (mainsearch) { // 缁煎悎涓婚〉鎼滅储鍙婂瓙琛ㄦ悳绱㈡潯浠� + _config.search = [..._config.search, ...mainsearch] + } + this.setState({ visible: true, formlist: getSettingForm(config.setting, permFuncField, MenuID, primaryKey, _columns, type), - menu: menu + menu: menu, + config: _config }) } @@ -163,8 +171,8 @@ } render() { - const { config, type } = this.props - const { dict, visible } = this.state + const { type } = this.props + const { dict, visible, config } = this.state return ( <div className="model-menu-setting"> @@ -188,8 +196,8 @@ <SettingForm type={type} dict={dict} - menu={this.state.menu} config={config} + menu={this.state.menu} inputSubmit={this.settingSave} formlist={this.state.formlist} wrappedComponentRef={(inst) => this.settingRef = inst} -- Gitblit v1.8.0