Commit 04ddd5cd authored by chenshouchao's avatar chenshouchao

Merge branch 'feat-20220801' into 'release'

Feat 20220801

See merge request !61
parents b3565326 1f1d2f75
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
import { Tooltip, TooltipProps } from "@mui/material"; import { Tooltip, TooltipProps } from "@mui/material";
import { ThemeProvider, createTheme } from "@mui/material/styles"; import { ThemeProvider, createTheme } from "@mui/material/styles";
interface IMyTooltipProps extends TooltipProps { interface IMyTooltipProps extends Omit<TooltipProps, "title"> {
title: string; title?: string | boolean;
} }
const theme = createTheme({ const theme = createTheme({
...@@ -33,7 +33,7 @@ const theme = createTheme({ ...@@ -33,7 +33,7 @@ const theme = createTheme({
}); });
const MyTooltip = (props: IMyTooltipProps) => { const MyTooltip = (props: IMyTooltipProps) => {
const { title, children, placement = "top", ...other } = props; const { title = false, children, placement = "top", ...other } = props;
return ( return (
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<Tooltip <Tooltip
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:18:13 * @Date: 2022-05-31 10:18:13
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-10 11:06:12 * @LastEditTime: 2022-08-16 15:53:31
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx * @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -115,7 +115,7 @@ const Tabs = (props: IProps) => { ...@@ -115,7 +115,7 @@ const Tabs = (props: IProps) => {
return ( return (
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<TabContext value={value}> <TabContext value={value}>
<Box sx={{ borderBottom: 1, borderColor: "#EDEFF2" }}> <Box sx={{ borderBottom: 1, borderColor: "#dde1e6" }}>
<TabList <TabList
onChange={(e: any, val: string) => { onChange={(e: any, val: string) => {
onChange(val); onChange(val);
......
...@@ -37,5 +37,5 @@ ...@@ -37,5 +37,5 @@
.active { .active {
border-left: 3px solid #1370ff; border-left: 3px solid #1370ff;
color: #1370ff; color: #1370ff;
background-color: #ebedf0; background-color: #e6eaf0;
} }
...@@ -239,10 +239,6 @@ const UpLoaderFile = observer((props: IMoveFileProps) => { ...@@ -239,10 +239,6 @@ const UpLoaderFile = observer((props: IMoveFileProps) => {
// lineHeight: "20px", // lineHeight: "20px",
// color: "#8A9099", // color: "#8A9099",
// }} // }}
tableBodySx={{
backgroundColor:
fileList.length >= 10 ? "rgba(255, 0, 0, 0.6)" : "",
}}
tableContainerStyle={{ tableContainerStyle={{
maxHeight: "300px", maxHeight: "300px",
}} }}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-21 20:03:56 * @Date: 2022-06-21 20:03:56
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-08 16:41:20 * @LastEditTime: 2022-08-17 10:58:02
* @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/index.tsx * @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -222,7 +222,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -222,7 +222,7 @@ const ProjectSubmitWork = observer(() => {
promotedParameters, promotedParameters,
}); });
} else { } else {
Message.error("请完善左侧表单再提交"); Message.error("请完善算子信息后提交任务");
} }
}; };
......
...@@ -411,7 +411,7 @@ const ProjectMembers = observer(() => { ...@@ -411,7 +411,7 @@ const ProjectMembers = observer(() => {
<Box className={styles.tabBoxMiddle}> <Box className={styles.tabBoxMiddle}>
<img alt="" src={jobCost} /> <img alt="" src={jobCost} />
<div className={styles.tabBoxTime}> <div className={styles.tabBoxTime}>
{item.jobCost.toFixed(2)} {item.jobCost ? item.jobCost.toFixed(2) : "--"}
</div> </div>
</Box> </Box>
<Box className={styles.tabBoxJobStatus}> <Box className={styles.tabBoxJobStatus}>
......
...@@ -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;
})) || })) ||
[] []
); );
......
...@@ -77,7 +77,7 @@ const Flow = (props: IProps) => { ...@@ -77,7 +77,7 @@ const Flow = (props: IProps) => {
/** 原始数据删除线 */ /** 原始数据删除线 */
const tasksDeleteLine = useCallback( const tasksDeleteLine = useCallback(
(connection: Connection | Edge | any) => { (connection: Connection | Edge | any) => {
const result = let result =
(tasks?.length && (tasks?.length &&
tasks.map((item) => { tasks.map((item) => {
/** 删除batch起始的edges中的一项 === 等于删除了一根连线 */ /** 删除batch起始的edges中的一项 === 等于删除了一根连线 */
...@@ -123,6 +123,45 @@ const Flow = (props: IProps) => { ...@@ -123,6 +123,45 @@ const Flow = (props: IProps) => {
} }
})) || })) ||
[]; [];
// 更新批节点下对应流节点的hidden和错误提示
result = result.map((task) => {
if (task.parentNode === connection.target) {
let isCheck = true;
const parametersChange = task.parameters.map((parameter) => {
if (parameter.name === connection.targetHandle) {
const { error, helperText } =
getCustomTemplateParameterCheckResult({
...parameter,
linked: false,
hidden: false,
});
return {
...parameter,
hidden: false,
linked: false,
error,
helperText,
};
} else {
return parameter;
}
});
parametersChange.forEach((parameter) => {
if (
getCustomTemplateParameterCheckResult(parameter).error === true
) {
isCheck = false;
}
});
return {
...task,
isCheck,
parameters: parametersChange,
};
} else {
return task;
}
});
return result; return result;
}, },
[tasks] [tasks]
...@@ -472,7 +511,7 @@ const Flow = (props: IProps) => { ...@@ -472,7 +511,7 @@ const Flow = (props: IProps) => {
/** 连接校验并修改值 */ /** 连接校验并修改值 */
const connectCheck = useCallback( const connectCheck = useCallback(
(connection: Connection) => { (connection: Connection) => {
const newVal = let newVal =
(tasks?.length && (tasks?.length &&
tasks?.map((item) => { tasks?.map((item) => {
if (item.id === connection.source) { if (item.id === connection.source) {
...@@ -499,6 +538,46 @@ const Flow = (props: IProps) => { ...@@ -499,6 +538,46 @@ const Flow = (props: IProps) => {
} }
})) || })) ||
[]; [];
// 更新批节点下对应流节点的hidden和错误提示
newVal = newVal.map((task) => {
if (task.parentNode === connection.target) {
let isCheck = true; // 红点校验
let parametersChange = task.parameters.map((parameter) => {
if (parameter.name === connection.targetHandle) {
const { error, helperText } =
getCustomTemplateParameterCheckResult({
...parameter,
linked: true,
hidden: true,
});
return {
...parameter,
hidden: true,
linked: true,
error,
helperText,
};
} else {
return parameter;
}
});
parametersChange.forEach((parameter) => {
if (
getCustomTemplateParameterCheckResult(parameter).error === true
) {
isCheck = false;
}
});
return {
...task,
isCheck,
parameters: parametersChange,
};
} else {
return task;
}
});
return newVal; return newVal;
}, },
[connectModifyParameters, tasks] [connectModifyParameters, tasks]
......
...@@ -67,6 +67,12 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -67,6 +67,12 @@ const ParameterSetting = (props: IParameterSettingProps) => {
/** 通过parameter.name删除与之相关联的线 */ /** 通过parameter.name删除与之相关联的线 */
const handleHiddenDeleteEdge = useCallback( const handleHiddenDeleteEdge = useCallback(
(val: ITask[], parameterName: string) => { (val: ITask[], parameterName: string) => {
let taskParentNode = "";
val.forEach((task) => {
if (task.id === taskId) {
taskParentNode = task.parentNode || "";
}
});
return ( return (
val?.length && val?.length &&
val?.map((item) => { val?.map((item) => {
...@@ -92,7 +98,11 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -92,7 +98,11 @@ const ParameterSetting = (props: IParameterSettingProps) => {
const newEdges = const newEdges =
(item?.edges?.length && (item?.edges?.length &&
item?.edges?.filter((every) => { item?.edges?.filter((every) => {
return every.targetHandle !== parameterName; // 因为存在同名的parameterName 所以增加every.source === taskParentNode判断
return (
every.targetHandle !== parameterName ||
every.source === taskParentNode
);
})) || })) ||
[]; [];
return { return {
......
...@@ -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