Commit f1da6197 authored by chenshouchao's avatar chenshouchao

fix: 任务详情结果文件跳转后移动失败修复

parent 82b14568
...@@ -34,7 +34,9 @@ const MoveFile = (props: any) => { ...@@ -34,7 +34,9 @@ const MoveFile = (props: any) => {
const [moveFileSubmitloading, setMoveFileSubmitloading] = useState(false); const [moveFileSubmitloading, setMoveFileSubmitloading] = useState(false);
const [treeData, setTreeData] = useState<any>([]); const [treeData, setTreeData] = useState<any>([]);
const [renderTreeData, setRenderTreeData] = useState<any>([]); const [renderTreeData, setRenderTreeData] = useState<any>([]);
let moveFileDialogRef: any = React.createRef(); const [moveFileDialogRef, setMoveFileDialogRef] = useState<any>(
React.createRef()
);
// 要移动的文件夹 之后用来隐藏文件夹树中同路径的文件夹 // 要移动的文件夹 之后用来隐藏文件夹树中同路径的文件夹
const [moveFolderPathArr, setMoveFolderPathArr] = useState<Array<string>>([]); const [moveFolderPathArr, setMoveFolderPathArr] = useState<Array<string>>([]);
......
...@@ -99,18 +99,20 @@ ...@@ -99,18 +99,20 @@
color: rgba(138, 144, 153, 1); color: rgba(138, 144, 153, 1);
font-size: 14px; font-size: 14px;
line-height: 22px; line-height: 22px;
width: 72px;
margin-right: 44px;
} }
.taskInfoValue { .taskInfoValue {
color: rgba(30, 38, 51, 1); color: rgba(30, 38, 51, 1);
font-size: 14px; font-size: 14px;
line-height: 22px; line-height: 22px;
max-width: 210px;
text-overflow: ellipsis;
white-space: nowrap;
display: flex; display: flex;
overflow: hidden;
position: relative; position: relative;
align-items: center; align-items: center;
text-align: left;
word-break: break-all;
flex: 1;
justify-content: flex-end;
} }
.taskInfoValueClick { .taskInfoValueClick {
cursor: pointer; cursor: pointer;
...@@ -159,6 +161,7 @@ ...@@ -159,6 +161,7 @@
background: #ffffff; background: #ffffff;
box-shadow: 0px 3px 10px 0px rgba(0, 24, 57, 0.14); box-shadow: 0px 3px 10px 0px rgba(0, 24, 57, 0.14);
border-radius: 4px; border-radius: 4px;
z-index: 1002;
} }
.option { .option {
padding: 7px 16px; padding: 7px 16px;
......
...@@ -75,8 +75,8 @@ const ProjectSubmitWork = observer(() => { ...@@ -75,8 +75,8 @@ const ProjectSubmitWork = observer(() => {
/** 获取模版数据 */ /** 获取模版数据 */
const { run } = useMyRequest(fetchWorkFlowJob, { const { run } = useMyRequest(fetchWorkFlowJob, {
pollingInterval:1000 * 60, pollingInterval: 1000 * 60,
pollingWhenHidden:false, pollingWhenHidden: false,
onSuccess: (res: IResponse<ITaskInfo>) => { onSuccess: (res: IResponse<ITaskInfo>) => {
getOutouts(res.data.outputs); getOutouts(res.data.outputs);
setWorkFlowJobInfo(res.data); setWorkFlowJobInfo(res.data);
...@@ -85,7 +85,6 @@ const ProjectSubmitWork = observer(() => { ...@@ -85,7 +85,6 @@ const ProjectSubmitWork = observer(() => {
useEffect(() => { useEffect(() => {
const locationInfo: any = location?.state; const locationInfo: any = location?.state;
console.log(333)
run({ run({
id: locationInfo.taskId, id: locationInfo.taskId,
}); });
...@@ -98,20 +97,34 @@ const ProjectSubmitWork = observer(() => { ...@@ -98,20 +97,34 @@ const ProjectSubmitWork = observer(() => {
}); });
const goToProjectData = (path: string) => { const goToProjectData = (path: string) => {
console.log(path);
path = path.slice(13); path = path.slice(13);
if (path) { if (path) {
navigate(`/product/cadd/projectData`, { navigate(`/product/cadd/projectData`, {
state: { pathName: path }, state: { pathName: path },
}); });
} else {
navigate(`/product/cadd/projectData`, {
state: { pathName: "/" },
});
}
};
// 通过文件路径获取文件所在文件夹路径 如 输入 /home/cloudam/task_a.out 输出/home/cloudam/
const getFolderPath = (path: string) => {
const lastIndex = path.lastIndexOf("/");
if (lastIndex !== -1) {
path = path.slice(0, lastIndex + 1);
} }
return path;
}; };
/** 返回事件 */ /** 返回事件 */
const onBack = useCallback(() => { const onBack = useCallback(() => {
navigate('/product/cadd/projectWorkbench', { navigate("/product/cadd/projectWorkbench", {
state: {type: 'workbenchList'} state: { type: "workbenchList" },
}) });
},[navigate]) }, [navigate]);
const outputPathTransform = (path: string) => { const outputPathTransform = (path: string) => {
path = path.slice(13); path = path.slice(13);
...@@ -202,7 +215,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -202,7 +215,7 @@ const ProjectSubmitWork = observer(() => {
if (errorCode === 0) { if (errorCode === 0) {
message.success("操作成功!"); message.success("操作成功!");
} }
onBack() onBack();
}, },
}); });
...@@ -213,7 +226,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -213,7 +226,7 @@ const ProjectSubmitWork = observer(() => {
if (errorCode === 0) { if (errorCode === 0) {
message.success("操作成功!"); message.success("操作成功!");
} }
onBack() onBack();
}, },
}); });
...@@ -327,7 +340,9 @@ const ProjectSubmitWork = observer(() => { ...@@ -327,7 +340,9 @@ const ProjectSubmitWork = observer(() => {
<div key={index} className={styles.outputLi}> <div key={index} className={styles.outputLi}>
<MyPopconfirm <MyPopconfirm
title="即将跳转至项目数据内该任务的结果目录,确认继续吗?" title="即将跳转至项目数据内该任务的结果目录,确认继续吗?"
onConfirm={() => goToProjectData(item.path)} onConfirm={() =>
goToProjectData(getFolderPath(item.path))
}
> >
<div className={styles.outputLiLeft}> <div className={styles.outputLiLeft}>
<img <img
...@@ -499,7 +514,11 @@ const ProjectSubmitWork = observer(() => { ...@@ -499,7 +514,11 @@ const ProjectSubmitWork = observer(() => {
return ( return (
<div <div
key={index} key={index}
className={styles.option} className={classNames({
[styles.option]: true,
[styles.optionActive]:
activeFlowIndex === index,
})}
onClick={() => setActiveFlowIndex(index)} onClick={() => setActiveFlowIndex(index)}
> >
{item.title} {item.title}
......
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