Commit 2c3d1fe9 authored by chenshouchao's avatar chenshouchao

Merge branch 'feat-20220801' into 'staging'

Feat 20220801

See merge request !52
parents aafef480 48397525
...@@ -30,6 +30,15 @@ type IGetDatasetItemsListParams = { ...@@ -30,6 +30,15 @@ type IGetDatasetItemsListParams = {
sort?: string; // 排序 sort?: string; // 排序
} }
type IGetDatasetSizeParams = {
type?: string; // 产品id
projectId: string;
token: string;
filetoken: string;
path: string; // 数据集路径
name: string; // 数据集名称
}
type ISaveDatasetParams = { type ISaveDatasetParams = {
type?: string; type?: string;
projectId: string; projectId: string;
...@@ -244,6 +253,19 @@ class CloudEController { ...@@ -244,6 +253,19 @@ class CloudEController {
} }
} }
// 获取dataset条数
static GetDatasetSize(params: IGetDatasetSizeParams) {
if (ApiUtils.getAuthorizationHeaders(headers)) {
headers["Cache-Control"] = "no-cache";
let url = getUrlThroughParams(params, ['filetoken','path','token'], '?')
return axios.get(
`${APIOPTION()}:5003/size${url}`,
{
headers: headers,
}
);
}
}
// 获取分子列表 // 获取分子列表
static GetDatasetItemsList(params: IGetDatasetItemsListParams) { static GetDatasetItemsList(params: IGetDatasetItemsListParams) {
......
...@@ -69,7 +69,7 @@ const MyPopconfirm = (props: IMyPopconfirmProps) => { ...@@ -69,7 +69,7 @@ const MyPopconfirm = (props: IMyPopconfirmProps) => {
bgcolor: "#fff", bgcolor: "#fff",
minWidth: "200px", minWidth: "200px",
borderRadius: "4px", borderRadius: "4px",
fontSize:"14px", fontSize: "14px",
padding: "20px 16px", padding: "20px 16px",
boxShadow: "0px 3px 10px 0px rgba(0, 24, 57, 0.14)", boxShadow: "0px 3px 10px 0px rgba(0, 24, 57, 0.14)",
}} }}
......
...@@ -11,7 +11,7 @@ import Radio from "@mui/material/Radio"; ...@@ -11,7 +11,7 @@ import Radio from "@mui/material/Radio";
import RadioGroup, { RadioGroupProps } from "@mui/material/RadioGroup"; import RadioGroup, { RadioGroupProps } from "@mui/material/RadioGroup";
import FormControlLabel from "@mui/material/FormControlLabel"; import FormControlLabel from "@mui/material/FormControlLabel";
import FormControl from "@mui/material/FormControl"; import FormControl from "@mui/material/FormControl";
import FormHelperText from '@mui/material/FormHelperText'; import FormHelperText from "@mui/material/FormHelperText";
interface IMyRadioProps extends RadioGroupProps { interface IMyRadioProps extends RadioGroupProps {
value: any; value: any;
...@@ -20,7 +20,7 @@ interface IMyRadioProps extends RadioGroupProps { ...@@ -20,7 +20,7 @@ interface IMyRadioProps extends RadioGroupProps {
variant?: "standard" | "outlined" | "filled"; variant?: "standard" | "outlined" | "filled";
error?: boolean; error?: boolean;
helperText?: string; helperText?: string;
}; }
type ICheckBoxOption = { type ICheckBoxOption = {
value: any; value: any;
...@@ -45,7 +45,14 @@ export const optionsTransform = ( ...@@ -45,7 +45,14 @@ export const optionsTransform = (
}; };
export default function MyRadio(props: IMyRadioProps) { export default function MyRadio(props: IMyRadioProps) {
const { value, options, onChange , error = false, helperText, variant} = props; const {
value,
options,
onChange,
error = false,
helperText,
variant,
} = props;
return ( return (
<FormControl fullWidth variant={variant} error={error}> <FormControl fullWidth variant={variant} error={error}>
...@@ -62,7 +69,7 @@ export default function MyRadio(props: IMyRadioProps) { ...@@ -62,7 +69,7 @@ export default function MyRadio(props: IMyRadioProps) {
<FormControlLabel <FormControlLabel
key={option.value} key={option.value}
value={option.value} value={option.value}
control={<Radio />} control={<Radio sx={{ color: "rgba(209, 214, 222, 1)" }} />}
label={option.label} label={option.label}
disabled={option.disabled} disabled={option.disabled}
/> />
......
...@@ -128,7 +128,7 @@ export default function MySelect(props: IProps) { ...@@ -128,7 +128,7 @@ export default function MySelect(props: IProps) {
return ( return (
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<FormControl fullWidth={fullWidth} variant={variant}> <FormControl fullWidth={fullWidth} variant={variant} error={error}>
{isTitle ? ( {isTitle ? (
<InputLabel id="demo-simple-select-label"> <InputLabel id="demo-simple-select-label">
{title || "请选择"} {title || "请选择"}
......
...@@ -115,7 +115,7 @@ const Tabs = (props: IProps) => { ...@@ -115,7 +115,7 @@ const Tabs = (props: IProps) => {
return ( return (
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<TabContext value={value}> <TabContext value={value}>
<Box sx={{ borderBottom: 1, borderColor: "#F0F2F5" }}> <Box sx={{ borderBottom: 1, borderColor: "#EDEFF2" }}>
<TabList <TabList
onChange={(e: any, val: string) => { onChange={(e: any, val: string) => {
onChange(val); onChange(val);
......
.topApp { .topApp {
height: 56px; height: 56px;
background-color: white; background-color: white;
border-bottom: #e6e8eb 1px solid; border-bottom: #dde1e6 1px solid;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
margin-top: -10px; margin-top: -10px;
} }
.uploadIconBox{ .uploadIconBox {
width: 32px; width: 32px;
height: 32px; height: 32px;
display: flex; display: flex;
...@@ -26,13 +26,12 @@ ...@@ -26,13 +26,12 @@
margin-right: 16px; margin-right: 16px;
} }
.uploadIconBox:hover{ .uploadIconBox:hover {
background-color: #f0f2f5; background-color: #f0f2f5;
border-radius: 2px; border-radius: 2px;
cursor: pointer; cursor: pointer;
} }
.topRightBox { .topRightBox {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
......
...@@ -205,6 +205,7 @@ const OperatorList = (props: IProps) => { ...@@ -205,6 +205,7 @@ const OperatorList = (props: IProps) => {
value={keyword} value={keyword}
onChange={keywordChange} onChange={keywordChange}
onKeyUp={handleKeywordKeyUp} onKeyUp={handleKeywordKeyUp}
sx={{ fontSize: "14px" }}
/> />
</div> </div>
<div className={styles.list} onScroll={(e) => handleScroll(e)}> <div className={styles.list} onScroll={(e) => handleScroll(e)}>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
justify-content: center; justify-content: center;
} }
.aside { .aside {
border-right: 1px solid #e6e8eb; border-right: 1px solid #dde1e6;
width: 10%; width: 10%;
min-width: 220px; min-width: 220px;
height: calc(100vh - 57px); height: calc(100vh - 57px);
......
...@@ -159,7 +159,7 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -159,7 +159,7 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
}; };
return ( return (
<FullScreenDrawer handleClose={props.handleClose}> <FullScreenDrawer handleClose={props.handleClose} zIndex={1100}>
<div <div
className={classNames({ className={classNames({
[style.datasetBox]: true, [style.datasetBox]: true,
......
...@@ -164,12 +164,12 @@ const Save = (props: ISaveProps) => { ...@@ -164,12 +164,12 @@ const Save = (props: ISaveProps) => {
value={showDpath} value={showDpath}
required required
label="保存路径" label="保存路径"
InputProps={{
endAdornment: (
<img
onClick={() => { onClick={() => {
setFileSelectOpen(true); setFileSelectOpen(true);
}} }}
InputProps={{
endAdornment: (
<img
src={fileSelectIcon} src={fileSelectIcon}
alt="选择输出路径" alt="选择输出路径"
style={{ cursor: "pointer" }} style={{ cursor: "pointer" }}
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
.uploderBoxLeft { .uploderBoxLeft {
width: 300px; width: 300px;
} }
.dropTitle { .dropTitle {
line-height: 22px; line-height: 22px;
font-size: 14px; font-size: 14px;
...@@ -14,6 +15,7 @@ ...@@ -14,6 +15,7 @@
font-weight: 600; font-weight: 600;
} }
.dropBox { .dropBox {
cursor: pointer;
height: 300px; height: 300px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -22,6 +24,9 @@ ...@@ -22,6 +24,9 @@
border: 1px dashed #d1d6de; border: 1px dashed #d1d6de;
border-radius: 4px; border-radius: 4px;
} }
.dropBox:hover {
background-color: #f7f8fa;
}
.dropBoxDragActive { .dropBoxDragActive {
background-color: #f7f8fa; background-color: #f7f8fa;
} }
...@@ -54,12 +59,12 @@ ...@@ -54,12 +59,12 @@
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
} }
.fileIconBoxText{ .fileIconBoxText {
display: block; display: block;
width: 260px; width: 260px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
-o-text-overflow:ellipsis; -o-text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.noFile { .noFile {
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
width: calc(100vw - 220px); width: calc(100vw - 220px);
position: fixed; position: fixed;
bottom: 0px; bottom: 0px;
border: 1px solid #ebedf0; border-top: 1px solid #ebedf0;
z-index: 100; z-index: 100;
background-color: #fff; background-color: #fff;
display: flex; display: flex;
......
.logView {
position: absolute;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .5);
z-index: 1002;
}
.logViewBox {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 900px;
height: 600px;
background: #282C34;
box-shadow: 2px 4px 20px 0px rgba(0, 15, 45, 0.1200);
border-radius: 8px;
}
.close {
position: absolute;
right: 0;
top: -28px;
cursor: pointer;
color: #fff;
}
.logViewTop {
/* height: 30px; */
background-color: #1D2126;
border-radius: 8px 8px 0 0;
display: flex;
font-size: 12px;
color: #8A9099;
overflow: auto;
}
.logViewTop::-webkit-scrollbar-track {
background-color: #282C34;
}
.logTitle {
display: flex;
align-items: center;
height: 30px;
line-height: 20px;
padding: 0 24px;
cursor: pointer;
}
.logTitleSelected {
background: #282C34;
color: #FFFFFF;
}
.fileIcon{
width: 14px!important;
margin-right: 4px;
}
.logViewContent {
position: relative;
box-sizing: border-box;
height: 510px;
padding: 16px 24px 0;
color: #D1D6DE;
white-space:pre-wrap;
word-break: break-word;
overflow: auto;
font-size: 14px;
line-height: 22px;
}
.logViewContentMask{
height: 16px;
width: 852px;
background-color: #282C34;
position: absolute;
top: 30px;
left: 24px;
z-index: 1005;
}
.logViewContent::-webkit-scrollbar-track {
background-color: #282C34;
}
.logViewBottom {
display: flex;
align-items: center;
justify-content: end;
height: 60px;
padding-right: 24px;
}
\ No newline at end of file
import { useState, useCallback, useEffect, useMemo } from "react";
import classnames from "classnames";
import style from "./index.module.css";
import CloseIcon from "@mui/icons-material/Close";
import MyButton from "@/components/mui/MyButton";
import InsertDriveFileOutlinedIcon from "@mui/icons-material/InsertDriveFileOutlined";
import CloudEController from "@/api/fileserver/CloudEController";
import { useStores } from "@/store";
import { toJS } from "mobx";
type LogViewProps = {
isshow: boolean;
handleClose: () => void;
logs: any[];
};
const LogView = (props: LogViewProps) => {
const { isshow, handleClose, logs } = props;
const { currentProjectStore } = useStores();
const fileToken = toJS(currentProjectStore.currentProjectInfo.filetoken);
const projectId = toJS(currentProjectStore.currentProjectInfo.id);
// 当前选择的日志
const [logCurrent, setLogCurrent] = useState<number>(0);
// 当前日志的内容文本
const [logText, setLogText] = useState('')
// 当前日志路径
const [logPath, setLogPath] = useState('')
useEffect(() => {
setLogPath(logs[logCurrent]?.logPath)
}, [logs]);
// 请求日志文本
useEffect(() => {
if (logPath) {
const path = logPath.slice(12)
CloudEController.JobFileDownloadText(
path,
fileToken as string,
projectId as string
)?.then((res) => {
setLogText(res.data)
})
}else{
setLogText("")
}
}, [logPath]);
// 选择日志时改变日志路径
useEffect(() => {
setLogPath(logs[logCurrent]?.logPath)
}, [logCurrent]);
// 下载当前日志
const handleDownLoad=()=>{
const path = logPath.slice(12)
CloudEController.JobFileDownload(
path,
fileToken as string,
projectId as string
);
}
return <div className={style.logView} style={isshow ? {} : { display: "none" }}>
<div className={style.logViewBox}>
<CloseIcon onClick={handleClose} className={style.close} />
<div className={style.logViewContentMask}></div>
<div className={style.logViewTop}>
{logs.map((item: any, index: number) => {
return <div
key={index}
onClick={() => { setLogCurrent(index) }}
className={classnames({
[style.logTitle]: true,
[style.logTitleSelected]: index === logCurrent,
})}>
<InsertDriveFileOutlinedIcon className={style.fileIcon} />
<span>{item.logName}</span>
</div>
})}
</div>
<div className={style.logViewContent}>
{logText}
</div>
<div className={style.logViewBottom}>
<MyButton text='下载当前日志' onClick={handleDownLoad} />
</div>
</div>
</div>
}
export default LogView
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-21 20:03:56 * @Date: 2022-06-21 20:03:56
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-09 18:28:39 * @LastEditTime: 2022-08-11 17:13:52
* @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/index.tsx * @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -28,16 +28,16 @@ import jobFail from "@/assets/project/jobFail.svg"; ...@@ -28,16 +28,16 @@ import jobFail from "@/assets/project/jobFail.svg";
import fileIcon from "@/assets/project/fileIcon.svg"; import fileIcon from "@/assets/project/fileIcon.svg";
import dataSetIcon from "@/assets/project/dataSetIcon.svg"; import dataSetIcon from "@/assets/project/dataSetIcon.svg";
import { useStores } from "@/store"; import { useStores } from "@/store";
import { getDataFind } from "@/api/project_api";
import { ITaskInfo } from "../ProjectSubmitWork/interface"; import { ITaskInfo } from "../ProjectSubmitWork/interface";
import Flow from "../components/Flow"; import Flow from "../components/Flow";
import { cancelWorkflowJob, deleteWorkflowJob } from "@/api/workbench_api"; import { cancelWorkflowJob, deleteWorkflowJob } from "@/api/workbench_api";
import { useMessage } from "@/components/MySnackbar"; import { useMessage } from "@/components/MySnackbar";
import MyPopconfirm from "@/components/mui/MyPopconfirm"; import MyPopconfirm from "@/components/mui/MyPopconfirm";
import { storageUnitFromB } from "@/utils/util"; import SeeDataset from "../ProjectData/SeeDataset";
import { getToken, storageUnitFromB } from "@/utils/util";
import styles from "./index.module.css"; import LogView from "./LogView"
import usePass from "@/hooks/usePass"; import usePass from "@/hooks/usePass";
import styles from "./index.module.css";
const stateMap = { const stateMap = {
RUNNING: "正在运行", RUNNING: "正在运行",
...@@ -60,6 +60,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -60,6 +60,7 @@ const ProjectSubmitWork = observer(() => {
const { currentProjectStore } = useStores(); const { currentProjectStore } = useStores();
const fileToken = toJS(currentProjectStore.currentProjectInfo.filetoken); const fileToken = toJS(currentProjectStore.currentProjectInfo.filetoken);
const projectId = toJS(currentProjectStore.currentProjectInfo.id); const projectId = toJS(currentProjectStore.currentProjectInfo.id);
const productId = toJS(currentProjectStore.currentProductInfo.id);
const [workFlowJobInfo, setWorkFlowJobInfo] = useState<ITaskInfo>(); const [workFlowJobInfo, setWorkFlowJobInfo] = useState<ITaskInfo>();
const [patchInfo, setPatchInfo] = useState<any>(); const [patchInfo, setPatchInfo] = useState<any>();
const [activePatchId, setActivePatchId] = useState<string>(""); const [activePatchId, setActivePatchId] = useState<string>("");
...@@ -72,8 +73,18 @@ const ProjectSubmitWork = observer(() => { ...@@ -72,8 +73,18 @@ const ProjectSubmitWork = observer(() => {
const message = useMessage(); const message = useMessage();
const isPass = usePass(); const isPass = usePass();
const [fullScreenShow, setFullScreenShow] = useState<boolean>(false); const [fullScreenShow, setFullScreenShow] = useState<boolean>(false);
// 查看日志弹框显示
const [showLogView, setShowLogView] = useState<boolean>(false);
// 日志信息
const [logs, setLogs] = useState<Array<any>>([])
const { name, state } = workFlowJobInfo || {}; const { name, state } = workFlowJobInfo || {};
// 查看数据集(数据集详情)显示控制
const [showSeeDataset, setShowSeeDataset] = useState(false);
// 查看的数据集的数据集名称
const [seeDatasetName, setSeeDatasetName] = useState("");
// 查看的数据集的数据集路径
const [seeDatasetPath, setSeeDatasetPath] = useState("");
/** 获取模版数据 */ /** 获取模版数据 */
const { run } = useMyRequest(fetchWorkFlowJob, { const { run } = useMyRequest(fetchWorkFlowJob, {
...@@ -81,10 +92,22 @@ const ProjectSubmitWork = observer(() => { ...@@ -81,10 +92,22 @@ const ProjectSubmitWork = observer(() => {
pollingWhenHidden: false, pollingWhenHidden: false,
onSuccess: (res: IResponse<ITaskInfo>) => { onSuccess: (res: IResponse<ITaskInfo>) => {
getOutouts(res.data.outputs); getOutouts(res.data.outputs);
getLogs(res.data);
setWorkFlowJobInfo(res.data); setWorkFlowJobInfo(res.data);
}, },
}); });
// 处理日志数据
const getLogs = (data: any) => {
let logs = [{ logName: "workflow.log", logPath: data.logPath }]
data.tasks.forEach((i: any) => {
if (i.outLog) {
logs.push({ logName: `${i.title}.log`, logPath: i.outLog })
}
});
setLogs(logs)
}
useEffect(() => { useEffect(() => {
const locationInfo: any = location?.state; const locationInfo: any = location?.state;
run({ run({
...@@ -113,12 +136,53 @@ const ProjectSubmitWork = observer(() => { ...@@ -113,12 +136,53 @@ const ProjectSubmitWork = observer(() => {
}; };
// 通过文件路径获取文件所在文件夹路径 如 输入 /ProjectData/task_a.out 输出/ProjectData/ // 通过文件路径获取文件所在文件夹路径 如 输入 /ProjectData/task_a.out 输出/ProjectData/
const getFolderPath = (path: string) => { // const getFolderPath = (path: string) => {
// const lastIndex = path.lastIndexOf("/");
// if (lastIndex !== -1) {
// path = path.slice(0, lastIndex);
// }
// return path;
// };
// 根据outputs的路径获取数据集的路径
const getDatasetPath = (path: string) => {
let datasetPath = "";
const noProjectPath = path.slice(12);
const fileIndex = noProjectPath.indexOf("/.dataset");
if (fileIndex !== -1) {
datasetPath = noProjectPath.slice(0, fileIndex);
} else {
datasetPath = noProjectPath;
}
return datasetPath ? datasetPath : "/";
};
// 根据outputs的路径获取数据集的名称
const getDatasetName = (path: string) => {
let name = "";
let nameIndex = path.indexOf("/.dataset/") + 10;
const lastIndex = path.lastIndexOf("/"); const lastIndex = path.lastIndexOf("/");
if (lastIndex !== -1) { if (nameIndex !== -1 && lastIndex !== -1) {
path = path.slice(0, lastIndex); name = path.slice(nameIndex, lastIndex);
}
return name;
};
// 下载任务结果
const handleDownLoadOutput = (item: any) => {
// 是文件下载
if (item.type !== "dataset") {
CloudEController.JobFileDownload(
item.path.slice(12),
fileToken as string,
projectId as string
);
} else {
// 是数据集 查看数据集
setSeeDatasetPath(getDatasetPath(item.path));
setSeeDatasetName(getDatasetName(item.path));
setShowSeeDataset(true);
} }
return path;
}; };
/** 返回事件 */ /** 返回事件 */
...@@ -133,11 +197,6 @@ const ProjectSubmitWork = observer(() => { ...@@ -133,11 +197,6 @@ const ProjectSubmitWork = observer(() => {
} }
}, [navigate]); }, [navigate]);
const outputPathTransform = (path: string) => {
path = path.slice(1);
return path;
};
const getOutouts = (outputs: any) => { const getOutouts = (outputs: any) => {
if (outputs) { if (outputs) {
let result = Object.keys(outputs); let result = Object.keys(outputs);
...@@ -169,22 +228,20 @@ const ProjectSubmitWork = observer(() => { ...@@ -169,22 +228,20 @@ const ProjectSubmitWork = observer(() => {
}; };
const getDataSetSize = async (item: any, index: number) => { const getDataSetSize = async (item: any, index: number) => {
let path = item.path.slice(12); CloudEController.GetDatasetSize({
const lastIndex = path.lastIndexOf("/"); type: productId,
if (lastIndex === -1) {
path = "/";
} else {
path = path.slice(0, lastIndex + 1);
}
const res = await getDataFind({
projectId: projectId as string, projectId: projectId as string,
path: path, token: getToken(),
}); filetoken: fileToken as string,
res.data.forEach((item1: any) => { path: getDatasetPath(item.path),
if (item1.name === item.path.slice(item.path.lastIndexOf("/") + 1)) { name: getDatasetName(item.path),
randerOutputs[index].size = `${item1.size}条`; })
?.then((res) => {
randerOutputs[index].size = `${res.data}条`;
setRanderOutputs([...randerOutputs]); setRanderOutputs([...randerOutputs]);
} })
?.catch(() => {
message.error("获取数据集大小失败");
}); });
}; };
...@@ -205,8 +262,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -205,8 +262,7 @@ const ProjectSubmitWork = observer(() => {
if (Array.isArray(res.data)) { if (Array.isArray(res.data)) {
res.data.forEach((item1) => { res.data.forEach((item1) => {
if (item1.name === item.path.slice(item.path.lastIndexOf("/") + 1)) { if (item1.name === item.path.slice(item.path.lastIndexOf("/") + 1)) {
randerOutputs[index].size = `${ randerOutputs[index].size = `${item1.size ? storageUnitFromB(Number(item1.size)) : "-"
item1.size ? storageUnitFromB(Number(item1.size)) : "-"
}`; }`;
setRanderOutputs([...randerOutputs]); setRanderOutputs([...randerOutputs]);
} }
...@@ -322,6 +378,10 @@ const ProjectSubmitWork = observer(() => { ...@@ -322,6 +378,10 @@ const ProjectSubmitWork = observer(() => {
} }
}; };
const handleClose = () => {
setShowLogView(false)
}
return ( return (
<div className={styles.swBox}> <div className={styles.swBox}>
{fullScreenShow ? null : ( {fullScreenShow ? null : (
...@@ -391,7 +451,8 @@ const ProjectSubmitWork = observer(() => { ...@@ -391,7 +451,8 @@ const ProjectSubmitWork = observer(() => {
<div <div
className={styles.outputLiLeft} className={styles.outputLiLeft}
onClick={(e: any) => { onClick={(e: any) => {
goToProjectData(getFolderPath(item.path)); handleDownLoadOutput(item);
// goToProjectData(getFolderPath(item.path));
}} }}
> >
<img <img
...@@ -447,12 +508,9 @@ const ProjectSubmitWork = observer(() => { ...@@ -447,12 +508,9 @@ const ProjectSubmitWork = observer(() => {
setGoToProjectDataPath( setGoToProjectDataPath(
workFlowJobInfo?.outputPath as string workFlowJobInfo?.outputPath as string
); );
// goToProjectData(workFlowJobInfo?.outputPath as string)
}} }}
> >
{workFlowJobInfo?.outputPath {workFlowJobInfo?.outputPath || "-"}
? outputPathTransform(workFlowJobInfo?.outputPath)
: "-"}
</div> </div>
</div> </div>
<div className={styles.taskInfoLi}> <div className={styles.taskInfoLi}>
...@@ -529,12 +587,20 @@ const ProjectSubmitWork = observer(() => { ...@@ -529,12 +587,20 @@ const ProjectSubmitWork = observer(() => {
<div className={styles.taskInfoParams}>日志文件</div> <div className={styles.taskInfoParams}>日志文件</div>
<div className={styles.taskInfoValue}> <div className={styles.taskInfoValue}>
{workFlowJobInfo?.logPath && ( {workFlowJobInfo?.logPath && (
<span <>
{/* <span
className={styles.taskInfoDownload} className={styles.taskInfoDownload}
onClick={() => handleDownLoad(workFlowJobInfo?.logPath)} onClick={() => handleDownLoad(workFlowJobInfo?.logPath)}
> >
下载 下载
</span> */}
<span
className={styles.taskInfoDownload}
onClick={() => setShowLogView(true)}
>
查看
</span> </span>
</>
)} )}
{!workFlowJobInfo?.logPath && "-"} {!workFlowJobInfo?.logPath && "-"}
</div> </div>
...@@ -673,6 +739,20 @@ const ProjectSubmitWork = observer(() => { ...@@ -673,6 +739,20 @@ const ProjectSubmitWork = observer(() => {
onCancel={handleCancel} onCancel={handleCancel}
onConfirm={handleConfirm} onConfirm={handleConfirm}
/> />
{showSeeDataset && (
<SeeDataset
handleClose={() => setShowSeeDataset(false)}
name={seeDatasetName}
path={seeDatasetPath}
fileToken={fileToken as string}
projectId={projectId as string}
></SeeDataset>
)}
<LogView
isshow={showLogView}
handleClose={handleClose}
logs={logs}
/>
</div> </div>
); );
}); });
......
...@@ -21,7 +21,6 @@ import { toJS } from "mobx"; ...@@ -21,7 +21,6 @@ import { toJS } from "mobx";
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
import InformationDisplay from "@/components/CommonComponents/InformationDisplay"; import InformationDisplay from "@/components/CommonComponents/InformationDisplay";
import classnames from "classnames"; import classnames from "classnames";
import { TextField } from "@mui/material";
import LoadingButton from "@mui/lab/LoadingButton"; import LoadingButton from "@mui/lab/LoadingButton";
import InputAdornment from "@mui/material/InputAdornment"; import InputAdornment from "@mui/material/InputAdornment";
import { useMessage } from "@/components/MySnackbar"; import { useMessage } from "@/components/MySnackbar";
...@@ -29,11 +28,8 @@ import Loading from "@/views/Loading"; ...@@ -29,11 +28,8 @@ import Loading from "@/views/Loading";
import MyDialog from "@/components/mui/MyDialog"; import MyDialog from "@/components/mui/MyDialog";
import { getProjectList } from "../../project"; import { getProjectList } from "../../project";
import { checkIsNumberLetterChinese } from "@/utils/util"; import { checkIsNumberLetterChinese } from "@/utils/util";
import {
setFileServerEndPointLocalStorage,
getFiletokenAccordingToId,
} from "@/views/Project/project";
import MyButton from "@/components/mui/MyButton"; import MyButton from "@/components/mui/MyButton";
import MySelect, { optionsTransform } from "@/components/mui/MySelect";
import MyInput from "@/components/mui/MyInput"; import MyInput from "@/components/mui/MyInput";
type zoneIdOption = { type zoneIdOption = {
...@@ -205,7 +201,11 @@ const BaseInfo = observer(() => { ...@@ -205,7 +201,11 @@ const BaseInfo = observer(() => {
showMessage && message.error(help); showMessage && message.error(help);
return false; return false;
} else if (budget) { } else if (budget) {
if (isNaN(Number(budget)) || Number(budget) > 10000000 || Number(budget) < 0) { if (
isNaN(Number(budget)) ||
Number(budget) > 10000000 ||
Number(budget) < 0
) {
help = "格式错误,请输入0~10000000之间的数值,结果最高保留两位小数。"; help = "格式错误,请输入0~10000000之间的数值,结果最高保留两位小数。";
setBudgetCheck({ setBudgetCheck({
error: true, error: true,
...@@ -229,7 +229,7 @@ const BaseInfo = observer(() => { ...@@ -229,7 +229,7 @@ const BaseInfo = observer(() => {
showMessage && message.error(help); showMessage && message.error(help);
return false; return false;
} }
} };
const budgetChange = (e: any) => { const budgetChange = (e: any) => {
setProjectInfo({ setProjectInfo({
...@@ -237,13 +237,16 @@ const BaseInfo = observer(() => { ...@@ -237,13 +237,16 @@ const BaseInfo = observer(() => {
projectBudget: e.target.value, projectBudget: e.target.value,
}); });
checkBudget(e.target.value); checkBudget(e.target.value);
} };
const budgetBlur = (e: any) => { const budgetBlur = (e: any) => {
if (e.target.value.indexOf(" ") == -1 && e.target.value) { if (e.target.value.indexOf(" ") === -1 && e.target.value) {
setProjectInfo({ setProjectInfo({
...projectInfo, ...projectInfo,
projectBudget: Number(e.target.value) || Number(e.target.value) == 0 ? Number(e.target.value).toFixed(2) : e.target.value, projectBudget:
Number(e.target.value) || Number(e.target.value) === 0
? Number(e.target.value).toFixed(2)
: e.target.value,
}); });
} }
}; };
...@@ -262,7 +265,10 @@ const BaseInfo = observer(() => { ...@@ -262,7 +265,10 @@ const BaseInfo = observer(() => {
// 修改项目 // 修改项目
const handleClickUpdate = () => { const handleClickUpdate = () => {
if (checkName(projectInfo.name, true) && checkBudget(projectInfo.projectBudget, true)) { if (
checkName(projectInfo.name, true) &&
checkBudget(projectInfo.projectBudget, true)
) {
updateProjectRun({ ...projectInfo, product: "cadd" }); updateProjectRun({ ...projectInfo, product: "cadd" });
} else { } else {
return; return;
...@@ -276,20 +282,9 @@ const BaseInfo = observer(() => { ...@@ -276,20 +282,9 @@ const BaseInfo = observer(() => {
const projectList = await getProjectList(); const projectList = await getProjectList();
currentProjectStore.setProjectList(projectList); currentProjectStore.setProjectList(projectList);
// 项目删完了 // 项目删完了
// if (projectList.length === 0) {
currentProjectStore.changeProject({}); currentProjectStore.changeProject({});
localStorage.setItem("fileServerEndPoint", ""); localStorage.setItem("fileServerEndPoint", "");
setProjectInfo({}); setProjectInfo({});
// } else {
// projectList[0].filetoken = getFiletokenAccordingToId(projectList[0].id);
// currentProjectStore.changeProject(projectList[0]);
// setFileServerEndPointLocalStorage(projectList[0].zoneId);
// getFiletokenAccordingToId(projectList[0].id).then((res) => {
// projectList[0].filetoken = res;
// currentProjectStore.changeProject(projectList[0]);
// });
// setProjectInfo(projectList[0]);
// }
}, },
}); });
...@@ -352,31 +347,15 @@ const BaseInfo = observer(() => { ...@@ -352,31 +347,15 @@ const BaseInfo = observer(() => {
placeholder="项目描述限制300字以内" placeholder="项目描述限制300字以内"
maxLength={300} maxLength={300}
></textarea> ></textarea>
{/* <MyInput
value={projectInfo.desc}
multiline
rows={4}
placeholder="项目描述限制100字以内"
onChange={descChange}
/> */}
</div> </div>
<div className={style.projectInfoListLi}> <div className={style.projectInfoListLi}>
<div className={style.projectInfoListLiLabel}>计算区</div> <div className={style.projectInfoListLiLabel}>计算区</div>
<select <MySelect
value={projectInfo.zoneId} value={projectInfo.zoneId}
disabled disabled
className={classnames({ options={optionsTransform(zoneIdOptions, "name", "id")}
[style.projectInfoListLiValue]: true, sx={{ width: "560px" }}
[style.projectInfoSelect]: true, ></MySelect>
[style.disable]: true,
})}
>
{zoneIdOptions.map((option) => (
<option key={option.id} value={option.id}>
{option.name}
</option>
))}
</select>
</div> </div>
<div className={style.projectInfoListLi}> <div className={style.projectInfoListLi}>
<div className={style.projectInfoListLiLabel}>创建人</div> <div className={style.projectInfoListLiLabel}>创建人</div>
...@@ -410,8 +389,8 @@ const BaseInfo = observer(() => { ...@@ -410,8 +389,8 @@ const BaseInfo = observer(() => {
padding: "6.5px 2px", padding: "6.5px 2px",
}, },
"& .MuiTypography-root": { "& .MuiTypography-root": {
fontSize: '14px' fontSize: "14px",
} },
}} }}
/> />
</div> </div>
...@@ -425,32 +404,32 @@ const BaseInfo = observer(() => { ...@@ -425,32 +404,32 @@ const BaseInfo = observer(() => {
</div> </div>
<div className={style.projectInfoListLi}> <div className={style.projectInfoListLi}>
<LoadingButton <LoadingButton
variant="outlined" variant="contained"
className={style.updateButton} className={style.updateButton}
onClick={handleClickUpdate} onClick={handleClickUpdate}
loading={updateLoading} loading={updateLoading}
sx={{ sx={{
height:"32px" height: "32px",
}} }}
> >
保存修改 保存修改
</LoadingButton> </LoadingButton>
</div> </div>
<div className={style.projectInfoListLi}> <div className={style.projectInfoListLi}>
<div className={style.projectInfoListLiLabel}>删除项目</div> <div
className={style.projectInfoListLiLabel}
style={{ paddingTop: "12px" }}
>
删除项目
</div>
<div className={style.projectInfoListLiText}> <div className={style.projectInfoListLiText}>
删除项目将删除其存储的数据和所有相关资源,并且已删除的项目无法恢复!请谨慎操作! 删除项目将删除其存储的数据和所有相关资源,并且已删除的项目无法恢复!请谨慎操作!
</div> </div>
<MyButton <MyButton
text="删除项目" text="删除项目"
variant="contained" variant="outlined"
onClick={() => setDialogOpen(true)} onClick={() => setDialogOpen(true)}
color="error" color="error"
// style={{
// backgroundColor: "#fff",
// color: "#FF4E4E",
// border: "1px solid #FF4E4E",
// }}
/> />
</div> </div>
<MyDialog <MyDialog
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:18:13 * @Date: 2022-05-31 10:18:13
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-08 18:17:20 * @LastEditTime: 2022-08-11 18:05:06
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx * @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -37,15 +37,7 @@ const ChangePermission = observer((props: IProps) => { ...@@ -37,15 +37,7 @@ const ChangePermission = observer((props: IProps) => {
useEffect(() => { useEffect(() => {
if (permissionDialog?.isShow) { if (permissionDialog?.isShow) {
http.get<IResponse<any>>("/cpp/project/listroles").then((res) => { http.get<IResponse<any>>("/cpp/project/listroles").then((res) => {
const arr = []; setSelectOptions(res.data);
const { data } = res;
for (const key in data) {
arr.push({
label: String(data[key]),
value: key,
});
}
setSelectOptions(arr);
}); });
} }
}, [http, permissionDialog]); }, [http, permissionDialog]);
......
...@@ -12,7 +12,6 @@ import { Box } from "@mui/system"; ...@@ -12,7 +12,6 @@ import { Box } from "@mui/system";
import { useStores } from "@/store/index"; import { useStores } from "@/store/index";
import NoProject from "@/components/BusinessComponents/NoProject"; import NoProject from "@/components/BusinessComponents/NoProject";
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
import projectImg from "@/assets/project/projectIconSmall.svg";
import ProjectMembers from "./ProjectMembers"; import ProjectMembers from "./ProjectMembers";
import BaseInfo from "./BaseInfo"; import BaseInfo from "./BaseInfo";
import Tabs from "@/components/mui/Tabs"; import Tabs from "@/components/mui/Tabs";
...@@ -35,13 +34,22 @@ const ProjectSetting = observer(() => { ...@@ -35,13 +34,22 @@ const ProjectSetting = observer(() => {
component: <BaseInfo />, component: <BaseInfo />,
}, },
]; ];
}, []); }, [isPass]);
if (currentProjectStore.currentProjectInfo.name) { if (currentProjectStore.currentProjectInfo.name) {
return ( return (
<div style={{ padding:'28px 24px 24px' }}> <div style={{ padding: "28px 24px 24px" }}>
<div style={{ display: "flex", alignItems: "center" }}> <div style={{ display: "flex", alignItems: "center" }}>
<span style={{ fontSize: "18px", lineHeight: "26px", fontWeight: "600", color: "#1E2633" }}>项目设置</span> <span
style={{
fontSize: "18px",
lineHeight: "26px",
fontWeight: "600",
color: "#1E2633",
}}
>
项目设置
</span>
</div> </div>
<Box sx={{ width: "100%", typography: "body1" }}> <Box sx={{ width: "100%", typography: "body1" }}>
<Tabs tabList={tabList} /> <Tabs tabList={tabList} />
......
...@@ -16,17 +16,30 @@ ...@@ -16,17 +16,30 @@
line-height: 20px; line-height: 20px;
color: #565c66; color: #565c66;
} }
.formItemBox {
background: #ffffff;
box-shadow: 0px 3px 10px 0px rgba(0, 24, 57, 0.04);
border-radius: 4px;
border: 1px solid #ebedf0;
margin-bottom: 24px;
}
/* .taskBox {
margin-bottom: 24px;
} */
.backgroundTitle { .backgroundTitle {
background-color: rgba(245, 246, 247, 1); background-color: rgba(245, 246, 247, 1);
height: 48px; height: 48px;
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
padding: 12px 16px; padding: 12px 24px;
box-sizing: border-box; box-sizing: border-box;
position: relative; position: relative;
} }
.backgroundTitleTextIcon { .backgroundTitleTextIcon {
position: absolute;
top: 16px;
right: 24px;
visibility: hidden; visibility: hidden;
} }
.backgroundTitleTextIconShow { .backgroundTitleTextIconShow {
...@@ -37,7 +50,6 @@ ...@@ -37,7 +50,6 @@
font-weight: 600; font-weight: 600;
line-height: 24px; line-height: 24px;
color: rgba(30, 38, 51, 1); color: rgba(30, 38, 51, 1);
margin-left: 12px;
} }
.taskDescIcon { .taskDescIcon {
margin-left: 8px; margin-left: 8px;
...@@ -46,7 +58,7 @@ ...@@ -46,7 +58,7 @@
margin-left: 8px; margin-left: 8px;
} }
.formItems { .formItems {
padding: 20px 44px 40px 44px; padding: 16px 24px 4px;
} }
.formItem { .formItem {
margin-bottom: 20px; margin-bottom: 20px;
...@@ -69,18 +81,19 @@ ...@@ -69,18 +81,19 @@
} }
.taskConfigBox { .taskConfigBox {
padding: 24px 44px 40px 44px; padding: 16px 24px 4px;
} }
.flowTitle { .flowTitle {
line-height: 16px; line-height: 16px;
margin: 3px 0 27px; margin: 3px 0 27px;
color: rgba(30, 38, 51, 1); color: rgba(19, 112, 255, 1);
font-size: 14px; font-size: 14px;
font-weight: 600; font-weight: 600;
border-left: 3px solid rgba(19, 112, 255, 1); border-left: 3px solid rgba(19, 112, 255, 1);
padding-left: 3px; padding-left: 3px;
display: flex; display: flex;
align-items: center; align-items: center;
padding-left: 8px;
} }
.parameter { .parameter {
margin-bottom: 20px; margin-bottom: 20px;
......
...@@ -217,16 +217,15 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -217,16 +217,15 @@ const ConfigForm = (props: ConfigFormProps) => {
<div className={styles.parameterContent}> <div className={styles.parameterContent}>
{(parameter.domType || "").toLowerCase() === "file" && ( {(parameter.domType || "").toLowerCase() === "file" && (
<MyInput <MyInput
onFocus={() => setSelectedBatchNodeId(batchId || "")}
onBlur={() => setSelectedBatchNodeId("")}
value={parameter.value || ""}
InputProps={{
endAdornment: (
<img
onClick={() => { onClick={() => {
setSelectedBatchNodeId(batchId || "");
setFileSelectType("file"); setFileSelectType("file");
handleOpenFileSelect(taskId, parameter.name); handleOpenFileSelect(taskId, parameter.name);
}} }}
value={parameter.value || ""}
InputProps={{
endAdornment: (
<img
src={fileSelectIcon} src={fileSelectIcon}
alt="" alt=""
className={styles.fileSelectImg} className={styles.fileSelectImg}
...@@ -241,16 +240,15 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -241,16 +240,15 @@ const ConfigForm = (props: ConfigFormProps) => {
)} )}
{(parameter.domType || "").toLowerCase() === "path" && ( {(parameter.domType || "").toLowerCase() === "path" && (
<MyInput <MyInput
onFocus={() => setSelectedBatchNodeId(batchId || "")}
onBlur={() => setSelectedBatchNodeId("")}
value={parameter.value || ""}
InputProps={{
endAdornment: (
<img
onClick={() => { onClick={() => {
setSelectedBatchNodeId(batchId || "");
setFileSelectType("path"); setFileSelectType("path");
handleOpenFileSelect(taskId, parameter.name); handleOpenFileSelect(taskId, parameter.name);
}} }}
value={parameter.value || ""}
InputProps={{
endAdornment: (
<img
src={fileSelectIcon} src={fileSelectIcon}
alt="" alt=""
className={styles.fileSelectImg} className={styles.fileSelectImg}
...@@ -265,16 +263,15 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -265,16 +263,15 @@ const ConfigForm = (props: ConfigFormProps) => {
)} )}
{(parameter.domType || "").toLowerCase() === "dataset" && ( {(parameter.domType || "").toLowerCase() === "dataset" && (
<MyInput <MyInput
onFocus={() => setSelectedBatchNodeId(taskId)}
onBlur={() => setSelectedBatchNodeId("")}
value={parameter.value || ""}
InputProps={{
endAdornment: (
<img
onClick={() => { onClick={() => {
setSelectedBatchNodeId(taskId);
setFileSelectType("dataset"); setFileSelectType("dataset");
handleOpenFileSelect(taskId, parameter.name); handleOpenFileSelect(taskId, parameter.name);
}} }}
value={parameter.value || ""}
InputProps={{
endAdornment: (
<img
src={fileSelectIcon} src={fileSelectIcon}
alt="" alt=""
className={styles.fileSelectImg} className={styles.fileSelectImg}
...@@ -399,14 +396,21 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -399,14 +396,21 @@ const ConfigForm = (props: ConfigFormProps) => {
{templateConfigInfo?.description || ""} {templateConfigInfo?.description || ""}
</div> </div>
</div> </div>
<div className={styles.formItemBox}>
<div <div
className={classnames({ className={classnames({
[styles.backgroundTitle]: true, [styles.backgroundTitle]: true,
[styles.backgroundTitlePass]: true,
})} })}
> >
<img src="" alt="" />
<span className={styles.backgroundTitleText}>基础信息</span> <span className={styles.backgroundTitleText}>基础信息</span>
<img
className={classnames({
[styles.backgroundTitleTextIcon]: true,
[styles.backgroundTitleTextIconShow]: !nameHelp.error,
})}
src={jobSueIcon}
alt=""
/>
</div> </div>
<div className={styles.formItems}> <div className={styles.formItems}>
<div className={styles.formItem}> <div className={styles.formItem}>
...@@ -440,13 +444,14 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -440,13 +444,14 @@ const ConfigForm = (props: ConfigFormProps) => {
<div className={styles.formItem}> <div className={styles.formItem}>
<MyInput <MyInput
value={outputPath || ""} value={outputPath || ""}
InputProps={{
endAdornment: (
<img
onClick={() => { onClick={() => {
setSelectedBatchNodeId("");
setFileSelectType("path"); setFileSelectType("path");
handleOpenFileSelect(); handleOpenFileSelect();
}} }}
InputProps={{
endAdornment: (
<img
src={fileSelectIcon} src={fileSelectIcon}
alt="选择输出路径" alt="选择输出路径"
className={styles.fileSelectImg} className={styles.fileSelectImg}
...@@ -459,23 +464,15 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -459,23 +464,15 @@ const ConfigForm = (props: ConfigFormProps) => {
</div> </div>
</div> </div>
</div> </div>
</div>
{renderTasks.map((task, taskIndex) => { {renderTasks.map((task, taskIndex) => {
return ( return (
<div className={styles.taskBox} key={task.id + taskIndex}> <div className={styles.formItemBox} key={task.id + taskIndex}>
<div <div
className={classnames({ className={classnames({
[styles.backgroundTitle]: true, [styles.backgroundTitle]: true,
[styles.backgroundTitlePass]: true,
})} })}
> >
<img
className={classnames({
[styles.backgroundTitleTextIcon]: true,
[styles.backgroundTitleTextIconShow]: task.isCheck,
})}
src={jobSueIcon}
alt=""
/>
<span <span
id={`point${task.id}`} id={`point${task.id}`}
className={styles.backgroundTitleText} className={styles.backgroundTitleText}
...@@ -487,10 +484,25 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -487,10 +484,25 @@ const ConfigForm = (props: ConfigFormProps) => {
<img className={styles.taskDescIcon} src={tipsIcon} alt="" /> <img className={styles.taskDescIcon} src={tipsIcon} alt="" />
</MyTooltip> </MyTooltip>
)} )}
<img
className={classnames({
[styles.backgroundTitleTextIcon]: true,
[styles.backgroundTitleTextIconShow]: task.isCheck,
})}
src={jobSueIcon}
alt=""
/>
</div> </div>
<div className={styles.taskConfigBox}> <div className={styles.taskConfigBox}>
{randerParameters(task.parameters, task.id, task.id)} {randerParameters(task.parameters, task.id, task.id)}
{task.flows.map((flow) => { {task.flows.map((flow) => {
if (
flow.parameters.filter(
(parameter) => parameter.hidden === false
).length === 0
) {
return null;
}
return ( return (
<div className={styles.flowConfigBox} key={flow.id}> <div className={styles.flowConfigBox} key={flow.id}>
<div className={styles.flowTitle}> <div className={styles.flowTitle}>
......
...@@ -30,13 +30,14 @@ ...@@ -30,13 +30,14 @@
line-height: 22px; line-height: 22px;
font-size: 14px; font-size: 14px;
color: rgba(30, 38, 51, 1); color: rgba(30, 38, 51, 1);
font-weight: 600; font-weight: 700;
padding-right: 20px; padding-right: 20px;
border-right: 1px solid rgba(235, 237, 240, 1); border-right: 1px solid rgba(209, 214, 222, 1);
} }
.swHeaderLable { .swHeaderLable {
color: rgba(138, 144, 153, 1); color: rgba(138, 144, 153, 1);
font-size: 12px; font-size: 12px;
line-height: 22px;
} }
.swHeaderValue { .swHeaderValue {
color: rgba(30, 38, 51, 1); color: rgba(30, 38, 51, 1);
......
...@@ -240,8 +240,8 @@ const ProjectSubmitWork = observer(() => { ...@@ -240,8 +240,8 @@ const ProjectSubmitWork = observer(() => {
<ArrowBackIosNewIcon <ArrowBackIosNewIcon
sx={{ sx={{
color: "rgba(194, 198, 204, 1)", color: "rgba(194, 198, 204, 1)",
width: "12px", width: "14px",
height: "12px", height: "14px",
}} }}
/> />
</IconButton> </IconButton>
......
...@@ -21,6 +21,11 @@ const CurrentProject = observer(() => { ...@@ -21,6 +21,11 @@ const CurrentProject = observer(() => {
document.addEventListener("click", (e) => { document.addEventListener("click", (e) => {
setProjectListOpen(false); setProjectListOpen(false);
}); });
return () => {
document.removeEventListener("click", (e) => {
setProjectListOpen(false);
});
};
}, []); }, []);
const handleShowProjectList = (event: React.MouseEvent<HTMLElement>) => { const handleShowProjectList = (event: React.MouseEvent<HTMLElement>) => {
...@@ -85,6 +90,7 @@ const CurrentProject = observer(() => { ...@@ -85,6 +90,7 @@ const CurrentProject = observer(() => {
<Fade {...TransitionProps} timeout={350}> <Fade {...TransitionProps} timeout={350}>
<div> <div>
<ProjectListPopper <ProjectListPopper
setProjectListOpen={setProjectListOpen}
handleClickOpen={openAddProject} handleClickOpen={openAddProject}
handleChangeCurrentProject={handleChangeCurrentProject} handleChangeCurrentProject={handleChangeCurrentProject}
/> />
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com * @Author: 吴永生 15770852798@163.com
* @Date: 2022-08-02 11:43:28 * @Date: 2022-08-02 11:43:28
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-02 19:36:32 * @LastEditTime: 2022-08-11 18:50:31
* @FilePath: /bkunyun/src/views/Project/components/ProjectListPopper/index.tsx * @FilePath: /bkunyun/src/views/Project/components/ProjectListPopper/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -19,7 +19,8 @@ import { toJS } from "mobx"; ...@@ -19,7 +19,8 @@ import { toJS } from "mobx";
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
const ProjectListPopper = observer((props: any) => { const ProjectListPopper = observer((props: any) => {
const { handleChangeCurrentProject, handleClickOpen } = props; const { handleChangeCurrentProject, handleClickOpen, setProjectListOpen } =
props;
const { currentProjectStore } = useStores(); const { currentProjectStore } = useStores();
const projectList = toJS(currentProjectStore.projectList); const projectList = toJS(currentProjectStore.projectList);
const currentProjectId = toJS(currentProjectStore.currentProjectInfo.id); const currentProjectId = toJS(currentProjectStore.currentProjectInfo.id);
...@@ -36,6 +37,7 @@ const ProjectListPopper = observer((props: any) => { ...@@ -36,6 +37,7 @@ const ProjectListPopper = observer((props: any) => {
}, [projectList, name]); }, [projectList, name]);
const handleProjectBox = (e: React.SyntheticEvent) => { const handleProjectBox = (e: React.SyntheticEvent) => {
setProjectListOpen(false);
e.nativeEvent.stopImmediatePropagation(); e.nativeEvent.stopImmediatePropagation();
}; };
......
...@@ -63,6 +63,7 @@ const OperatorItem = (props: IOperatorItemProps) => { ...@@ -63,6 +63,7 @@ const OperatorItem = (props: IOperatorItemProps) => {
item?.edges.map((every) => { item?.edges.map((every) => {
return { return {
...every, ...every,
id: `${every.id}_${count}`,
source: `${every.source}_${count}`, source: `${every.source}_${count}`,
target: `${every.target}_${count}`, target: `${every.target}_${count}`,
}; };
...@@ -75,7 +76,7 @@ const OperatorItem = (props: IOperatorItemProps) => { ...@@ -75,7 +76,7 @@ const OperatorItem = (props: IOperatorItemProps) => {
x: item.type === "BATCH" ? x : item.position?.x, x: item.type === "BATCH" ? x : item.position?.x,
y: item.type === "BATCH" ? y : item.position?.y, y: item.type === "BATCH" ? y : item.position?.y,
}, },
edges: newEdges?.length ? newEdges : item?.edges, edges: newEdges?.length ? newEdges : [],
}; };
}); });
return newVal; return newVal;
......
...@@ -28,219 +28,8 @@ type IParameterSettingProps = { ...@@ -28,219 +28,8 @@ type IParameterSettingProps = {
taskId: string; taskId: string;
setTemplateConfigInfo: any; setTemplateConfigInfo: any;
}; };
// 页面调试数据 暂不删除
// const templateConfigInfoMock = [
// {
// id: "id",
// title: "title",
// description:
// "阿斯蒂芬吉林集安拉开圣诞节疯狂拉升阶段阿斯蒂芬吉林集安拉开圣诞节疯狂拉升阶段阿斯蒂芬吉林集安拉开圣诞节疯狂拉升阶段阿斯蒂芬吉林集安拉开圣诞节疯狂拉升阶段阿斯蒂芬吉林集安拉开圣诞节疯狂拉升阶段阿斯蒂芬吉林集安拉开圣诞节疯狂拉升阶段",
// version: "version",
// position: {
// x: 10,
// y: 100,
// },
// tags: ["string[]"],
// type: "BATCH",
// parentNode: "string",
// parameters: [
// {
// hidden: true,
// id: "1",
// name: "smi_in",
// required: true,
// defaultValue: "",
// domType: "input",
// classType: "STRING",
// classTypeName: "String",
// value: "",
// description: "123",
// language: "",
// languageVersion: "",
// tags: [],
// source: "string",
// productId: "",
// tasks: [],
// validators: [
// {
// message: "请选择smi文件作为输入",
// regex: "^.[s][m][i]$",
// },
// ],
// choices: [],
// parameterGroup: "in",
// },
// {
// hidden: true,
// id: "2",
// name: "out",
// required: true,
// defaultValue: "",
// domType: "select",
// classType: "STRING",
// classTypeName: "String",
// value: "",
// description: "",
// language: "",
// languageVersion: "",
// tags: [],
// source: "string",
// productId: "",
// tasks: [],
// validators: [
// {
// message: "请选择smi文件作为输入",
// regex: "^.[s][m][i]$",
// },
// ],
// choices: [],
// parameterGroup: "out",
// },
// {
// hidden: true,
// id: "3",
// name: "basis999",
// required: true,
// defaultValue: "",
// domType: "select",
// classType: "STRING",
// classTypeName: "String",
// value: "",
// description: "789",
// language: "",
// languageVersion: "",
// tags: [],
// source: "string",
// productId: "",
// tasks: [],
// validators: [
// {
// message: "请选择smi文件作为输入",
// regex: "^.[s][m][i]$",
// },
// ],
// choices: [],
// parameterGroup: "basis",
// },
// {
// hidden: true,
// id: "4",
// name: "basis",
// required: true,
// defaultValue: "",
// domType: "select",
// classType: "STRING",
// classTypeName: "String",
// value: "",
// description: "",
// language: "",
// languageVersion: "",
// tags: [],
// source: "string",
// productId: "",
// tasks: [],
// validators: [
// {
// message: "请选择smi文件作为输入",
// regex: "^.[s][m][i]$",
// },
// ],
// choices: [],
// parameterGroup: "basis",
// },
// {
// hidden: true,
// id: "5",
// name: "senior",
// required: true,
// defaultValue: "",
// domType: "checkbox",
// classType: "STRING",
// classTypeName: "String",
// value: "",
// description: "",
// language: "",
// languageVersion: "",
// tags: [],
// source: "string",
// productId: "",
// tasks: [],
// validators: [
// {
// message: "请选择smi文件作为输入",
// regex: "^.[s][m][i]$",
// },
// ],
// choices: [
// {
// label: "123",
// value: "123",
// },
// {
// label: "456",
// value: "456",
// },
// {
// label: "789",
// value: "789",
// },
// ],
// parameterGroup: "senior",
// },
// {
// hidden: true,
// id: "6",
// name: "hardware",
// required: true,
// defaultValue: "",
// domType: "radio",
// classType: "STRING",
// classTypeName: "String",
// value: "",
// description: "",
// language: "",
// languageVersion: "",
// tags: [],
// source: "string",
// productId: "",
// tasks: [],
// validators: [
// {
// message: "请选择smi文件作为输入",
// regex: "^.[s][m][i]$",
// },
// ],
// choices: [
// {
// label: "123",
// value: "123",
// },
// {
// label: "456",
// value: "456",
// },
// {
// label: "789",
// value: "789",
// },
// ],
// parameterGroup: "hardware",
// },
// ],
// edges: [],
// isCheck: false,
// executionStatus: "Pending",
// },
// ];
// const taskId = "id";
const ParameterSetting = (props: IParameterSettingProps) => { const ParameterSetting = (props: IParameterSettingProps) => {
const { templateConfigInfo, setTemplateConfigInfo, taskId } = props; // 算子大数组 const { templateConfigInfo, setTemplateConfigInfo, taskId } = props; // 算子大数组
// 页面调试数据 暂不删除
// const [templateConfigInfo, setTemplateConfigInfo] = useState<ITask[]>(
// templateConfigInfoMock as ITask[]
// );
const [descHeight, setDescHeight] = useState(0); // 算子描述的高度 用来完成描述展开收起功能 const [descHeight, setDescHeight] = useState(0); // 算子描述的高度 用来完成描述展开收起功能
const [isShowAllDese, setIsShowAllDese] = useState(false); // 是否展示全部描述 const [isShowAllDese, setIsShowAllDese] = useState(false); // 是否展示全部描述
const [fileSelectOpen, setFileSelectOpen] = useState(false); // 选择输出路径的弹窗显示控制 const [fileSelectOpen, setFileSelectOpen] = useState(false); // 选择输出路径的弹窗显示控制
...@@ -398,9 +187,6 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -398,9 +187,6 @@ const ParameterSetting = (props: IParameterSettingProps) => {
{(parameter.domType || "").toLowerCase() === "file" && ( {(parameter.domType || "").toLowerCase() === "file" && (
<MyInput <MyInput
value={parameter.defaultValue || ""} value={parameter.defaultValue || ""}
InputProps={{
endAdornment: (
<img
onClick={() => { onClick={() => {
if (parameter.parameterGroup === "out") { if (parameter.parameterGroup === "out") {
return; return;
...@@ -408,6 +194,9 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -408,6 +194,9 @@ const ParameterSetting = (props: IParameterSettingProps) => {
setFileSelectType("file"); setFileSelectType("file");
handleOpenFileSelect(parameter.name); handleOpenFileSelect(parameter.name);
}} }}
InputProps={{
endAdornment: (
<img
src={fileSelectIcon} src={fileSelectIcon}
alt="" alt=""
className={styles.fileSelectImg} className={styles.fileSelectImg}
...@@ -423,9 +212,6 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -423,9 +212,6 @@ const ParameterSetting = (props: IParameterSettingProps) => {
{(parameter.domType || "").toLowerCase() === "path" && ( {(parameter.domType || "").toLowerCase() === "path" && (
<MyInput <MyInput
value={parameter.defaultValue || ""} value={parameter.defaultValue || ""}
InputProps={{
endAdornment: (
<img
onClick={() => { onClick={() => {
if (parameter.parameterGroup === "out") { if (parameter.parameterGroup === "out") {
return; return;
...@@ -433,6 +219,9 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -433,6 +219,9 @@ const ParameterSetting = (props: IParameterSettingProps) => {
setFileSelectType("path"); setFileSelectType("path");
handleOpenFileSelect(parameter.name); handleOpenFileSelect(parameter.name);
}} }}
InputProps={{
endAdornment: (
<img
src={fileSelectIcon} src={fileSelectIcon}
alt="" alt=""
className={styles.fileSelectImg} className={styles.fileSelectImg}
...@@ -448,9 +237,6 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -448,9 +237,6 @@ const ParameterSetting = (props: IParameterSettingProps) => {
{(parameter.domType || "").toLowerCase() === "dataset" && ( {(parameter.domType || "").toLowerCase() === "dataset" && (
<MyInput <MyInput
value={parameter.defaultValue || ""} value={parameter.defaultValue || ""}
InputProps={{
endAdornment: (
<img
onClick={() => { onClick={() => {
if (parameter.parameterGroup === "out") { if (parameter.parameterGroup === "out") {
return; return;
...@@ -458,6 +244,9 @@ const ParameterSetting = (props: IParameterSettingProps) => { ...@@ -458,6 +244,9 @@ const ParameterSetting = (props: IParameterSettingProps) => {
setFileSelectType("dataset"); setFileSelectType("dataset");
handleOpenFileSelect(parameter.name); handleOpenFileSelect(parameter.name);
}} }}
InputProps={{
endAdornment: (
<img
src={fileSelectIcon} src={fileSelectIcon}
alt="" alt=""
className={styles.fileSelectImg} className={styles.fileSelectImg}
......
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