diff --git a/examples/components/SchemaRender.jsx b/examples/components/SchemaRender.jsx index 183cdbf3..e7e0a39c 100644 --- a/examples/components/SchemaRender.jsx +++ b/examples/components/SchemaRender.jsx @@ -14,7 +14,7 @@ function loadEditor() { resolve(component.default)) ); } -export default function(schema) { +export default function (schema) { if (!schema['$schema']) { schema = { $schema: 'https://houtai.baidu.com/v2/schemas/page.json', @@ -96,6 +96,10 @@ export default function(schema) { config = config || {}; config.headers = headers || {}; + if (config.cancelExecutor) { + config.cancelToken = new axios.CancelToken(config.cancelExecutor); + } + if (data && data instanceof FormData) { // config.headers = config.headers || {}; // config.headers['Content-Type'] = 'multipart/form-data'; diff --git a/src/renderers/Form/Transfer.tsx b/src/renderers/Form/Transfer.tsx index 1e59a4df..c84a0ad3 100644 --- a/src/renderers/Form/Transfer.tsx +++ b/src/renderers/Form/Transfer.tsx @@ -16,9 +16,10 @@ import {optionValueCompare} from '../../components/Select'; export interface TransferProps extends OptionsControlProps { sortable?: boolean; selectMode?: 'table' | 'list' | 'tree'; + searchResultMode?: 'table' | 'list' | 'tree'; columns?: Array; searchable?: boolean; - searchApi?: Api; // todo 通过传递进去 onSearch 实现。 + searchApi?: Api; } @OptionsControl({ @@ -145,7 +146,7 @@ export class TransferRenderer extends React.Component { columns, loading, searchable, - searchApi + searchResultMode } = this.props; return ( @@ -157,6 +158,7 @@ export class TransferRenderer extends React.Component { option2value={this.option2value} sortable={sortable} selectMode={selectMode} + searchResultMode={searchResultMode} columns={columns} onSearch={searchable ? this.handleSearch : undefined} />