Commit 09db589f authored by chenshouchao's avatar chenshouchao

feat: 参数设置输入没有输入框

parent d0c45cef
...@@ -93,6 +93,12 @@ ...@@ -93,6 +93,12 @@
.parameterBox:last-child { .parameterBox:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
.inOutParameterBox {
margin-bottom: 12px;
}
.inOutParameterBox:last-child {
margin-bottom: 0px;
}
.inOutParameterTop { .inOutParameterTop {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -117,6 +123,12 @@ ...@@ -117,6 +123,12 @@
font-size: 12px; font-size: 12px;
line-height: 20px; line-height: 20px;
} }
.inOutParameterHelperText {
margin-top: 6px;
font-size: 12px;
line-height: 20px;
color: rgba(255, 78, 78, 1);
}
.noData { .noData {
height: calc(100vh - 140px); height: calc(100vh - 140px);
...@@ -133,34 +145,33 @@ ...@@ -133,34 +145,33 @@
line-height: 22px; line-height: 22px;
color: rgba(138, 144, 153, 1); color: rgba(138, 144, 153, 1);
} }
.paramsGroup{ .paramsGroup {
padding-bottom: 24px; padding-bottom: 24px;
} }
.parameter{ .parameter {
padding: 16px 0 24px; padding: 16px 0 24px;
border-bottom: 1px solid #F0F2F5; border-bottom: 1px solid #f0f2f5;
} }
.parameter:last-child{ .parameter:last-child {
border-bottom: none; border-bottom: none;
} }
.parameterTop{ .parameterTop {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-bottom: 16px; margin-bottom: 16px;
} }
.parameterLeft{ .parameterLeft {
} }
.parameterName{ .parameterName {
font-size: 14px; font-size: 14px;
color: #1E2633; color: #1e2633;
line-height: 22px; line-height: 22px;
font-weight: 600; font-weight: 600;
} }
.parameterClassTypeName{ .parameterClassTypeName {
font-size: 14px; font-size: 14px;
color: #8A9099; color: #8a9099;
line-height: 22px; line-height: 22px;
} }
...@@ -693,7 +693,12 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -693,7 +693,12 @@ const ParameterSetting = (props: IParameterSettingProps) => {
></MySwitch> ></MySwitch>
</div> </div>
</div> </div>
{renderInput(parameter)} {parameter.error && parameter.helperText && (
<div className={styles.inOutParameterHelperText}>
{parameter.helperText}
</div>
)}
{/* {renderInput(parameter)} */}
</div> </div>
); );
})} })}
......
...@@ -4,7 +4,7 @@ export const getCustomTemplateParameterCheckResult = ( ...@@ -4,7 +4,7 @@ export const getCustomTemplateParameterCheckResult = (
): { ): {
error: boolean; error: boolean;
helperText: string; helperText: string;
deleteLine?: boolean; // 自动将该线删除 deleteLine?: boolean; // 该线是否要删除
} => { } => {
let error = false; let error = false;
let helperText = ""; let helperText = "";
...@@ -15,18 +15,18 @@ export const getCustomTemplateParameterCheckResult = ( ...@@ -15,18 +15,18 @@ export const getCustomTemplateParameterCheckResult = (
helperText, helperText,
} }
} }
// 1. 当该输入为必填项时: // 输入校验
// 1. 当该输入为必填项时:
// 1.1 若为“启用”状态,则表示该输入的值交由用户在使用时填写。故该输入的节点入口在右侧编辑区内不允许连线,若已有连线则自动将该线删除。 // 1.1 若为“启用”状态,则表示该输入的值交由用户在使用时填写。故该输入的节点入口在右侧编辑区内不允许连线,若已有连线则自动将该线删除。
// 1.2 若为“关闭”状态,则表示该输入的值是上一步批算子的结果。故该输入的节点入口在右侧编辑区内必须有连线。(若编辑者没有为该节点入口添加连线,则错误提示“该输入为必填,需在右侧视图编辑区连接输入文件或重新改回“开启”状态”;若连上线了则无需错误提示。) // 1.2 若为“关闭”状态,则表示该输入的值是上一步批算子的结果。故该输入的节点入口在右侧编辑区内必须有连线。(若编辑者没有为该节点入口添加连线,则错误提示“该输入为必填,需在右侧视图编辑区连接输入文件或重新改回“开启”状态”;若连上线了则无需错误提示。)
// 2. 当该输入为选填项时: // 2. 当该输入为选填项时:
// 2.1 若为“启用”状态,则表示该输入的值交由用户在使用时填写。故该输入的节点入口在右侧编辑区内不允许连线,若已有连线则自动将该线删除。 // 2.1 若为“启用”状态,则表示该输入的值交由用户在使用时填写。故该输入的节点入口在右侧编辑区内不允许连线,若已有连线则自动将该线删除。
// 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.isLine) {
...@@ -50,7 +50,7 @@ export const getCustomTemplateParameterCheckResult = ( ...@@ -50,7 +50,7 @@ export const getCustomTemplateParameterCheckResult = (
} else if (parameter.hidden && !parameter.isLine) { } else if (parameter.hidden && !parameter.isLine) {
return { return {
error: true, error: true,
helperText: '该输入为必填,需在右侧视图编辑区连接输入文件或重新改回“开启”状态', helperText: '该输入为必填,需在右侧视图编辑区连接输入文件或重新改回“开启”状态',
deleteLine: false, deleteLine: false,
} }
} }
......
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