Commit 8d55fa8d authored by 吴永生#A02208's avatar 吴永生#A02208

Merge branch 'feat-20220705-customTemplate' of http://120.77.149.83/root/bkunyun…

Merge branch 'feat-20220705-customTemplate' of http://120.77.149.83/root/bkunyun into feat-20220705-customTemplate
parents bdfc974c 2489ece8
...@@ -8,59 +8,61 @@ ...@@ -8,59 +8,61 @@
*/ */
import TextField, { TextFieldProps } from "@mui/material/TextField"; import TextField, { TextFieldProps } from "@mui/material/TextField";
interface MyInputProps extends Omit<TextFieldProps, "value"> { interface MyInputProps extends Omit<TextFieldProps, "value"> {
value: any; value: any;
inputSx?: any; inputSx?: any;
onChange?: any; onChange?: any;
onFocus?: any; onFocus?: any;
label?: string; label?: string;
variant?: "standard" | "filled" | "outlined"; variant?: "standard" | "filled" | "outlined";
id?: string; id?: string;
size?: "small" | "medium"; size?: "small" | "medium";
placeholder?: string; placeholder?: string;
fullWidth?: boolean; // 宽度是否和容器一致 fullWidth?: boolean; // 宽度是否和容器一致
InputProps?: any; // input加前后icon可以用这个 InputProps?: any; // input加前后icon可以用这个
error?: boolean; error?: boolean;
helperText?: string; helperText?: string;
}; }
const MyInput = (props: MyInputProps) => { const MyInput = (props: MyInputProps) => {
const { const {
inputSx = {}, inputSx = {},
value, value,
onChange, onChange,
onFocus, onFocus,
label, label,
id, id,
variant, variant,
size = "small", size = "small",
placeholder = "请输入", placeholder = "请输入",
fullWidth = true, fullWidth = true,
InputProps, InputProps,
error = false, error = false,
helperText, helperText,
} = props; disabled,
} = props;
return ( return (
<TextField <TextField
{...props} {...props}
error={error} error={error}
helperText={helperText} helperText={helperText}
sx={{ ...inputSx }} sx={{ ...inputSx }}
id={id} id={id}
label={label} label={label}
variant={variant} variant={variant}
onChange={onChange} onChange={onChange}
onFocus={onFocus} onFocus={onFocus}
size={size} size={size}
placeholder={placeholder} placeholder={placeholder}
fullWidth={fullWidth} fullWidth={fullWidth}
InputProps={{ InputProps={{
...InputProps, ...InputProps,
}} }}
value={value} disabled={disabled}
/> value={value}
); />
);
}; };
export default MyInput; export default MyInput;
...@@ -377,48 +377,52 @@ const ProjectSubmitWork = observer(() => { ...@@ -377,48 +377,52 @@ const ProjectSubmitWork = observer(() => {
{!activePatchId && ( {!activePatchId && (
<div className={styles.taskInfo}> <div className={styles.taskInfo}>
<div className={styles.title}>任务结果</div> <div className={styles.title}>任务结果</div>
{workFlowJobInfo?.outputs && ( {workFlowJobInfo?.outputs &&
<div className={styles.taskResults}> Object.keys(workFlowJobInfo?.outputs).length > 0 && (
{randerOutputs1.map((item, index) => { <div className={styles.taskResults}>
return ( {randerOutputs1.map((item, index) => {
<div key={index} className={styles.outputLi}> return (
{/* <MyPopconfirm <div key={index} className={styles.outputLi}>
{/* <MyPopconfirm
title="即将跳转至项目数据内该任务的结果目录,确认继续吗?" title="即将跳转至项目数据内该任务的结果目录,确认继续吗?"
onConfirm={() => onConfirm={() =>
goToProjectData(getFolderPath(item.path)) goToProjectData(getFolderPath(item.path))
} }
> */} > */}
<div <div
className={styles.outputLiLeft} className={styles.outputLiLeft}
onClick={(e: any) => { onClick={(e: any) => {
handleShowPopper( handleShowPopper(
e, e,
"即将跳转至项目数据内该任务的结果目录,确认继续吗?" "即将跳转至项目数据内该任务的结果目录,确认继续吗?"
); );
setGoToProjectDataPath(getFolderPath(item.path)); setGoToProjectDataPath(
}} getFolderPath(item.path)
> );
<img }}
className={styles.outputLiLeftImg} >
src={ <img
item.type === "file" ? fileIcon : dataSetIcon className={styles.outputLiLeftImg}
} src={
alt="" item.type === "file" ? fileIcon : dataSetIcon
/> }
{item.name} alt=""
/>
{item.name}
</div>
{/* </MyPopconfirm> */}
<span className={styles.outputLiRight}>
{item.size}
</span>
</div> </div>
{/* </MyPopconfirm> */} );
<span className={styles.outputLiRight}> })}
{item.size} </div>
</span> )}
</div> {workFlowJobInfo?.outputs &&
); Object.keys(workFlowJobInfo?.outputs).length === 0 && (
})} <div className={styles.notResults}>暂无结果文件</div>
</div> )}
)}
{!workFlowJobInfo?.outputs && (
<div className={styles.notResults}>暂无结果文件</div>
)}
<div className={styles.title}>任务信息</div> <div className={styles.title}>任务信息</div>
<div className={styles.taskInfoLi}> <div className={styles.taskInfoLi}>
<div className={styles.taskInfoParams}>任务名称</div> <div className={styles.taskInfoParams}>任务名称</div>
......
...@@ -110,11 +110,12 @@ const AddTemplate = observer((props: IAddTemplateProps) => { ...@@ -110,11 +110,12 @@ const AddTemplate = observer((props: IAddTemplateProps) => {
}; };
useEffect(() => { useEffect(() => {
setSelectTemplateData([]);
getAddTemplateList({ getAddTemplateList({
projectId: projectId as string, projectId: projectId as string,
productId: productId as string, productId: productId as string,
}); });
}, [getAddTemplateList, projectId, productId]); }, [templateType, getAddTemplateList, projectId, productId]);
const hiddenBoxArr = useMemo(() => { const hiddenBoxArr = useMemo(() => {
const length = const length =
......
...@@ -23,6 +23,12 @@ export const getCustomTemplateParameterCheckResult = ( ...@@ -23,6 +23,12 @@ export const getCustomTemplateParameterCheckResult = (
} }
} }
} }
if (error) {
return {
error,
helperText,
};
}
if (parameter.validators.length > 0) { if (parameter.validators.length > 0) {
parameter.validators.forEach((validator) => { parameter.validators.forEach((validator) => {
const reg = new RegExp(validator.regex); const reg = new RegExp(validator.regex);
......
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