| | |
| | | |
| | | state = { |
| | | fields: null, |
| | | display: this.props.config.setting.display, |
| | | appType: sessionStorage.getItem('appType') |
| | | } |
| | | |
| | |
| | | |
| | | render() { |
| | | const { config, dict } = this.props |
| | | const { fields, appType } = this.state |
| | | const { fields, appType, display } = this.state |
| | | const { getFieldDecorator } = this.props.form |
| | | |
| | | const formItemLayout = { |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label="宽度"> |
| | | <Form.Item label="宽度(%)"> |
| | | {getFieldDecorator('width', { |
| | | initialValue: config.setting.width |
| | | })(<InputNumber min={10} max={90} precision={0} />)} |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {!this.props.isSubTab && appType !== 'pc' ? <Col span={12}> |
| | | <Col span={12}> |
| | | <Form.Item label="显示方式"> |
| | | {getFieldDecorator('display', { |
| | | initialValue: config.setting.display || 'modal' |
| | | })( |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}} onChange={(e) => this.setState({display: e.target.value})}> |
| | | <Radio value="modal">模态框</Radio> |
| | | <Radio value="prompt">是否框</Radio> |
| | | <Radio value="drawer">抽屉</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {!this.props.isSubTab && appType !== 'pc' && display === 'modal' ? <Col span={12}> |
| | | <Form.Item label="挂载对象"> |
| | | {getFieldDecorator('container', { |
| | | initialValue: config.setting.container || 'tab' |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={12}> |
| | | <Form.Item label="显示方式"> |
| | | {getFieldDecorator('display', { |
| | | initialValue: config.setting.display || 'modal' |
| | | {display === 'drawer' ? <Col span={12}> |
| | | <Form.Item label="抽屉方向"> |
| | | {getFieldDecorator('placement', { |
| | | initialValue: config.setting.placement || 'right' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="modal">模态框</Radio> |
| | | <Radio value="prompt">是否框</Radio> |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}}> |
| | | <Radio value="right">右侧</Radio> |
| | | <Radio value="left">左侧</Radio> |
| | | <Radio value="top">上侧</Radio> |
| | | <Radio value="bottom">下侧</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Col> : null} |
| | | </Row> |
| | | </Form> |
| | | ) |