Commit b04b3d61 authored by chenshouchao's avatar chenshouchao

feat: 优化保存模板时的错误提示

parent 857556d6
...@@ -51,7 +51,8 @@ const FlowNode = (props: any) => { ...@@ -51,7 +51,8 @@ const FlowNode = (props: any) => {
return ( return (
(parameters?.length && (parameters?.length &&
parameters?.filter((item: any) => { parameters?.filter((item: any) => {
return item.parameterGroup === "in" && !item?.thrown; return item.parameterGroup === "in";
// return item.parameterGroup === "in" && !item?.thrown;
})) || })) ||
[] []
); );
...@@ -62,7 +63,8 @@ const FlowNode = (props: any) => { ...@@ -62,7 +63,8 @@ const FlowNode = (props: any) => {
return ( return (
(parameters?.length && (parameters?.length &&
parameters?.filter((item: any) => { parameters?.filter((item: any) => {
return item.parameterGroup === "out" && !item?.thrown; return item.parameterGroup === "out";
// return item.parameterGroup === "out" && !item?.thrown;
})) || })) ||
[] []
); );
......
...@@ -143,8 +143,9 @@ const WorkFlowEdit = observer((props: IProps) => { ...@@ -143,8 +143,9 @@ const WorkFlowEdit = observer((props: IProps) => {
return; return;
} }
let templateConfigInfoClone: ITask[] = _.cloneDeep(templateConfigInfo); let templateConfigInfoClone: ITask[] = _.cloneDeep(templateConfigInfo);
let check = true; let tasksIsCheck = true; // 整体校验
templateConfigInfoClone.forEach((task) => { templateConfigInfoClone.forEach((task) => {
let taskIsCheck = true; // 单个task校验
task.parameters.forEach((parameter) => { task.parameters.forEach((parameter) => {
if (task.type === "BATCH" && parameter.thrown) { if (task.type === "BATCH" && parameter.thrown) {
return; return;
...@@ -153,12 +154,14 @@ const WorkFlowEdit = observer((props: IProps) => { ...@@ -153,12 +154,14 @@ const WorkFlowEdit = observer((props: IProps) => {
parameter.error = checkResult.error; parameter.error = checkResult.error;
parameter.helperText = checkResult.helperText; parameter.helperText = checkResult.helperText;
if (checkResult.error) { if (checkResult.error) {
check = false; taskIsCheck = false;
tasksIsCheck = false;
} }
}); });
task.isCheck = taskIsCheck;
}); });
setTemplateConfigInfo(templateConfigInfoClone); setTemplateConfigInfo(templateConfigInfoClone);
if (!check) { if (!tasksIsCheck) {
Message.error("工作流校验未通过,请检查!"); Message.error("工作流校验未通过,请检查!");
} else { } else {
setSaveFormDialog(true); setSaveFormDialog(true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment