Commit c1b2afe3 authored by chenshouchao's avatar chenshouchao

Merge branch 'feat-20220801' into 'release'

Feat 20220801

See merge request !64
parents 61bbd12c e8ef7d31
...@@ -54,6 +54,7 @@ const theme = createTheme({ ...@@ -54,6 +54,7 @@ const theme = createTheme({
"&.MuiButton-outlinedError": { "&.MuiButton-outlinedError": {
color: "rgba(255, 78, 78, 1)", color: "rgba(255, 78, 78, 1)",
border: "1px solid rgba(255, 78, 78, 1)", border: "1px solid rgba(255, 78, 78, 1)",
"&:hover": { backgroundColor: 'transparent' },
}, },
"& .MuiLoadingButton-loadingIndicator": { "& .MuiLoadingButton-loadingIndicator": {
color: "#fff", color: "#fff",
......
...@@ -103,7 +103,7 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => { ...@@ -103,7 +103,7 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => {
disabled={disabledConfirm} disabled={disabledConfirm}
isLoadingButton={true} isLoadingButton={true}
loading={loading} loading={loading}
style={{ ...okSx }} style={{ marginLeft: '12px', ...okSx }}
/> />
) : null} ) : null}
</DialogActions> </DialogActions>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
color: #565c66; color: #565c66;
font-size: 14px; font-size: 14px;
line-height: 22px; line-height: 22px;
border-left: 3px solid #fff; border-left: 3px solid #f7f8fa;
} }
.listItem:hover { .listItem:hover {
background-color: #eef1f5; background-color: #eef1f5;
......
...@@ -54,7 +54,7 @@ const AddFolder = (props: IAddFolderProps) => { ...@@ -54,7 +54,7 @@ const AddFolder = (props: IAddFolderProps) => {
refresh(); refresh();
}); });
} else { } else {
Message.info(fileNameCheck.help || "请输入文件夹名称"); Message.error(fileNameCheck.help || "请输入文件夹名称");
} }
}; };
......
...@@ -208,7 +208,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -208,7 +208,7 @@ const ConfigForm = (props: ConfigFormProps) => {
[styles.required]: parameter.required, [styles.required]: parameter.required,
})} })}
> >
{parameter.name} {parameter.title}
<span className={styles.parameterDataType}> <span className={styles.parameterDataType}>
{parameter.classTypeName} {parameter.classTypeName}
</span> </span>
......
...@@ -11,6 +11,7 @@ export interface IParameter { ...@@ -11,6 +11,7 @@ export interface IParameter {
hidden: boolean; // 使用模板时是否展示 true 不展示 用户不需要填写 hidden: boolean; // 使用模板时是否展示 true 不展示 用户不需要填写
id?: string; id?: string;
name: string; // 参数名称 name: string; // 参数名称
title: string; // 参数名称
required: boolean; // 是否必填 required: boolean; // 是否必填
defaultValue: any; // 默认值 defaultValue: any; // 默认值
domType: IDomType; // 前端组件类型 domType: IDomType; // 前端组件类型
......
...@@ -583,12 +583,31 @@ const Flow = (props: IProps) => { ...@@ -583,12 +583,31 @@ const Flow = (props: IProps) => {
[connectModifyParameters, tasks] [connectModifyParameters, tasks]
); );
// 获取算子类型 批算还是流算子
const getTaskType = useCallback(
(taskId: string) => {
let type = "";
tasks?.forEach((task) => {
if (task.id === taskId) {
type = task.type;
}
});
return type;
},
[tasks]
);
/** 已经连接线啦 */ /** 已经连接线啦 */
const onConnect = useCallback( const onConnect = useCallback(
(connection: Connection) => { (connection: Connection) => {
const { inputClassType, outClassType } = getClassType(connection); const { inputClassType, outClassType } = getClassType(connection);
let result: ITask[] = []; let result: ITask[] = [];
if (inputClassType === outClassType) { if (
getTaskType(connection.source as string) === "FLOW" ||
getTaskType(connection.target as string) === "FLOW"
) {
return;
} else if (inputClassType === outClassType) {
result = connectCheck(connection) as ITask[]; result = connectCheck(connection) as ITask[];
} else { } else {
Message.error("端口数据类型不一致,无法连接!"); Message.error("端口数据类型不一致,无法连接!");
...@@ -596,7 +615,14 @@ const Flow = (props: IProps) => { ...@@ -596,7 +615,14 @@ const Flow = (props: IProps) => {
} }
setTasks && setTasks(result); setTasks && setTasks(result);
}, },
[Message, connectCheck, getClassType, setTasks, tasksDeleteLine] [
Message,
connectCheck,
getClassType,
setTasks,
tasksDeleteLine,
getTaskType,
]
); );
/** 点击连线 */ /** 点击连线 */
......
...@@ -442,7 +442,7 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -442,7 +442,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
[styles.required]: parameter.required, [styles.required]: parameter.required,
})} })}
> >
{parameter.name} {parameter.title}
</div> </div>
<div className={styles.parameterClassTypeName}> <div className={styles.parameterClassTypeName}>
{parameter.classTypeName} {parameter.classTypeName}
...@@ -569,7 +569,7 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -569,7 +569,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
[styles.required]: parameter.required, [styles.required]: parameter.required,
})} })}
> >
{parameter.name} {parameter.title}
</div> </div>
<div className={styles.inOutParameterdataType}> <div className={styles.inOutParameterdataType}>
{parameter.classTypeName} {parameter.classTypeName}
...@@ -614,7 +614,7 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -614,7 +614,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
[styles.required]: parameter.required, [styles.required]: parameter.required,
})} })}
> >
{parameter.name} {parameter.title}
</div> </div>
<div className={styles.inOutParameterdataType}> <div className={styles.inOutParameterdataType}>
{parameter.classTypeName} {parameter.classTypeName}
......
...@@ -45,14 +45,28 @@ ...@@ -45,14 +45,28 @@
bottom: 20px; bottom: 20px;
width: 36px; width: 36px;
height: 36px; height: 36px;
border-radius: 50%; border-radius: 18px;
box-shadow: 0px 3px 10px 0px rgba(0, 24, 57, 0.14); box-shadow: 0px 3px 10px 0px rgba(0, 24, 57, 0.14);
font-size: 30px; font-size: 30px;
line-height: 36px; line-height: 36px;
text-align: center; text-align: start;
color: RGBA(66, 141, 255, 1); color: RGBA(66, 141, 255, 1);
cursor: pointer; cursor: pointer;
background-color: #fff; background-color: #fff;
transition: width 1s;
-webkit-transition: width 1s;
overflow: hidden;
display: flex;
justify-content: start;
align-items: center;
}
.addOperator:hover {
width: 105px;
}
.addText {
font-size: 14px;
line-height: 36px;
white-space: nowrap;
} }
.swFlowBox { .swFlowBox {
flex: 1; flex: 1;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* @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
*/ */
import React, { useCallback, useEffect, useState } from "react"; import React, { useCallback, useEffect, useState, useMemo } from "react";
import ArrowBackIosNewIcon from "@mui/icons-material/ArrowBackIosNew"; import ArrowBackIosNewIcon from "@mui/icons-material/ArrowBackIosNew";
import IconButton from "@mui/material/IconButton"; import IconButton from "@mui/material/IconButton";
import _ from "lodash"; import _ from "lodash";
...@@ -25,6 +25,7 @@ import { getCustomTemplateParameterCheckResult } from "./util"; ...@@ -25,6 +25,7 @@ import { getCustomTemplateParameterCheckResult } from "./util";
import useMyRequest from "@/hooks/useMyRequest"; import useMyRequest from "@/hooks/useMyRequest";
import CustomOperator from "../CustomOperator"; import CustomOperator from "../CustomOperator";
import SaveCustomTemplate from "./components/SaveCustomTemplate"; import SaveCustomTemplate from "./components/SaveCustomTemplate";
import AddIcon from "@mui/icons-material/Add";
import styles from "./index.module.css"; import styles from "./index.module.css";
...@@ -55,6 +56,7 @@ const WorkFlowEdit = observer((props: IProps) => { ...@@ -55,6 +56,7 @@ const WorkFlowEdit = observer((props: IProps) => {
const [oldversion, setOldersion] = useState(""); // 编辑是自定义模板的老版本 const [oldversion, setOldersion] = useState(""); // 编辑是自定义模板的老版本
const [description, setDescription] = useState(""); // 自定义模板描述 const [description, setDescription] = useState(""); // 自定义模板描述
const [creator, setCreator] = useState(""); // 自定义模板创建人 const [creator, setCreator] = useState(""); // 自定义模板创建人
const [operatingArea, setOperatingArea] = useState<"form" | "flow">("form"); // 当前操作区域
const [leftContentType, setLeftContentType] = useState("list"); // 页面左侧展示的是算子列表还是参数设置 const [leftContentType, setLeftContentType] = useState("list"); // 页面左侧展示的是算子列表还是参数设置
const [popperTitle, setPopperTitle] = useState( const [popperTitle, setPopperTitle] = useState(
...@@ -62,6 +64,14 @@ const WorkFlowEdit = observer((props: IProps) => { ...@@ -62,6 +64,14 @@ const WorkFlowEdit = observer((props: IProps) => {
"返回后,当前页面已填写内容将不保存,确认返回吗?" "返回后,当前页面已填写内容将不保存,确认返回吗?"
); );
// 是否要监听删除时间
const listenState = useMemo(() => {
if (operatingArea === "form") {
return false;
}
return !saveFormDialog && !showCustomOperator;
}, [operatingArea, saveFormDialog, showCustomOperator]);
// 编辑时获取模板详情的方法 // 编辑时获取模板详情的方法
const { run: fetchTemplateConfigInfoRun } = useMyRequest( const { run: fetchTemplateConfigInfoRun } = useMyRequest(
fetchTemplateConfigInfo, fetchTemplateConfigInfo,
...@@ -206,7 +216,12 @@ const WorkFlowEdit = observer((props: IProps) => { ...@@ -206,7 +216,12 @@ const WorkFlowEdit = observer((props: IProps) => {
</div> </div>
</div> </div>
<div className={styles.swContent}> <div className={styles.swContent}>
<div className={styles.swFormBox}> <div
className={styles.swFormBox}
onClick={() => {
setOperatingArea("form");
}}
>
<div className={styles.radiosBox}> <div className={styles.radiosBox}>
<RadioGroupOfButtonStyle <RadioGroupOfButtonStyle
radioOptions={radioOptions} radioOptions={radioOptions}
...@@ -240,16 +255,23 @@ const WorkFlowEdit = observer((props: IProps) => { ...@@ -240,16 +255,23 @@ const WorkFlowEdit = observer((props: IProps) => {
className={styles.addOperator} className={styles.addOperator}
onClick={() => setShowCustomOperator(true)} onClick={() => setShowCustomOperator(true)}
> >
+ <AddIcon sx={{ padding: "6px" }} />
<span className={styles.addText}>添加算子</span>
</div> </div>
</div> </div>
<div className={styles.swFlowBox} id="workFlowEditRight"> <div
className={styles.swFlowBox}
id="workFlowEditRight"
onClick={() => {
setOperatingArea("flow");
}}
>
<Flow <Flow
tasks={templateConfigInfo} tasks={templateConfigInfo}
setTasks={setTemplateConfigInfo} setTasks={setTemplateConfigInfo}
type="edit" type="edit"
onFlowNodeClick={handleNodeClick} onFlowNodeClick={handleNodeClick}
ListenState={!saveFormDialog && !showCustomOperator} ListenState={listenState}
/> />
</div> </div>
</div> </div>
......
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