fix: 全局参数没有时,流水线编辑时不显示

This commit is contained in:
cp3hnu 2024-08-07 09:44:55 +08:00
parent 5bf7dfb791
commit eda18ad3f6
3 changed files with 31 additions and 25 deletions

View File

@ -278,8 +278,8 @@ function ModelDeploymentCreate() {
message: '请输入副本数量',
},
{
pattern: /^-?\d+(\.\d+)?$/,
message: '副本数量必须是',
pattern: /^[1-9]\d*$/,
message: '副本数量必须是正整数',
},
]}
>

View File

@ -55,6 +55,7 @@ export function createMenuItems(
};
});
if (params.length > 0) {
return [
{
key: 'global',
@ -66,6 +67,9 @@ export function createMenuItems(
},
...nodes,
];
} else {
return [...nodes];
}
}
export function getInParameterComponent(

View File

@ -23,6 +23,7 @@ function PropsLabel({ title, menuItems, onClick }: PropsLabelProps) {
return (
<div className={styles['props-label']}>
<div>{title}</div>
{menuItems && menuItems.length > 0 && (
<Dropdown
menu={{
items: menuItems,
@ -35,6 +36,7 @@ function PropsLabel({ title, menuItems, onClick }: PropsLabelProps) {
>
<a onClick={(e) => e.preventDefault()}></a>
</Dropdown>
)}
</div>
);
}