diff --git a/.gitignore b/.gitignore index b737846..95adf9c 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ yarn-error.log* # css src/**/*.css build +build.zip diff --git a/src/components/editor/Importer.tsx b/src/components/editor/Importer.tsx index 291e772..12b7fbc 100644 --- a/src/components/editor/Importer.tsx +++ b/src/components/editor/Importer.tsx @@ -118,7 +118,7 @@ class Importer extends Component { }; // 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 { } } } - 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, diff --git a/src/components/editor/InterfaceEditor.tsx b/src/components/editor/InterfaceEditor.tsx index 846e89a..1d19bca 100644 --- a/src/components/editor/InterfaceEditor.tsx +++ b/src/components/editor/InterfaceEditor.tsx @@ -128,6 +128,7 @@ class InterfaceEditor extends Component< bodyOption={this.state.summaryState.bodyOption} requestParamsType={this.state.summaryState.requestParamsType} handleChangeProperty={this.handleChangeProperty} + handleDeleteMemoryProperty={this.handleDeleteMemoryProperty} /> { } handleDeleteMemoryProperty = (e: any, property: any) => { e.preventDefault() - const { handleDeleteMemoryProperty } = this.context + const { handleDeleteMemoryProperty } = this.props handleDeleteMemoryProperty(property) } handleSortProperties = (_: any, sortable: any) => {