| | |
| | | |
| | | class SettingForm extends Component { |
| | | static propTpyes = { |
| | | btnType: PropTypes.any, |
| | | setting: PropTypes.object, // 数据源配置 |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { setting } = this.props |
| | | const { setting, btnType } = this.props |
| | | |
| | | this.setState({ |
| | | dataType: setting.dataType, |
| | | dataType: btnType === 'print' ? 'custom' : setting.dataType, |
| | | defaultSql: setting.defaultSql || 'true' |
| | | }) |
| | | } |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { setting } = this.props |
| | | const { setting, btnType } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { dataType, defaultSql } = this.state |
| | | |
| | |
| | | <div className="excelout-datasource-wrap"> |
| | | <Form {...formItemLayout}> |
| | | <Row gutter={24}> |
| | | <Col span={8}> |
| | | {btnType !== 'print' ? <Col span={8}> |
| | | <Form.Item label="导出数据"> |
| | | {getFieldDecorator('dataType', { |
| | | initialValue: setting.dataType |
| | |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Col> : null} |
| | | {dataType === 'custom' ? <Col className="short-label" span={8}> |
| | | <Form.Item label="表名"> |
| | | {getFieldDecorator('tableName', { |
| | |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {dataType === 'custom' && defaultSql === 'true' ? <Col className="short-label" span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="排序方式为空时,使用表格或组件中的排序方式。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 排序方式 |
| | | </Tooltip> |
| | | }> |
| | | <Form.Item label="排序方式"> |
| | | {getFieldDecorator('order', { |
| | | initialValue: setting.order || '', |
| | | rules: [ |
| | |
| | | })(<Input placeholder={'ID asc, UID desc'} autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {dataType === 'custom' ? <Col span={8}> |
| | | {dataType === 'custom' && btnType !== 'print' ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="不使用搜索条件时,不会进行搜索条件的拼接与相关统计字段的替换。注:自定义数据来源时,只使用内部搜索。"> |
| | | <Tooltip placement="topLeft" title="不使用搜索条件时,不会进行搜索条件的拼接与相关统计字段的替换。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 搜索条件 |
| | | </Tooltip> |