| | |
| | | icon: this.props.config.setting.icon || '', |
| | | appType: sessionStorage.getItem('appType'), |
| | | viewType: sessionStorage.getItem('editMenuType') || '', |
| | | dialogInput: false |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config } = this.props |
| | | const { appType, display } = this.state |
| | | let fields = [] |
| | | let dialogInput = null |
| | | |
| | | config.fields.forEach(f => { |
| | | if (f.field && ['select', 'link', 'text', 'number', 'textarea'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') { |
| | | fields.push(f) |
| | | } |
| | | if (f.field && f.hidden !== 'true' && f.readonly !== 'true') { |
| | | if (dialogInput === null) { |
| | | dialogInput = ['text', 'number'].includes(f.type) |
| | | } else { |
| | | dialogInput = false |
| | | } |
| | | } |
| | | }) |
| | | |
| | |
| | | |
| | | this.setState({ |
| | | fields: fields, |
| | | display: _display, |
| | | dialogInput |
| | | display: _display |
| | | }) |
| | | } |
| | | |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {appType !== 'mob' ? <Col span={12}> |
| | | <Form.Item label="表单类型"> |
| | | {appType !== 'mob' && (display === 'drawer' || display === 'modal') ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="选择查看时表单均为只读,仅用于数据展示。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 表单类型 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('formType', { |
| | | initialValue: config.setting.formType || 'edit' |
| | | })( |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {display === 'prompt' ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="提示框的确认提示信息。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 确认提示 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('tipTitle', { |
| | | initialValue: config.setting.tipTitle || '' |
| | | })( |
| | | <Input autoComplete="off" onPressEnter={this.handleSubmit} /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {!this.props.isSubTab && !appType && this.state.viewType !== 'popview' && display === 'modal' ? <Col span={12}> |
| | | <Form.Item label="挂载对象"> |
| | | {getFieldDecorator('container', { |