| | |
| | | class SettingComponent extends Component { |
| | | static propTpyes = { |
| | | type: PropTypes.string, // 菜单类型 |
| | | mainsearch: PropTypes.any, // 主表的搜索条件,当子表设置接收主表条件时有效 |
| | | MenuID: PropTypes.string, // 菜单ID |
| | | config: PropTypes.object, // 菜单配置信息 |
| | | permFuncField: PropTypes.array, // 存储过程可用开头字段 |
| | |
| | | * @description 全局设置触发 |
| | | */ |
| | | changeSetting = () => { |
| | | const { menuformRef, MenuID, config, type, permFuncField } = this.props |
| | | const { menuformRef, MenuID, config, type, permFuncField, mainsearch } = this.props |
| | | |
| | | let menu = {MenuID: MenuID} |
| | | |
| | |
| | | |
| | | _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 |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | 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"> |
| | |
| | | <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} |