| | |
| | | } |
| | | |
| | | state = { |
| | | fields: null |
| | | fields: null, |
| | | appType: sessionStorage.getItem('appType') |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config } = this.props |
| | | let fields = [] |
| | | |
| | | if (config.groups.length > 0) { |
| | | config.groups.forEach(group => { |
| | | group.sublist.forEach(item => { |
| | | if (item.field && (item.type === 'text' || item.type === 'number') && item.hidden !== 'true' && item.readonly !== 'true') { |
| | | fields.push(item) |
| | | } |
| | | }) |
| | | }) |
| | | } else if (config.fields.length > 0) { |
| | | config.fields.forEach(f => { |
| | | if (f.field && (f.type === 'text' || f.type === 'number') && f.hidden !== 'true' && f.readonly !== 'true') { |
| | | if (f.field && ['select', 'link', 'text', 'number'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') { |
| | | fields.push(f) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | fields: fields |
| | |
| | | |
| | | render() { |
| | | const { config, dict } = this.props |
| | | const { fields } = this.state |
| | | const { fields, appType } = this.state |
| | | const { getFieldDecorator } = this.props.form |
| | | |
| | | const formItemLayout = { |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label="列数"> |
| | | {getFieldDecorator('cols', { |
| | | initialValue: config.setting.cols || '2' |
| | | <Form.Item label="表单排列"> |
| | | {getFieldDecorator('align', { |
| | | initialValue: config.setting.align || 'left_right' |
| | | })( |
| | | <Select> |
| | | <Select.Option value="1">1列</Select.Option> |
| | | <Select.Option value="2">2列</Select.Option> |
| | | <Select.Option value="3">3列</Select.Option> |
| | | <Select.Option value="4">4列</Select.Option> |
| | | </Select> |
| | | <Radio.Group> |
| | | <Radio value="left_right">左右</Radio> |
| | | <Radio value="up_down">上下</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {!this.props.isSubTab ? <Col span={12}> |
| | | {!this.props.isSubTab && appType !== 'pc' ? <Col span={12}> |
| | | <Form.Item label="挂载对象"> |
| | | {getFieldDecorator('container', { |
| | | initialValue: config.setting.container || 'tab' |