开放更多配置

This commit is contained in:
2betop 2020-05-14 11:23:44 +08:00
parent d4155c02fb
commit 50b4adcf9d
2 changed files with 9 additions and 3 deletions

View File

@ -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';

View File

@ -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<any>;
searchable?: boolean;
searchApi?: Api; // todo 通过传递进去 onSearch 实现。
searchApi?: Api;
}
@OptionsControl({
@ -145,7 +146,7 @@ export class TransferRenderer extends React.Component<TransferProps> {
columns,
loading,
searchable,
searchApi
searchResultMode
} = this.props;
return (
@ -157,6 +158,7 @@ export class TransferRenderer extends React.Component<TransferProps> {
option2value={this.option2value}
sortable={sortable}
selectMode={selectMode}
searchResultMode={searchResultMode}
columns={columns}
onSearch={searchable ? this.handleSearch : undefined}
/>