| | |
| | | })( |
| | | <Select |
| | | showSearch |
| | | allowClear |
| | | filterOption={(input, option) => option.props.children[2].toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | onChange={(value) => {this.optionChange(item.key, value)}} |
| | | getPopupContainer={() => document.getElementById('winter')} |
| | | > |
| | | {item.options.map((option, index) => |
| | | <Select.Option id={index} key={index} value={option.value || option.field}> |
| | | <Select.Option id={index} key={option.value || option.field} value={option.value || option.field}> |
| | | {item.key === 'icon' && option.value ? <Icon type={option.value} /> : ''} {option.text || option.label} |
| | | </Select.Option> |
| | | )} |
| | |
| | | handleSave = (modal) => { |
| | | const { config, btn } = this.state |
| | | MKEmitter.emit('submitModal', config, btn, modal) |
| | | |
| | | this.setState({ |
| | | visible: false, |
| | | config: null, |
| | | btn: null |
| | | }) |
| | | } |
| | | |
| | | render () { |
| | |
| | | submitConfig = () => { |
| | | const { config } = this.state |
| | | |
| | | this.setState({originConfig: fromJS(config).toJS()}) |
| | | this.props.handleSave(config) |
| | | notification.success({ |
| | | top: 92, |
| | | message: '保存成功。', |
| | | duration: 2 |
| | | }) |
| | | } |
| | | |
| | | cancelConfig = () => { |
| | |
| | | <Card title={dict['header.menu.form.configurable']} bordered={false} extra={ |
| | | <div> |
| | | <EditComponent dict={dict} options={['form']} config={this.state.config} refresh={(res) => this.updateConfig(res.config)}/> |
| | | <Button type="primary" onClick={this.submitConfig}>{dict['model.confirm']}</Button> |
| | | <Button onClick={this.cancelConfig}>{dict['model.cancel']}</Button> |
| | | <Button type="primary" onClick={this.submitConfig}>保存</Button> |
| | | <Button onClick={this.cancelConfig}>返回</Button> |
| | | </div> |
| | | } style={{ width: '100%' }}> |
| | | <Icon type="setting" onClick={this.changeSetting} /> |
| | |
| | | .ant-card-body { |
| | | position: relative; |
| | | padding: 0; |
| | | |
| | | .modal-fields-row.up_down { |
| | | .ant-form-item { |
| | | display: block!important; |
| | | .ant-form-item-label { |
| | | width: 100%!important; |
| | | text-align: left; |
| | | } |
| | | .ant-form-item-control-wrapper { |
| | | width: 100%!important; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .ant-modal-content { |
| | | max-width: 95%; |
| | | margin: 0 auto; |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | .modal-fields { |
| | | .ant-modal { |
| | | top: 50px; |
| | |
| | | |
| | | // 按钮图标集 |
| | | export const btnIcons = [{ |
| | | value: '', |
| | | text: '无' |
| | | }, { |
| | | value: 'plus', |
| | | text: 'plus' |
| | | }, { |
| | |
| | | }, { |
| | | value: 'double-left', |
| | | text: 'double-left' |
| | | }, { |
| | | value: 'search', |
| | | text: 'search' |
| | | }] |
| | | |
| | | // 按钮颜色集 |