From bd427d3d7fd0c9b9534e123f3d58ece008066a81 Mon Sep 17 00:00:00 2001 From: RickCole21 Date: Fri, 12 Aug 2022 14:55:35 +0800 Subject: [PATCH] =?UTF-8?q?amis-saas-5329=20[Feature]=20=E3=80=8Cfeat?= =?UTF-8?q?=E3=80=8D=E6=9C=8D=E5=8A=A1=E8=B0=83=E7=94=A8=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie6d56075d7143c7d3bc293b18886ea78396c846a --- .../amis-editor/src/plugin/Form/InputFile.tsx | 2 + .../src/renderer/event-control/actions.tsx | 58 +++++++++++++------ 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/packages/amis-editor/src/plugin/Form/InputFile.tsx b/packages/amis-editor/src/plugin/Form/InputFile.tsx index 2b699a283..a449a82a3 100644 --- a/packages/amis-editor/src/plugin/Form/InputFile.tsx +++ b/packages/amis-editor/src/plugin/Form/InputFile.tsx @@ -329,6 +329,8 @@ export class FileControlPlugin extends BasePlugin { '文件接收器', '默认不填写将上传到 bos,可以在系统配置中设置为自己的 bos 地址。' ), + className: 'inputFile-apiControl', + renderLabel: true, value: '/api/upload/file', __isUpload: true, visibleOn: diff --git a/packages/amis-editor/src/renderer/event-control/actions.tsx b/packages/amis-editor/src/renderer/event-control/actions.tsx index 04749f682..9c84af39b 100644 --- a/packages/amis-editor/src/renderer/event-control/actions.tsx +++ b/packages/amis-editor/src/renderer/event-control/actions.tsx @@ -413,7 +413,7 @@ const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => { innerArgs: ['api', 'options'], descDetail: (info: any) => { let apiInfo = info?.args?.api; - if (typeof apiInfo === 'string'){ + if (typeof apiInfo === 'string') { apiInfo = normalizeApi(apiInfo); } return ( @@ -429,7 +429,7 @@ const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => { }, schema: { type: 'wrapper', - className: "p-none", + className: 'p-none', body: [ getArgsWrapper( [ @@ -438,6 +438,8 @@ const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => { label: '配置请求', mode: 'horizontal', size: 'lg', + inputClassName: 'm-b-none', + renderLabel: true, required: true }), { @@ -456,21 +458,27 @@ const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => { remark: { className: 'ae-BaseRemark', icon: 'fa fa-question-circle', - shape: "circle", - placement: "left", - content: '勾选后,服务请求将以静默模式发送,即不会弹出成功或报错提示。' + shape: 'circle', + placement: 'left', + content: + '勾选后,服务请求将以静默模式发送,即不会弹出成功或报错提示。' } } ] } - ] + ], + false, + { + className: 'action-apiControl' + } ), { name: 'outputVar', type: 'input-text', label: '存储结果', placeholder: '请输入存储请求结果的变量名称', - description: '如需执行多次发送请求,可以修改此变量名用于区分不同请求返回的结果', + description: + '如需执行多次发送请求,可以修改此变量名用于区分不同请求返回的结果', mode: 'horizontal', size: 'lg', value: 'responseResult', @@ -513,8 +521,13 @@ const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => { label: '配置请求', mode: 'horizontal', size: 'lg', + renderLabel: true, required: true - }) + }), + false, + { + className: 'action-apiControl' + } ) ] } @@ -617,7 +630,11 @@ const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => { } } ], - supportComponents: ['form', ...FORMITEM_CMPTS, ...SUPPORT_DISABLED_CMPTS], + supportComponents: [ + 'form', + ...FORMITEM_CMPTS, + ...SUPPORT_DISABLED_CMPTS + ], schema: [ ...renderCmptSelect('选择组件', true), { @@ -656,7 +673,7 @@ const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => { ); }, - supportComponents: 'byComponent', + supportComponents: [], schema: renderCmptSelect('选择组件', true) }, { @@ -681,7 +698,7 @@ const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => { ); }, - supportComponents: 'byComponent', + supportComponents: [], schema: [ ...renderCmptActionSelect('选择组件', true), getArgsWrapper({ @@ -702,10 +719,15 @@ const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => { }, { label: '指定序号', - value: 'appoint', + value: 'appoint' } ], - onChange: (value: string, oldVal: any, data: any, form: any) => { + onChange: ( + value: string, + oldVal: any, + data: any, + form: any + ) => { form.setValueByName('index', undefined); form.setValueByName('value', []); form.setValueByName('__valueInput', undefined); @@ -740,7 +762,7 @@ const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => { labelField: 'label', valueField: 'value', required: true, - visibleOn: `data.__rendererName && ${SHOW_SELECT_PROP}`, + visibleOn: `data.__rendererName && ${SHOW_SELECT_PROP}` }, { name: 'key', @@ -794,7 +816,7 @@ const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => { labelField: 'label', valueField: 'name', required: true, - visibleOn: `data.__rendererName && ${SHOW_SELECT_PROP}`, + visibleOn: `data.__rendererName && ${SHOW_SELECT_PROP}` }, { name: 'key', @@ -927,9 +949,7 @@ const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => { return (
复制内容: - - {info?.args?.content} - + {info?.args?.content}
); }, @@ -1048,4 +1068,4 @@ doAction({ ]; }; -export default ACTION_TYPE_TREE; \ No newline at end of file +export default ACTION_TYPE_TREE;