|
@@ -27,13 +27,6 @@ export default class DatasourceNodeInfo extends React.Component<any, any> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- componentDidUpdate(prevProps: Readonly<any>, prevState: Readonly<any>, snapshot?: any){
|
|
|
- (this.formRef.current as any).setFieldsValue({
|
|
|
- inputDatasource: this.state.inputFields
|
|
|
- })
|
|
|
- this.props.nodeInfo.inputSource = this.state.inputFields
|
|
|
- }
|
|
|
-
|
|
|
render() {
|
|
|
return (
|
|
|
<div className='node-datasource'>
|
|
@@ -50,33 +43,37 @@ export default class DatasourceNodeInfo extends React.Component<any, any> {
|
|
|
<Form.Item name='dataTable' style={{width: '80%', marginTop: '5px'}}>
|
|
|
<Select options={this.state.debugTable.map((item: any) => {
|
|
|
return {label: item.name, value: item.id}
|
|
|
- })} placeholder='选择调试数据表' onSelect={(val: any) => {
|
|
|
+ })} placeholder='选择调试数据表'
|
|
|
+ onSelect={(val: any) => {
|
|
|
this.props.nodeInfo.dataTable = val
|
|
|
switch(val) {
|
|
|
case 4:
|
|
|
- this.setState({inputFields: [
|
|
|
+ this.props.nodeInfo.inputSource = [
|
|
|
{dataSelect: true, dataField: 'name', dataType: 'string'},
|
|
|
{dataSelect: true, dataField: 'address', dataType: 'string'},
|
|
|
{dataSelect: false, dataField: 'age', dataType: 'int'},
|
|
|
- ]})
|
|
|
+ ]
|
|
|
break
|
|
|
case 5:
|
|
|
- this.setState({inputFields: [
|
|
|
+ this.props.nodeInfo.inputSource = [
|
|
|
{dataSelect: false, dataField: 'name', dataType: 'string'},
|
|
|
{dataSelect: true, dataField: 'address', dataType: 'string'},
|
|
|
- ]})
|
|
|
+ ]
|
|
|
break
|
|
|
case 6:
|
|
|
- this.setState({inputFields: [
|
|
|
+ this.props.nodeInfo.inputSource = [
|
|
|
{dataSelect: true, dataField: 'name', dataType: 'string'},
|
|
|
- ]})
|
|
|
+ ]
|
|
|
break
|
|
|
case 7:
|
|
|
- this.setState({inputFields: [
|
|
|
+ this.props.nodeInfo.inputSource = [
|
|
|
{dataSelect: false, dataField: 'name', dataType: 'string'},
|
|
|
- ]})
|
|
|
+ ]
|
|
|
break
|
|
|
}
|
|
|
+ (this.formRef.current as any).setFieldsValue({
|
|
|
+ inputDatasource: this.props.nodeInfo.inputSource
|
|
|
+ })
|
|
|
}}/>
|
|
|
</Form.Item>
|
|
|
<p>输入源:</p>
|
|
@@ -90,7 +87,9 @@ export default class DatasourceNodeInfo extends React.Component<any, any> {
|
|
|
name={[name, 'dataSelect']}
|
|
|
valuePropName="checked"
|
|
|
>
|
|
|
- <Checkbox/>
|
|
|
+ <Checkbox onChange={(e) => {
|
|
|
+ this.props.nodeInfo.inputSource = (this.formRef.current as any).getFieldsValue().inputDatasource
|
|
|
+ }}/>
|
|
|
</Form.Item>
|
|
|
<Form.Item
|
|
|
{...restField}
|