feat:表单校验和提交动作面板支持配置结果存储

This commit is contained in:
lvxiaojiao 2023-07-17 15:08:10 +08:00
parent 62aa19af38
commit 30b3754be2

View File

@ -780,7 +780,7 @@ export const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
{
name: 'outputVar',
type: 'input-text',
label: '存储结果',
label: '请求结果',
placeholder: '请输入存储请求结果的变量名称',
description:
'如需执行多次发送请求,可以修改此变量名用于区分不同请求返回的结果',
@ -1588,7 +1588,45 @@ export const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
);
},
supportComponents: 'form',
schema: renderCmptSelect('目标组件', true)
schema: [
...renderCmptSelect('目标组件', true),
{
name: 'outputVar',
type: 'input-text',
label: '提交结果',
placeholder: '请输入存储提交结果的变量名称',
description:
'如需执行多次表单提交,可以修改此变量名用于区分不同的提交结果',
mode: 'horizontal',
size: 'lg',
value: 'submitResult',
required: true
}
],
outputVarDataSchema: [
{
type: 'object',
title: 'submitResult',
properties: {
error: {
type: 'string',
title: '错误提示'
},
errors: {
type: 'object',
title: '错误信息'
},
payload: {
type: 'object',
title: '提交的表单数据'
},
responseData: {
type: 'object',
title: '提交请求返回的响应结果数据'
}
}
}
]
},
{
actionLabel: '清空表单',
@ -1642,7 +1680,41 @@ export const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
);
},
supportComponents: 'form',
schema: renderCmptSelect('目标组件', true)
schema: [
...renderCmptSelect('目标组件', true),
{
name: 'outputVar',
type: 'input-text',
label: '校验结果',
placeholder: '请输入存储校验结果的变量名称',
description:
'如需执行多次表单校验,可以修改此变量名用于区分不同的校验结果',
mode: 'horizontal',
size: 'lg',
value: 'validateResult',
required: true
}
],
outputVarDataSchema: [
{
type: 'object',
title: 'validateResult',
properties: {
error: {
type: 'string',
title: '错误提示'
},
errors: {
type: 'object',
title: '错误信息'
},
payload: {
type: 'object',
title: '提交的表单数据'
}
}
}
]
},
{
actionLabel: '组件特性动作',