|
|
@@ -19,7 +19,7 @@ class Schema extends Component {
|
|
|
this.state = {
|
|
|
currentSchema: '',
|
|
|
currentTable: '',
|
|
|
- schemaID: 'schema_1542175090046_77378701',
|
|
|
+ schemaID: '',
|
|
|
userID: 'xy_1'
|
|
|
};
|
|
|
}
|
|
|
@@ -28,9 +28,10 @@ class Schema extends Component {
|
|
|
|
|
|
findRemark = data => this.state.currentTable === '' ? '' : data.find(table => table.name === this.state.currentTable) ? data.find(table => table.name === this.state.currentTable).remark : '';
|
|
|
|
|
|
- switchSchema = (schema) => {
|
|
|
+ switchSchema = (name, id) => {
|
|
|
this.setState({
|
|
|
- currentSchema: schema
|
|
|
+ currentSchema: name,
|
|
|
+ schemaID: id
|
|
|
});
|
|
|
};
|
|
|
|
|
|
@@ -52,7 +53,8 @@ class Schema extends Component {
|
|
|
<ShowSchemaList
|
|
|
userID={this.state.userID}
|
|
|
switchTable={this.switchTable}
|
|
|
- switchSchema={this.switchSchema}/>
|
|
|
+ switchSchema={this.switchSchema}
|
|
|
+ />
|
|
|
</Col>
|
|
|
|
|
|
<Col span={17} offset={1}>
|
|
|
@@ -188,8 +190,7 @@ class ShowSchemaList extends Component {
|
|
|
data.schema_by_props.map((schema) => {
|
|
|
return <div key={schema.schemaName} className='title'
|
|
|
onClick={() => {
|
|
|
- this.props.switchSchema(schema.schemaName)
|
|
|
-
|
|
|
+ this.props.switchSchema(schema.schemaName, schema.id);
|
|
|
}}>
|
|
|
<Row>
|
|
|
<Col span={20}>{schema.schemaName}</Col>
|