mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 11:07:52 +08:00
fix: 修复api适配器回显问题 (#8261)
* fix: 默认值回调函数支持select选项配置 * fix: 修复api适配器回显问题 --------- Co-authored-by: wutong25 <wutong25@baidu.com>
This commit is contained in:
parent
753ed430ca
commit
ef97dab580
@ -115,6 +115,7 @@ export default class APIAdaptorControl extends React.Component<
|
||||
'api-adaptor-control-editor',
|
||||
{
|
||||
type: 'ae-functionEditorControl',
|
||||
name: 'functionEditorControl',
|
||||
placeholder: editorPlaceholder,
|
||||
desc: editorDesc,
|
||||
allowFullscreen,
|
||||
|
@ -136,11 +136,11 @@ export default class FunctionEditorControl extends React.Component<
|
||||
body: '<span class="mtk1 bracket-highlighting-0">}</span>',
|
||||
className: 'ae-FunctionEditorControl-func-footer'
|
||||
})}
|
||||
{render('api-function-editor-control-editor/3', {
|
||||
{/* {render('api-function-editor-control-editor/3', {
|
||||
type: 'container',
|
||||
className: 'cxd-Form-description',
|
||||
body: desc
|
||||
})}
|
||||
})} */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ import reduce from 'lodash/reduce';
|
||||
import map from 'lodash/map';
|
||||
import omit from 'lodash/omit';
|
||||
import keys from 'lodash/keys';
|
||||
import type {Schema} from 'amis';
|
||||
|
||||
import type {DSField} from '../builder';
|
||||
|
||||
@ -451,12 +452,19 @@ setSchemaTpl(
|
||||
} = config || {};
|
||||
let curRendererSchema = rendererSchema;
|
||||
|
||||
if (useSelectMode && curRendererSchema && curRendererSchema.options) {
|
||||
if (useSelectMode && curRendererSchema) {
|
||||
if (typeof curRendererSchema === 'function') {
|
||||
curRendererSchema = (schema: Schema) => ({
|
||||
...rendererSchema(schema),
|
||||
type: 'select'
|
||||
});
|
||||
} else if (curRendererSchema.options) {
|
||||
curRendererSchema = {
|
||||
...curRendererSchema,
|
||||
type: 'select'
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
type: 'group',
|
||||
|
Loading…
Reference in New Issue
Block a user