Commit b04b3d61 authored by chenshouchao's avatar chenshouchao

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

parent 857556d6
......@@ -51,7 +51,8 @@ const FlowNode = (props: any) => {
return (
(parameters?.length &&
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) => {
return (
(parameters?.length &&
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) => {
return;
}
let templateConfigInfoClone: ITask[] = _.cloneDeep(templateConfigInfo);
let check = true;
let tasksIsCheck = true; // 整体校验
templateConfigInfoClone.forEach((task) => {
let taskIsCheck = true; // 单个task校验
task.parameters.forEach((parameter) => {
if (task.type === "BATCH" && parameter.thrown) {
return;
......@@ -153,12 +154,14 @@ const WorkFlowEdit = observer((props: IProps) => {
parameter.error = checkResult.error;
parameter.helperText = checkResult.helperText;
if (checkResult.error) {
check = false;
taskIsCheck = false;
tasksIsCheck = false;
}
});
task.isCheck = taskIsCheck;
});
setTemplateConfigInfo(templateConfigInfoClone);
if (!check) {
if (!tasksIsCheck) {
Message.error("工作流校验未通过,请检查!");
} else {
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