Commit 252a5b86 authored by chenshouchao's avatar chenshouchao

Merge branch 'feat-20220801' into 'release'

cn-Feat 20220801

See merge request !92
parents 07afa5bb 94e4e0ba
......@@ -31,6 +31,7 @@ const ConsoleLayout = observer(() => {
const { currentProjectStore, fileListStore } = useStores();
const { openFileList, setOpenFileList } = fileListStore;
const productInfo = toJS(currentProjectStore.currentProductInfo);
console.log(productInfo);
const { run: runGetProjectList } = useMyRequest(getProjectList, {
onSuccess: (res) => {
let list = res.data;
......@@ -67,6 +68,16 @@ const ConsoleLayout = observer(() => {
const location = useLocation();
const { permissionStore, menuStore } = useStores();
// 不在产品页面下的时候清空
useEffect(() => {
console.log(location.pathname.slice(0, 8));
if (location.pathname.slice(0, 8) !== "/product") {
currentProjectStore.setProjectList([]);
currentProjectStore.changeProject({});
currentProjectStore.changeProductInfo({});
}
}, [location, currentProjectStore]);
useEffect(() => {
permissionStore.setSidebarRouters(location.pathname);
}, [location, permissionStore]);
......
......@@ -49,7 +49,6 @@ import {
} from "./utils";
import MyTooltip from "@/components/mui/MyTooltip";
import styles from "./index.module.css";
const stateMap = {
......@@ -78,7 +77,7 @@ const ProjectSubmitWork = observer(() => {
const [workFlowJobInfo, setWorkFlowJobInfo] = useState<ITaskInfo>();
const [patchInfo, setPatchInfo] = useState<any>();
const [overviewInfo, setOverviewInfo] = useState<any>();
const [overviewActive, setOverviewActive] = useState(true);
/** 选中的node Id */
const [activeFlowIndex, setActiveFlowIndex] = useState<string>("");
......@@ -243,7 +242,7 @@ const ProjectSubmitWork = observer(() => {
state: { type: "workbenchList" },
});
}
}, [navigate]);
}, [navigate, locationInfo.from]);
const getOutouts = (outputs: any) => {
if (outputs) {
......@@ -310,8 +309,9 @@ const ProjectSubmitWork = observer(() => {
if (Array.isArray(res.data)) {
res.data.forEach((item1) => {
if (item1.name === item.path.slice(item.path.lastIndexOf("/") + 1)) {
randerOutputs[index].size = `${item1.size ? storageUnitFromB(Number(item1.size)) : "-"
}`;
randerOutputs[index].size = `${
item1.size ? storageUnitFromB(Number(item1.size)) : "-"
}`;
setRanderOutputs([...randerOutputs]);
}
});
......@@ -348,7 +348,7 @@ const ProjectSubmitWork = observer(() => {
if (item.id === id) {
getworkFlowTaskInfoRun({
jobId: workFlowJobInfo?.id as string,
taskId: item.parentNode || item.id
taskId: item.parentNode || item.id,
});
}
});
......@@ -357,10 +357,10 @@ const ProjectSubmitWork = observer(() => {
const selectedParameter = useCallback(
(list: any) => {
let result: any = [];
list?.length &&
list?.length &&
list?.forEach((item: any) => {
if (item.id === activeFlowIndex) {
setOverviewInfo(item)
setOverviewInfo(item);
result = item.parameters;
}
});
......@@ -370,9 +370,9 @@ const ProjectSubmitWork = observer(() => {
);
const randerParameters = useMemo(() => {
if(patchInfo?.id === activeFlowIndex ) {
setOverviewInfo(patchInfo)
return patchInfo?.parameters
if (patchInfo?.id === activeFlowIndex) {
setOverviewInfo(patchInfo);
return patchInfo?.parameters;
} else {
return selectedParameter(patchInfo?.children);
}
......@@ -408,12 +408,20 @@ const ProjectSubmitWork = observer(() => {
const [popperTitle, setPopperTitle] = useState(
"正在运行的任务终止后将无法重新运行,确认继续吗?"
);
const [placement, setPlacement] = useState<"bottom" | "bottom-start">(
"bottom"
);
const [anchorEl, setAnchorEl] = useState<any>(null);
const handleCancel = () => {
setAnchorEl(null);
};
const handleShowPopper = (e: any, title: string) => {
const handleShowPopper = (
e: any,
title: string,
placementParams: "bottom" | "bottom-start"
) => {
setPlacement(placementParams);
setPopperTitle(title);
setAnchorEl(e.currentTarget);
};
......@@ -461,7 +469,8 @@ const ProjectSubmitWork = observer(() => {
e,
["SUBMITTED", "RUNNING"].includes(state || "")
? "正在运行的任务终止后将无法重新运行,确认继续吗?"
: "任务被删除后将无法恢复,确认继续吗?"
: "任务被删除后将无法恢复,确认继续吗?",
"bottom-start"
)
}
></MyButton>
......@@ -485,7 +494,6 @@ const ProjectSubmitWork = observer(() => {
className={styles.outputLiLeft}
onClick={(e: any) => {
handleDownLoadOutput(item);
// goToProjectData(getFolderPath(item.path));
}}
>
<img
......@@ -499,7 +507,6 @@ const ProjectSubmitWork = observer(() => {
{item.name}
</span>
</div>
{/* </MyPopconfirm> */}
<span className={styles.outputLiRight}>
{item.size}
</span>
......@@ -510,8 +517,8 @@ const ProjectSubmitWork = observer(() => {
)}
{(!workFlowJobInfo?.outputs ||
Object.keys(workFlowJobInfo?.outputs).length === 0) && (
<div className={styles.notResults}>暂无结果文件</div>
)}
<div className={styles.notResults}>暂无结果文件</div>
)}
<div className={styles.title}>任务信息</div>
<div className={styles.taskInfoLi}>
<div className={styles.taskInfoParams}>任务名称</div>
......@@ -538,7 +545,8 @@ const ProjectSubmitWork = observer(() => {
onClick={(e: any) => {
handleShowPopper(
e,
"即将跳转至项目数据内该任务的输出路径,确认继续吗?"
"即将跳转至项目数据内该任务的输出路径,确认继续吗?",
"bottom"
);
setGoToProjectDataPath(
workFlowJobInfo?.outputPath as string
......@@ -644,7 +652,9 @@ const ProjectSubmitWork = observer(() => {
)}
{activeFlowIndex && (
<div className={styles.suanziInfo}>
<MyTooltip><div className={styles.title}>{overviewInfo?.title}</div></MyTooltip>
<MyTooltip>
<div className={styles.title}>{overviewInfo?.title}</div>
</MyTooltip>
<div className={styles.tabs}>
<div
className={classNames({
......@@ -739,7 +749,7 @@ const ProjectSubmitWork = observer(() => {
style={fullScreenShow ? { height: "100vh" } : undefined}
>
<Flow
externalSelectedNodeId={activeFlowIndex}
externalSelectedNodeId={activeFlowIndex}
tasks={workFlowJobInfo?.tasks}
setExternalSelectedNodeId={setExternalSelectedNodeId}
/>
......@@ -756,6 +766,7 @@ const ProjectSubmitWork = observer(() => {
anchorEl={anchorEl}
onCancel={handleCancel}
onConfirm={handleConfirm}
placement={placement}
/>
{showSeeDataset && (
<SeeDataset
......@@ -766,7 +777,14 @@ const ProjectSubmitWork = observer(() => {
projectId={projectId as string}
></SeeDataset>
)}
{showLogView && <LogView isshow={showLogView} handleClose={handleClose} logs={logs} setShowAddTemplate={handleClose} />}
{showLogView && (
<LogView
isshow={showLogView}
handleClose={handleClose}
logs={logs}
setShowAddTemplate={handleClose}
/>
)}
</div>
);
});
......
......@@ -8,8 +8,6 @@
*/
import { toJS } from "mobx";
import React, { useEffect, useState } from "react";
import ArrowBackIosNewIcon from "@mui/icons-material/ArrowBackIosNew";
import IconButton from "@mui/material/IconButton";
import _ from "lodash";
import { useLocation, useNavigate } from "react-router-dom";
import moment from "moment";
......@@ -232,12 +230,20 @@ const ProjectSubmitWork = observer(() => {
const [popperTitle, setPopperTitle] = useState(
"提交前请先确认参数填写无误,确认提交吗?"
);
const [placement, setPlacement] = useState<
"bottom" | "bottom-start" | "bottom-end"
>("bottom");
const [anchorEl, setAnchorEl] = useState<any>(null);
const handleCancel = () => {
setAnchorEl(null);
};
const handleShowPopper = (e: any, title: string) => {
const handleShowPopper = (
e: any,
title: string,
placementParams: "bottom" | "bottom-start" | "bottom-end"
) => {
setPlacement(placementParams);
setPopperTitle(title);
setAnchorEl(anchorEl ? null : e.currentTarget);
};
......@@ -260,7 +266,11 @@ const ProjectSubmitWork = observer(() => {
src={goback}
alt=""
onClick={(e: any) =>
handleShowPopper(e, "返回将放弃当前页面所有操作,确认返回吗?")
handleShowPopper(
e,
"返回将放弃当前页面所有操作,确认返回吗?",
"bottom-end"
)
}
/>
<div className={styles.swTemplateTitle}>
......@@ -288,7 +298,11 @@ const ProjectSubmitWork = observer(() => {
<MyButton
text="提交任务"
onClick={(e: any) =>
handleShowPopper(e, "提交前请先确认参数填写无误,确认提交吗?")
handleShowPopper(
e,
"提交前请先确认参数填写无误,确认提交吗?",
"bottom-start"
)
}
></MyButton>
</div>
......@@ -328,6 +342,7 @@ const ProjectSubmitWork = observer(() => {
onCancel={handleCancel}
onConfirm={handleConfirm}
loading={loading}
placement={placement}
/>
</div>
);
......
......@@ -401,7 +401,9 @@ const ProjectMembers = observer(() => {
onClick={() => rowClick(item.id)}
>
<Box className={styles.tabBoxInfo}>
<MyTooltip title={item.name}><div className={styles.tabBoxTitle}>{item.name}</div></MyTooltip>
<MyTooltip title={item.name}>
<div className={styles.tabBoxTitle}>{item.name}</div>
</MyTooltip>
<Box className={styles.tabBoxDescInfo}>
<div
className={styles.tabBoxDesc}
......@@ -499,11 +501,7 @@ const ProjectMembers = observer(() => {
</MyCircularProgress>
</Box>
<div className={styles.pagination}>
<MyPagination
page={page}
pageChange={handleChangePage}
count={count || jobList.length}
/>
<MyPagination page={page} pageChange={handleChangePage} count={count} />
</div>
{/* <TablePagination
......
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