|
|
@@ -7,11 +7,12 @@ const FormItem = Form.Item
|
|
|
const { Option } = Select
|
|
|
|
|
|
class baseConfigForm extends React.Component {
|
|
|
+ componentDidMount() {
|
|
|
+ this.props.dispatch({ type: 'dataSource/fetchList' });
|
|
|
+ }
|
|
|
render() {
|
|
|
const props = this.props;
|
|
|
- const { formItemLayout } = props
|
|
|
-
|
|
|
- const { chartDesigner } = this.props;
|
|
|
+ const { formItemLayout, dataSource, chartDesigner } = props
|
|
|
const { baseConfig } = chartDesigner;
|
|
|
|
|
|
return (
|
|
|
@@ -28,7 +29,7 @@ class baseConfigForm extends React.Component {
|
|
|
});
|
|
|
}}
|
|
|
>
|
|
|
- <Option value={baseConfig.dataSource.code}>{baseConfig.dataSource.name}</Option>
|
|
|
+ {dataSource.list.map(l => <Option key={l.code} value={l.code}>{l.name}</Option>)}
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
<FormItem label='可视化模式' {...formItemLayout}>
|
|
|
@@ -63,8 +64,8 @@ class baseConfigForm extends React.Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function mapStateToProps({ present: { chartDesigner } }) {
|
|
|
- return { chartDesigner }
|
|
|
+function mapStateToProps({ present: { dataSource, chartDesigner } }) {
|
|
|
+ return { dataSource, chartDesigner }
|
|
|
}
|
|
|
|
|
|
export default Form.create()(connect(mapStateToProps)(baseConfigForm));
|