Commit 17bde8c7 authored by 吴永生#A02208's avatar 吴永生#A02208

feat: 提交任务显示连接线

parent bc29c610
...@@ -24,7 +24,7 @@ export interface IParameter { ...@@ -24,7 +24,7 @@ export interface IParameter {
source: string; source: string;
productId: string; productId: string;
// tasks: ITask[]; // tasks: ITask[];
isLine?: boolean; linked?: boolean;
validators: Array<IValidator>; validators: Array<IValidator>;
choices: Array<IChoice>; choices: Array<IChoice>;
error?: boolean; error?: boolean;
......
...@@ -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:20:29 * @Date: 2022-07-12 11:20:29
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com * @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-07-14 11:35:44 * @LastEditTime: 2022-07-15 10:48:22
* @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
*/ */
...@@ -27,7 +27,6 @@ const BatchNode = (props: IBatchNode) => { ...@@ -27,7 +27,6 @@ const BatchNode = (props: IBatchNode) => {
info: { title, isCheck, executionStatus, parameters }, info: { title, isCheck, executionStatus, parameters },
flowType, flowType,
} = data; } = data;
/** 获取输入参数数组 */ /** 获取输入参数数组 */
const inParamsArr = useMemo(() => { const inParamsArr = useMemo(() => {
return ( return (
...@@ -61,7 +60,7 @@ const BatchNode = (props: IBatchNode) => { ...@@ -61,7 +60,7 @@ const BatchNode = (props: IBatchNode) => {
})} })}
style={style} style={style}
> >
{inParamsArr?.length && flowType === "edit" {inParamsArr?.length
? inParamsArr.map((item, index) => { ? inParamsArr.map((item, index) => {
return ( return (
<Tooltip title={item.name} key={uuid()}> <Tooltip title={item.name} key={uuid()}>
...@@ -91,7 +90,7 @@ const BatchNode = (props: IBatchNode) => { ...@@ -91,7 +90,7 @@ const BatchNode = (props: IBatchNode) => {
<span className={styles.successDot}></span> <span className={styles.successDot}></span>
) : null} ) : null}
</div> </div>
{outParamsArr?.length && flowType === "edit" {outParamsArr?.length
? outParamsArr.map((item, index) => { ? outParamsArr.map((item, index) => {
return ( return (
<Tooltip title={item.name} key={uuid()}> <Tooltip title={item.name} key={uuid()}>
......
...@@ -94,10 +94,12 @@ const Flow = (props: IProps) => { ...@@ -94,10 +94,12 @@ const Flow = (props: IProps) => {
const { error, helperText } = const { error, helperText } =
getCustomTemplateParameterCheckResult({ getCustomTemplateParameterCheckResult({
...every, ...every,
isLine: false, linked: false,
hidden: false,
}); });
return { return {
...every, ...every,
hidden: false,
error, error,
helperText, helperText,
}; };
...@@ -408,10 +410,11 @@ const Flow = (props: IProps) => { ...@@ -408,10 +410,11 @@ const Flow = (props: IProps) => {
if (item.name === edgeItem.targetHandle) { if (item.name === edgeItem.targetHandle) {
const { error, helperText } = getCustomTemplateParameterCheckResult({ const { error, helperText } = getCustomTemplateParameterCheckResult({
...item, ...item,
isLine: true, linked: true,
hidden: true,
}); });
return { ...item, isLine: true, helperText, error }; return { ...item, linked: true, hidden: true, helperText, error };
} else { } else {
return item; return item;
} }
......
...@@ -29,25 +29,25 @@ export const getCustomTemplateParameterCheckResult = ( ...@@ -29,25 +29,25 @@ export const getCustomTemplateParameterCheckResult = (
// 2.2 若为“关闭”状态,则表示该输入的值是上一步批算子的结果,又因为其为选填项,所以这线可连可不连,不做限制。 // 2.2 若为“关闭”状态,则表示该输入的值是上一步批算子的结果,又因为其为选填项,所以这线可连可不连,不做限制。
if (parameter.parameterGroup === "in") { if (parameter.parameterGroup === "in") {
if (parameter.required) { if (parameter.required) {
if (!parameter.hidden && parameter.isLine) { if (!parameter.hidden && parameter.linked) {
return { return {
error, error,
helperText, helperText,
deleteLine: true, deleteLine: true,
} }
} else if (!parameter.hidden && !parameter.isLine) { } else if (!parameter.hidden && !parameter.linked) {
return { return {
error, error,
helperText, helperText,
deleteLine: false, deleteLine: false,
} }
} else if (parameter.hidden && parameter.isLine) { } else if (parameter.hidden && parameter.linked) {
return { return {
error, error,
helperText, helperText,
deleteLine: false, deleteLine: false,
} }
} else if (parameter.hidden && !parameter.isLine) { } else if (parameter.hidden && !parameter.linked) {
return { return {
error: true, error: true,
helperText: '该输入为必填,需在右侧视图编辑区连接输入文件或重新改回“开启”状态', helperText: '该输入为必填,需在右侧视图编辑区连接输入文件或重新改回“开启”状态',
...@@ -55,25 +55,25 @@ export const getCustomTemplateParameterCheckResult = ( ...@@ -55,25 +55,25 @@ export const getCustomTemplateParameterCheckResult = (
} }
} }
} else { } else {
if (!parameter.hidden && parameter.isLine) { if (!parameter.hidden && parameter.linked) {
return { return {
error, error,
helperText, helperText,
deleteLine: true, deleteLine: true,
} }
} else if (!parameter.hidden && !parameter.isLine) { } else if (!parameter.hidden && !parameter.linked) {
return { return {
error, error,
helperText, helperText,
deleteLine: false, deleteLine: false,
} }
} else if (parameter.hidden && parameter.isLine) { } else if (parameter.hidden && parameter.linked) {
return { return {
error, error,
helperText, helperText,
deleteLine: false, deleteLine: false,
} }
} else if (parameter.hidden && !parameter.isLine) { } else if (parameter.hidden && !parameter.linked) {
return { return {
error, error,
helperText, helperText,
...@@ -103,7 +103,7 @@ export const getCustomTemplateParameterCheckResult = ( ...@@ -103,7 +103,7 @@ export const getCustomTemplateParameterCheckResult = (
helperText, helperText,
}; };
} }
// isLine // linked
// 有值才做validators旋律校验 // 有值才做validators旋律校验
if (parameter.defaultValue) { if (parameter.defaultValue) {
if (Array.isArray(parameter.validators)) { if (Array.isArray(parameter.validators)) {
......
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