Commit a72b5ebe authored by chenshouchao's avatar chenshouchao

feat: 数据集跳转到数据管理页面逻辑修改

parent 43cfd8b7
import { useMemo, useCallback, useEffect, useState } from "react";
import { useMemo, useCallback, useState } from "react";
import { useNavigate } from "react-router-dom";
import MyProgress from "@/components/mui/MyProgress";
import { getDatasetPath } from "../../ProjectJobDetail/utils";
import style from "./index.module.css";
import { useStores } from "@/store";
import { toJS } from "mobx";
......@@ -27,7 +28,7 @@ type TaskCardProps = {
outputs: Array<any>;
};
const TaskCard = (props: TaskCardProps) => {
const TaskCard = observer((props: TaskCardProps) => {
const {
id,
name,
......@@ -66,15 +67,17 @@ const TaskCard = (props: TaskCardProps) => {
// 结果文件跳转
const goToProjectData = (info: any) => {
let { path = "", type = "" } = info;
const lastIndex = path.lastIndexOf("/");
// /projectData
// dataType
if (lastIndex !== -1) {
path = path.slice(0, lastIndex);
if (type === "file") {
const lastIndex = path.lastIndexOf("/");
if (lastIndex !== -1) {
path = path.slice(0, lastIndex);
}
path = path.slice(12);
} else {
path = getDatasetPath(path);
}
path = path.slice(12);
navigate(`/product/${productId || "cadd"}/projectData`, {
state: { pathName: path || "/", dataType: type },
state: { pathName: path, dataType: type },
});
};
// 跳转详情页
......@@ -247,6 +250,6 @@ const TaskCard = (props: TaskCardProps) => {
</div>
</div>
);
};
});
export default TaskCard;
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