diff --git a/packages/amis-editor/src/renderer/event-control/actionsPanelPlugins/serverActionsPanel/ajax.tsx b/packages/amis-editor/src/renderer/event-control/actionsPanelPlugins/serverActionsPanel/ajax.tsx index 85a9ebfea..1f514c6ca 100644 --- a/packages/amis-editor/src/renderer/event-control/actionsPanelPlugins/serverActionsPanel/ajax.tsx +++ b/packages/amis-editor/src/renderer/event-control/actionsPanelPlugins/serverActionsPanel/ajax.tsx @@ -24,53 +24,55 @@ registerActionPanel('ajax', { ); }, - schema: { - type: 'wrapper', - className: 'p-none', - body: [ - getSchemaTpl('apiControl', { - name: 'api', - label: '配置请求', - mode: 'horizontal', - size: 'lg', - inputClassName: 'm-b-none', - renderLabel: true, - required: true - }), - { - name: 'options', - type: 'combo', - label: tipedLabel( - '静默请求', - '开启后,服务请求将以静默模式发送,即不会弹出成功或报错提示。' - ), - mode: 'horizontal', - items: [ - { - type: 'switch', - name: 'silent', - label: false, - onText: '开启', - offText: '关闭', - mode: 'horizontal', - pipeIn: defaultValue(false) - } - ] - }, - { - name: 'outputVar', - type: 'input-text', - label: '请求结果', - placeholder: '请输入存储请求结果的变量名称', - description: - '如需执行多次发送请求,可以修改此变量名用于区分不同请求返回的结果', - mode: 'horizontal', - size: 'lg', - value: 'responseResult', - required: true - } - ] - }, + schema: () => [ + { + type: 'wrapper', + className: 'p-none', + body: [ + getSchemaTpl('apiControl', { + name: 'api', + label: '配置请求', + mode: 'horizontal', + size: 'lg', + inputClassName: 'm-b-none', + renderLabel: true, + required: true + }), + { + name: 'options', + type: 'combo', + label: tipedLabel( + '静默请求', + '开启后,服务请求将以静默模式发送,即不会弹出成功或报错提示。' + ), + mode: 'horizontal', + items: [ + { + type: 'switch', + name: 'silent', + label: false, + onText: '开启', + offText: '关闭', + mode: 'horizontal', + pipeIn: defaultValue(false) + } + ] + }, + { + name: 'outputVar', + type: 'input-text', + label: '请求结果', + placeholder: '请输入存储请求结果的变量名称', + description: + '如需执行多次发送请求,可以修改此变量名用于区分不同请求返回的结果', + mode: 'horizontal', + size: 'lg', + value: 'responseResult', + required: true + } + ] + } + ], outputVarDataSchema: [ { type: 'object',