fix import bug

test 2.1.3
huoyong.msb 6 years ago
parent 52f7b616bf
commit 3c1c5f5cfa

1
.gitignore vendored

@ -16,3 +16,4 @@ yarn-error.log*
# css
src/**/*.css
build
build.zip

@ -118,7 +118,7 @@ class Importer extends Component<ImporterProps, ImporterState> {
};
// TODO 2.1 待完整测试各种输入
// DONE 2.1 BUG 类型 Number初始值 '',被解析为随机字符串
handleJSONSchema = (schema: any, parent = { id: '-1' }, memoryProperties: any, siblings?: any) => {
handleJSONSchema = (schema: any, parent = { id: -1 }, memoryProperties: any, siblings?: any) => {
if (!schema) { return }
const { auth, repository, mod, itf, scope } = this.props
const hasSiblings = siblings instanceof Array && siblings.length > 0
@ -153,7 +153,23 @@ class Importer extends Component<ImporterProps, ImporterState> {
}
}
}
const property = Object.assign(
type Property = {
name: any;
type: any;
rule: string;
value: any;
descripton: string;
creator: any;
repositoryId: any;
moduleId: any;
interfaceId: any;
scope: any;
parentId: number;
memory: boolean;
id: any;
}
const property: Property = Object.assign(
{
name: schema.name,
type,

@ -128,6 +128,7 @@ class InterfaceEditor extends Component<
bodyOption={this.state.summaryState.bodyOption}
requestParamsType={this.state.summaryState.requestParamsType}
handleChangeProperty={this.handleChangeProperty}
handleDeleteMemoryProperty={this.handleDeleteMemoryProperty}
/>
<ResponsePropertyList
properties={this.state.properties}
@ -136,6 +137,7 @@ class InterfaceEditor extends Component<
mod={mod}
itf={this.state.itf}
handleChangeProperty={this.handleChangeProperty}
handleDeleteMemoryProperty={this.handleDeleteMemoryProperty}
/>
<RModal
when={this.state.moveInterfaceDialogOpen}

@ -295,7 +295,7 @@ class PropertyList extends Component<any, any> {
}
handleDeleteMemoryProperty = (e: any, property: any) => {
e.preventDefault()
const { handleDeleteMemoryProperty } = this.context
const { handleDeleteMemoryProperty } = this.props
handleDeleteMemoryProperty(property)
}
handleSortProperties = (_: any, sortable: any) => {

Loading…
Cancel
Save