Commit f28c1e6c authored by wuyongsheng's avatar wuyongsheng

feat: 自定义算子连线添加接触面

parent b31de9d7
/* /*
* @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: 吴永生#A02208 yongsheng.wu@wholion.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-07-04 20:18:17 * @LastEditTime: 2022-08-09 18:29:51
* @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
*/ */
...@@ -44,6 +44,9 @@ const theme = createTheme({ ...@@ -44,6 +44,9 @@ const theme = createTheme({
minWidth: "20px", minWidth: "20px",
marginRight: "32px", marginRight: "32px",
color: "#8A9099", color: "#8A9099",
":hover": {
color: "#1E2633",
},
selected: { selected: {
color: "#1976d2", color: "#1976d2",
}, },
...@@ -95,7 +98,14 @@ const Tabs = (props: IProps) => { ...@@ -95,7 +98,14 @@ const Tabs = (props: IProps) => {
) : ( ) : (
"" ""
)} )}
<Typography sx={{ fontSize: "14px", lineHeight: "22px", height: "22px", fontWeight: "400" }}> <Typography
sx={{
fontSize: "14px",
lineHeight: "22px",
height: "22px",
fontWeight: "400",
}}
>
{item.label} {item.label}
</Typography> </Typography>
</Box> </Box>
......
/* /*
* @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: 吴永生#A02208 yongsheng.wu@wholion.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-07-20 14:59:52 * @LastEditTime: 2022-08-09 18:28:39
* @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
*/ */
...@@ -124,14 +124,13 @@ const ProjectSubmitWork = observer(() => { ...@@ -124,14 +124,13 @@ const ProjectSubmitWork = observer(() => {
/** 返回事件 */ /** 返回事件 */
const onBack = useCallback(() => { const onBack = useCallback(() => {
const locationInfo: any = location?.state; const locationInfo: any = location?.state;
if(locationInfo.from==='projectOverview'){ if (locationInfo.from === "projectOverview") {
navigate("/product/cadd/projectOverview"); navigate("/product/cadd/projectOverview");
}else{ } else {
navigate("/product/cadd/projectWorkbench", { navigate("/product/cadd/projectWorkbench", {
state: { type: "workbenchList" }, state: { type: "workbenchList" },
}); });
} }
}, [navigate]); }, [navigate]);
const outputPathTransform = (path: string) => { const outputPathTransform = (path: string) => {
...@@ -206,7 +205,8 @@ const ProjectSubmitWork = observer(() => { ...@@ -206,7 +205,8 @@ const ProjectSubmitWork = observer(() => {
if (Array.isArray(res.data)) { if (Array.isArray(res.data)) {
res.data.forEach((item1) => { res.data.forEach((item1) => {
if (item1.name === item.path.slice(item.path.lastIndexOf("/") + 1)) { if (item1.name === item.path.slice(item.path.lastIndexOf("/") + 1)) {
randerOutputs[index].size = `${item1.size ? storageUnitFromB(Number(item1.size)) : "-" randerOutputs[index].size = `${
item1.size ? storageUnitFromB(Number(item1.size)) : "-"
}`; }`;
setRanderOutputs([...randerOutputs]); setRanderOutputs([...randerOutputs]);
} }
...@@ -388,23 +388,10 @@ const ProjectSubmitWork = observer(() => { ...@@ -388,23 +388,10 @@ const ProjectSubmitWork = observer(() => {
{randerOutputs1.map((item, index) => { {randerOutputs1.map((item, index) => {
return ( return (
<div key={index} className={styles.outputLi}> <div key={index} className={styles.outputLi}>
{/* <MyPopconfirm
title="即将跳转至项目数据内该任务的结果目录,确认继续吗?"
onConfirm={() =>
goToProjectData(getFolderPath(item.path))
}
> */}
<div <div
className={styles.outputLiLeft} className={styles.outputLiLeft}
onClick={(e: any) => { onClick={(e: any) => {
// handleShowPopper( goToProjectData(getFolderPath(item.path));
// e,
// "即将跳转至项目数据内该任务的结果目录,确认继续吗?"
// );
// setGoToProjectDataPath(
// getFolderPath(item.path)
// );
goToProjectData(getFolderPath(item.path))
}} }}
> >
<img <img
...@@ -461,8 +448,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -461,8 +448,7 @@ const ProjectSubmitWork = observer(() => {
workFlowJobInfo?.outputPath as string workFlowJobInfo?.outputPath as string
); );
// goToProjectData(workFlowJobInfo?.outputPath as string) // goToProjectData(workFlowJobInfo?.outputPath as string)
} }}
}
> >
{workFlowJobInfo?.outputPath {workFlowJobInfo?.outputPath
? outputPathTransform(workFlowJobInfo?.outputPath) ? outputPathTransform(workFlowJobInfo?.outputPath)
......
/* /*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-21 15:25:25 * @Date: 2022-06-21 15:25:25
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-07-12 14:09:20 * @LastEditTime: 2022-08-09 16:07:33
* @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/WorkFlow/index.tsx * @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/WorkFlow/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
*/ */
import { useEffect } from "react";
import Flow from "../../components/Flow"; import Flow from "../../components/Flow";
import { ITemplateConfig } from "../interface"; import { ITemplateConfig } from "../interface";
...@@ -17,6 +18,21 @@ interface IProps { ...@@ -17,6 +18,21 @@ interface IProps {
const WorkFlow = (props: IProps) => { const WorkFlow = (props: IProps) => {
const { templateConfigInfo, setSelectedBatchNodeId, selectedBatchNodeId } = const { templateConfigInfo, setSelectedBatchNodeId, selectedBatchNodeId } =
props; props;
/** 页面刷新提醒 */
const pageRefreshTips = (e: any) => {
const event: any = window.event || e;
event.returnValue = "是否离开网站?";
};
/** 监听页面刷新事件 */
useEffect(() => {
window.addEventListener("beforeunload", pageRefreshTips, false);
return () => {
window.removeEventListener("beforeunload", pageRefreshTips, false);
};
});
return ( return (
<Flow <Flow
tasks={templateConfigInfo?.tasks} tasks={templateConfigInfo?.tasks}
......
...@@ -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-07-26 18:34:46 * @LastEditTime: 2022-08-09 16:32:42
* @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
*/ */
...@@ -106,17 +106,13 @@ const ProjectMembers = observer(() => { ...@@ -106,17 +106,13 @@ const ProjectMembers = observer(() => {
if (e.keyCode === 13) { if (e.keyCode === 13) {
setTemplateName(e.target.value); setTemplateName(e.target.value);
} }
} };
return ( return (
<Box className={styles.headerBox}> <Box className={styles.headerBox}>
<Box className={styles.tabBox}> <Box className={styles.tabBox}>
<SearchInput <SearchInput onKeyUp={handleKeyWordChangeKeyUp} sx={{ width: 340 }} />
onKeyUp={handleKeyWordChangeKeyUp} {isPass("PROJECT_WORKBENCH_FLOES_ADD", "MANAGER") && (
sx={{ width: 340 }}
/>
{templateList.length > 0 &&
isPass("PROJECT_WORKBENCH_FLOES_ADD", "MANAGER") && (
<MyButton <MyButton
text={"添加工作流模版"} text={"添加工作流模版"}
img={<Add />} img={<Add />}
...@@ -126,7 +122,7 @@ const ProjectMembers = observer(() => { ...@@ -126,7 +122,7 @@ const ProjectMembers = observer(() => {
)} )}
</Box> </Box>
{templateList.length === 0 && templateName.length > 0 && ( {templateList.length === 0 && (
<Box <Box
sx={{ sx={{
display: "flex", display: "flex",
...@@ -140,12 +136,12 @@ const ProjectMembers = observer(() => { ...@@ -140,12 +136,12 @@ const ProjectMembers = observer(() => {
<Typography <Typography
sx={{ fontSize: "12px", fontWeight: "400", color: "#8A9099" }} sx={{ fontSize: "12px", fontWeight: "400", color: "#8A9099" }}
> >
暂未开启模版 {templateName ? "暂未相应搜索结果" : "暂未开启模版"}
</Typography> </Typography>
</Box> </Box>
)} )}
{templateList.length > 0 && ( {templateList.length > 0 && (
<Box sx={{ display: "flex", flexWrap: "wrap", margin:"0 -8px" }}> <Box sx={{ display: "flex", flexWrap: "wrap", margin: "0 -8px" }}>
{templateList && {templateList &&
templateList.length > 0 && templateList.length > 0 &&
templateList.map((item, key) => { templateList.map((item, key) => {
...@@ -155,42 +151,16 @@ const ProjectMembers = observer(() => { ...@@ -155,42 +151,16 @@ const ProjectMembers = observer(() => {
})} })}
</Box> </Box>
)} )}
{templateList.length === 0 &&
templateName.length === 0 &&
isPass("PROJECT_WORKBENCH_FLOES_ADD", "MANAGER") && (
<Box className={styles.addNewTemplate} onClick={addTemplateBlock}>
<Add
sx={{
color: "#565C66",
fontSize: "20px",
width: "30px",
height: "30px",
}}
/>
<Typography
sx={{
fontSize: "14px",
fontWeight: "400",
color: "#8A9099",
marginTop: "15px",
}}
>
添加工作流模版
</Typography>
</Box>
)}
{showAddTemplate && ( {showAddTemplate && (
<AddTemplate <AddTemplate
setShowAddTemplate={ setShowAddTemplate={() => {
() => { setShowAddTemplate(false);
setShowAddTemplate(false)
getTemplateInfo({ getTemplateInfo({
projectId: projectIdData as string, projectId: projectIdData as string,
title: templateName, title: templateName,
}); });
} }}
}
getTemplateInfo={getTemplateInfo} getTemplateInfo={getTemplateInfo}
productId={productId as string} productId={productId as string}
projectId={projectIdData as string} projectId={projectIdData as string}
......
...@@ -39,3 +39,12 @@ ...@@ -39,3 +39,12 @@
.batchRotate { .batchRotate {
transform: translateX(-50%) rotate(-90deg); transform: translateX(-50%) rotate(-90deg);
} }
.handleBox::before{
content: "";
position: absolute;
left: -4px;
top: -4px;
width: 14px;
height: 14px;
}
/* /*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-07-12 11:20:29 * @Date: 2022-07-12 11:20:29
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-07-22 10:43:28 * @LastEditTime: 2022-08-09 11:24:38
* @FilePath: /bkunyun/src/views/Project/components/Flow/components/BatchNode.tsx * @FilePath: /bkunyun/src/views/Project/components/Flow/components/BatchNode.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
*/ */
...@@ -65,13 +65,14 @@ const BatchNode = (props: IBatchNode) => { ...@@ -65,13 +65,14 @@ const BatchNode = (props: IBatchNode) => {
return ( return (
<MyTooltip title={item.name} key={uuid()}> <MyTooltip title={item.name} key={uuid()}>
<Handle <Handle
className={styles.handleBox}
id={item.name} id={item.name}
style={{ style={{
background: "#fff ", background: "#fff ",
border: item.error border: item.error
? "1px solid #FF4E4E" ? "1px solid #FF4E4E"
: "1px solid #D1D6DE", : "1px solid #D1D6DE",
left: index * 20 + 20, left: index * 24 + 20,
}} }}
type="target" type="target"
position={Position.Top} position={Position.Top}
...@@ -95,11 +96,12 @@ const BatchNode = (props: IBatchNode) => { ...@@ -95,11 +96,12 @@ const BatchNode = (props: IBatchNode) => {
return ( return (
<MyTooltip title={item.name} key={uuid()}> <MyTooltip title={item.name} key={uuid()}>
<Handle <Handle
className={styles.handleBox}
id={item.name} id={item.name}
style={{ style={{
background: "#fff ", background: "#fff ",
border: "1px solid #D1D6DE", border: "1px solid #D1D6DE",
left: index * 20 + 20, left: index * 24 + 20,
}} }}
type="source" type="source"
position={Position.Bottom} position={Position.Bottom}
......
...@@ -34,3 +34,12 @@ ...@@ -34,3 +34,12 @@
border-radius: 8px; border-radius: 8px;
margin-left: 8px; margin-left: 8px;
} }
.handleBox::before{
content: "";
position: absolute;
left: -4px;
top: -4px;
width: 14px;
height: 14px;
}
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-07-12 11:29:46 * @Date: 2022-07-12 11:29:46
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-08 18:43:35 * @LastEditTime: 2022-08-09 19:06:43
* @FilePath: /bkunyun/src/views/Project/components/Flow/components/FlowNode/index.tsx * @FilePath: /bkunyun/src/views/Project/components/Flow/components/FlowNode/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
*/ */
...@@ -77,18 +77,24 @@ const FlowNode = (props: any) => { ...@@ -77,18 +77,24 @@ const FlowNode = (props: any) => {
})} })}
> >
{dotStatus?.isInput ? ( {dotStatus?.isInput ? (
<Handle style={inStyle} type="target" position={Position.Top} /> <Handle
className={styles.handleBox}
style={inStyle}
type="target"
position={Position.Top}
/>
) : null} ) : null}
{inParamsArr?.length {inParamsArr?.length
? inParamsArr.map((item: any, index: number) => { ? inParamsArr.map((item: any, index: number) => {
return ( return (
<MyTooltip title={item.name} key={uuid()}> <MyTooltip title={item.name} key={uuid()}>
<Handle <Handle
className={styles.handleBox}
id={item.name} id={item.name}
style={{ style={{
background: "#fff ", background: "#fff ",
border: "1px solid #D1D6DE", border: "1px solid #D1D6DE",
left: index * 20 + 20, left: index * 24 + 20,
...inStyle, ...inStyle,
}} }}
type="target" type="target"
...@@ -115,18 +121,24 @@ const FlowNode = (props: any) => { ...@@ -115,18 +121,24 @@ const FlowNode = (props: any) => {
)} )}
</div> </div>
{dotStatus?.isOutput ? ( {dotStatus?.isOutput ? (
<Handle style={outStyle} type="source" position={Position.Bottom} /> <Handle
className={styles.handleBox}
style={outStyle}
type="source"
position={Position.Bottom}
/>
) : null} ) : null}
{outParamsArr?.length {outParamsArr?.length
? outParamsArr.map((item: any, index: number) => { ? outParamsArr.map((item: any, index: number) => {
return ( return (
<MyTooltip title={item.name} key={uuid()}> <MyTooltip title={item.name} key={uuid()}>
<Handle <Handle
className={styles.handleBox}
id={item.name} id={item.name}
style={{ style={{
background: "#fff ", background: "#fff ",
border: "1px solid #D1D6DE", border: "1px solid #D1D6DE",
left: index * 20 + 20, left: index * 24 + 20,
...outStyle, ...outStyle,
}} }}
type="source" type="source"
......
/* /*
* @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: 吴永生#A02208 yongsheng.wu@wholion.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-07-20 15:01:18 * @LastEditTime: 2022-08-09 15:49:59
* @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
*/ */
...@@ -101,6 +101,20 @@ const WorkFlowEdit = observer((props: IProps) => { ...@@ -101,6 +101,20 @@ const WorkFlowEdit = observer((props: IProps) => {
} }
}, [id, fetchTemplateConfigInfoRun]); }, [id, fetchTemplateConfigInfoRun]);
/** 页面刷新提醒 */
const pageRefreshTips = (e: any) => {
const event: any = window.event || e;
event.returnValue = "确定回退页面吗?";
};
/** 监听页面刷新事件 */
useEffect(() => {
window.addEventListener("beforeunload", pageRefreshTips, false);
return () => {
window.removeEventListener("beforeunload", pageRefreshTips, false);
};
});
// 确认弹窗相对位置 // 确认弹窗相对位置
const [anchorEl, setAnchorEl] = useState<any>(null); const [anchorEl, setAnchorEl] = useState<any>(null);
// 隐藏确认弹窗, 确认弹窗点击取消 // 隐藏确认弹窗, 确认弹窗点击取消
......
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