Commit 8c034058 authored by chenshouchao's avatar chenshouchao

Merge branch 'feat-20220718' into 'release'

Feat 20220718

See merge request !35
parents 0a94454b 55e5598b
.noDataBox {
background-color: #fff;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: relative;
}
.noDataText {
margin-top: 8px;
font-size: 14px;
line-height: 22px;
color: #8a9099;
}
import noFile from "@/assets/project/noFile.svg";
import style from "./index.module.css";
type INoDataProps = {
text?: string;
noDataBoxStyle?: any;
};
const NoData = (props: INoDataProps) => {
return (
<div className={style.noDataBox} style={{ ...props.noDataBoxStyle }}>
<img className={style.noDataImg} src={noFile} alt="" />
<span className={style.noDataText}>
{props.text ? props.text : "暂无数据"}
</span>
</div>
);
};
export default NoData;
// 局部loading组件 挂载在目标块下,目标块最少要添加一个position: relative; 或者absolute
import CircularProgress from "@mui/material/CircularProgress";
type IMyCircularProgressProps = {
loading: boolean;
minHeight?: string;
maxHeight?: string;
zIndex?: number;
};
const MyCircularProgress = (props: IMyCircularProgressProps) => {
const {
loading,
minHeight = "none",
maxHeight = "100vh",
zIndex = "100",
} = props;
if (loading) {
return (
<div
style={{
minHeight: minHeight,
width: "100%",
height: "100%",
position: "absolute",
top: 0,
zIndex: zIndex,
}}
>
<div
style={{
width: "100%",
height: "100%",
position: "absolute",
top: 0,
opacity: 0.6,
background: "#fff",
}}
></div>
<div
style={{
width: "100%",
height: "100%",
maxHeight: maxHeight,
display: "flex",
justifyContent: "center",
alignItems: "center",
}}
>
<CircularProgress></CircularProgress>
</div>
</div>
);
} else {
return null;
}
};
export default MyCircularProgress;
...@@ -17,6 +17,7 @@ import { useStores } from "@/store"; ...@@ -17,6 +17,7 @@ import { useStores } from "@/store";
import { toJS } from "mobx"; import { toJS } from "mobx";
import classNames from "classnames"; import classNames from "classnames";
import Save from "./save"; import Save from "./save";
import NoData from "@/components/BusinessComponents/NoData";
import Download from "./download"; import Download from "./download";
import style from "./index.module.css"; import style from "./index.module.css";
...@@ -62,7 +63,9 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -62,7 +63,9 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
setSort(e); setSort(e);
}; };
const handleKeywordChange = (e: any) => { const handleKeywordChange = (e: any) => {
if (e.target.value.length <= 30) {
setKeyword(e.target.value); setKeyword(e.target.value);
}
}; };
const pageChange = (value: number) => { const pageChange = (value: number) => {
...@@ -248,6 +251,8 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -248,6 +251,8 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
</div> </div>
</div> </div>
<div className={style.table}> <div className={style.table}>
{list.length !== 0 && (
<>
<div className={style.list}> <div className={style.list}>
{list.map((item, index) => { {list.map((item, index) => {
return ( return (
...@@ -269,7 +274,10 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -269,7 +274,10 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
</div> </div>
)} )}
<div className={style.datasetLiBottom}> <div className={style.datasetLiBottom}>
<div className={style.datasetLiTitle} title={item.smiles}> <div
className={style.datasetLiTitle}
title={item.smiles}
>
{item.smiles} {item.smiles}
</div> </div>
{showData.length !== 0 && ( {showData.length !== 0 && (
...@@ -285,7 +293,9 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -285,7 +293,9 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
<span className={style.datasetLiDataLiKey}> <span className={style.datasetLiDataLiKey}>
{key} {key}
</span> </span>
<span className={style.datasetLiDataLiValue}> <span
className={style.datasetLiDataLiValue}
>
{item.meta[key]} {item.meta[key]}
</span> </span>
</div> </div>
...@@ -341,9 +351,17 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -341,9 +351,17 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
); );
})} })}
</div> </div>
<div className={style.pagination}> <div className={style.pagination}>
<MyPagination page={page} pageChange={pageChange} count={count} /> <MyPagination
page={page}
pageChange={pageChange}
count={count}
/>
</div> </div>
</>
)}
{list.length === 0 && <NoData></NoData>}
</div> </div>
</div> </div>
<div className={style.foot}> <div className={style.foot}>
......
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
font-weight: 600; font-weight: 600;
margin-bottom: 24px; margin-bottom: 24px;
} }
.projectDataHeader {
position: relative;
}
.projectDataButtonAndSearch { .projectDataButtonAndSearch {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
......
...@@ -2,7 +2,6 @@ import React, { useState, useCallback, useEffect, useMemo } from "react"; ...@@ -2,7 +2,6 @@ import React, { useState, useCallback, useEffect, useMemo } from "react";
import style from "./index.module.css"; import style from "./index.module.css";
import classnames from "classnames"; import classnames from "classnames";
import { IconButton } from "@mui/material"; import { IconButton } from "@mui/material";
import SearchIcon from "@mui/icons-material/Search";
import RefreshIcon from "@mui/icons-material/Refresh"; import RefreshIcon from "@mui/icons-material/Refresh";
import MyTable from "@/components/mui/MyTable"; import MyTable from "@/components/mui/MyTable";
import dataSetIcon from "@/assets/project/dataSetIcon.svg"; import dataSetIcon from "@/assets/project/dataSetIcon.svg";
...@@ -26,7 +25,6 @@ import { useLocation } from "react-router-dom"; ...@@ -26,7 +25,6 @@ import { useLocation } from "react-router-dom";
import RadioGroupOfButtonStyle from "@/components/CommonComponents/RadioGroupOfButtonStyle"; import RadioGroupOfButtonStyle from "@/components/CommonComponents/RadioGroupOfButtonStyle";
import SeeDataset from "./SeeDataset"; import SeeDataset from "./SeeDataset";
import { getDataFind, getDataFileSearch } from "@/api/project_api"; import { getDataFind, getDataFileSearch } from "@/api/project_api";
import MyInput from "@/components/mui/MyInput";
import MyButton from "@/components/mui/MyButton"; import MyButton from "@/components/mui/MyButton";
import SearchInput from "@/components/BusinessComponents/SearchInput"; import SearchInput from "@/components/BusinessComponents/SearchInput";
......
...@@ -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-07-26 20:39:32 * @LastEditTime: 2022-07-28 18:32:03
* @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
*/ */
...@@ -318,7 +318,8 @@ const BaseInfo = observer(() => { ...@@ -318,7 +318,8 @@ const BaseInfo = observer(() => {
> >
项目名称 项目名称
</div> </div>
<TextField
<MyInput
required required
error={nameCheck.error} error={nameCheck.error}
id="name" id="name"
...@@ -326,21 +327,8 @@ const BaseInfo = observer(() => { ...@@ -326,21 +327,8 @@ const BaseInfo = observer(() => {
value={projectInfo.name} value={projectInfo.name}
onChange={nameChange} onChange={nameChange}
helperText={nameCheck.help} helperText={nameCheck.help}
size="small" style={{ width: "560px" }}
sx={{
width: "560px",
"& .MuiOutlinedInput-root": {
height: "36px",
},
}}
/> />
{/* <input
value={projectInfo.name}
className={style.projectInfoListLiValue}
onChange={nameChange}
maxLength={30}
placeholder="请输入项目名称"
></input> */}
</div> </div>
<div className={style.projectInfoListLi}> <div className={style.projectInfoListLi}>
<div className={style.projectInfoListLiLabel}>项目描述</div> <div className={style.projectInfoListLiLabel}>项目描述</div>
...@@ -354,6 +342,13 @@ const BaseInfo = observer(() => { ...@@ -354,6 +342,13 @@ const BaseInfo = observer(() => {
placeholder="项目描述限制100字以内" placeholder="项目描述限制100字以内"
maxLength={100} maxLength={100}
></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>
...@@ -375,42 +370,26 @@ const BaseInfo = observer(() => { ...@@ -375,42 +370,26 @@ const BaseInfo = observer(() => {
</div> </div>
<div className={style.projectInfoListLi}> <div className={style.projectInfoListLi}>
<div className={style.projectInfoListLiLabel}>创建人</div> <div className={style.projectInfoListLiLabel}>创建人</div>
<input <MyInput
value={projectInfo.owner} value={projectInfo.owner}
disabled disabled
className={classnames({ style={{ width: "560px" }}
[style.projectInfoListLiValue]: true, />
[style.disable]: true,
})}
></input>
</div> </div>
<div className={style.projectInfoListLi}> <div className={style.projectInfoListLi}>
<div className={style.projectInfoListLiLabel}>项目预算</div> <div className={style.projectInfoListLiLabel}>项目预算</div>
{/* <MyInput <MyInput
sx={{
width: "560px",
'& .MuiOutlinedInput-root': {
height: '36px'
}
}}
/> */}
<TextField
required required
error={budgetCheck.error} error={budgetCheck.error}
disabled={currentUserName !== projectInfo.tenantUser} disabled={currentUserName !== projectInfo.tenantUser}
id="projectBudget" // id="projectBudget"
variant="outlined" variant="outlined"
value={projectInfo.projectBudget} value={projectInfo.projectBudget}
onChange={budgetChange} onChange={budgetChange}
onBlur={budgetBlur} onBlur={budgetBlur}
helperText={budgetCheck.help} helperText={budgetCheck.help}
size="small" // size="small"
sx={{ style={{ width: "560px" }}
width: "560px",
"& .MuiOutlinedInput-root": {
height: "36px",
},
}}
InputProps={{ InputProps={{
startAdornment: ( startAdornment: (
<InputAdornment position="start">¥</InputAdornment> <InputAdornment position="start">¥</InputAdornment>
...@@ -420,14 +399,11 @@ const BaseInfo = observer(() => { ...@@ -420,14 +399,11 @@ const BaseInfo = observer(() => {
</div> </div>
<div className={style.projectInfoListLi}> <div className={style.projectInfoListLi}>
<div className={style.projectInfoListLiLabel}>扣费账号</div> <div className={style.projectInfoListLiLabel}>扣费账号</div>
<input <MyInput
value={projectInfo.tenantUser} value={projectInfo.tenantUser}
disabled disabled
className={classnames({ style={{ width: "560px" }}
[style.projectInfoListLiValue]: true, />
[style.disable]: true,
})}
></input>
</div> </div>
<div className={style.projectInfoListLi}> <div className={style.projectInfoListLi}>
<LoadingButton <LoadingButton
......
...@@ -2,23 +2,24 @@ ...@@ -2,23 +2,24 @@
* @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-07-26 11:13:10 * @LastEditTime: 2022-07-28 18:10:42
* @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
*/ */
import { toJS } from "mobx"; import { toJS } from "mobx";
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
import _ from "lodash"; import _ from "lodash";
import Dialog from "@/components/mui/MyDialog";
import { memo, useCallback, useEffect, useMemo, useState } from "react"; import { memo, useCallback, useEffect, useMemo, useState } from "react";
import { Box, OutlinedInput } from "@mui/material"; import { Box, OutlinedInput } from "@mui/material";
import SearchIcon from "@mui/icons-material/Search";
import Dialog from "@/components/mui/MyDialog";
import { IResponse, useHttp } from "@/api/http"; import { IResponse, useHttp } from "@/api/http";
import { useStores } from "@/store"; import { useStores } from "@/store";
import { useMessage } from "@/components/MySnackbar"; import { useMessage } from "@/components/MySnackbar";
import MySelect, { IOption } from "@/components/mui/MySelect"; import MySelect, { IOption } from "@/components/mui/MySelect";
import MyTable from "@/components/mui/MyTable"; import MyTable from "@/components/mui/MyTable";
import SearchInput from "@/components/BusinessComponents/SearchInput";
interface IProps { interface IProps {
setAddMemberDialog: (val: boolean) => void; setAddMemberDialog: (val: boolean) => void;
addMemberDialog: boolean; addMemberDialog: boolean;
...@@ -158,19 +159,15 @@ const AddMember = observer((props: IProps) => { ...@@ -158,19 +159,15 @@ const AddMember = observer((props: IProps) => {
title="添加成员" title="添加成员"
> >
<Box> <Box>
<Box sx={{ mb: 2 }}> <SearchInput
<OutlinedInput onKeyUp={(e: any) => {
onChange={(e: any) => { if (e.keyCode === 13) {
_.debounce(() => {
setProjectMember(e.target.value); setProjectMember(e.target.value);
}, 200)(); }
}} }}
placeholder="搜索项目成员" placeholder="搜索项目成员"
size="small" sx={{ mb: 2 }}
sx={{ width: "100%", height: 32 }}
endAdornment={<SearchIcon style={{ color: "#8A9099" }} />}
/> />
</Box>
<div style={{ overflowY: "scroll", maxHeight: 400 }}> <div style={{ overflowY: "scroll", maxHeight: 400 }}>
<MyTable <MyTable
checkboxData={(val: string[]) => setCheckData(val)} checkboxData={(val: string[]) => setCheckData(val)}
......
/* /*
* @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: 吴永生#A02208 yongsheng.wu@wholion.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-07-22 16:20:26 * @LastEditTime: 2022-07-28 19:02:19
* @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
*/ */
...@@ -11,29 +11,27 @@ import _ from "lodash"; ...@@ -11,29 +11,27 @@ import _ from "lodash";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import { Box, Typography } from "@mui/material"; import { Box, Typography } from "@mui/material";
import OutlinedInput from "@mui/material/OutlinedInput"; import OutlinedInput from "@mui/material/OutlinedInput";
import SearchIcon from "@mui/icons-material/Search"; import { TablePagination } from "@mui/material";
import { TablePagination } from '@mui/material';
import TextField from '@mui/material/TextField';
import MenuItem from '@mui/material/MenuItem';
import SimpleDialog from "./components/simpleDialog" import MySelect from "@/components/mui/MySelect";
import SimpleDialog from "./components/simpleDialog";
import { useStores } from "@/store"; import { useStores } from "@/store";
import useMyRequest from "@/hooks/useMyRequest"; import useMyRequest from "@/hooks/useMyRequest";
import ActionsComponent from "../../../../components/Material.Ui/Table/ActionsComponent" import ActionsComponent from "../../../../components/Material.Ui/Table/ActionsComponent";
import runTime from '../../../../assets/project/runTime.svg' import runTime from "../../../../assets/project/runTime.svg";
import jobCost from '../../../../assets/project/jobCost.svg' import jobCost from "../../../../assets/project/jobCost.svg";
import jobSue from '../../../../assets/project/jobSue.svg' import jobSue from "../../../../assets/project/jobSue.svg";
import jobFail from '../../../../assets/project/jobFail.svg' import jobFail from "../../../../assets/project/jobFail.svg";
import jobRun from '../../../../assets/project/jobRun.svg' import jobRun from "../../../../assets/project/jobRun.svg";
import jobCadence from '../../../../assets/project/jobCadence.svg' import jobCadence from "../../../../assets/project/jobCadence.svg";
import jobStop from '../../../../assets/project/jobStop.svg' import jobStop from "../../../../assets/project/jobStop.svg";
import jobDel from '../../../../assets/project/jobDel.svg' import jobDel from "../../../../assets/project/jobDel.svg";
import noData from '../../../../assets/project/noTemplate.svg' import noData from "../../../../assets/project/noTemplate.svg";
import onload from '../../../../assets/project/onload.svg' import onload from "../../../../assets/project/onload.svg";
import { import {
getWorkflowJobList, getWorkflowJobList,
deleteWorkflowJob, deleteWorkflowJob,
cancelWorkflowJob cancelWorkflowJob,
} from "@/api/workbench_api"; } from "@/api/workbench_api";
import { toJS } from "mobx"; import { toJS } from "mobx";
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
...@@ -43,52 +41,51 @@ import SearchInput from "@/components/BusinessComponents/SearchInput"; ...@@ -43,52 +41,51 @@ import SearchInput from "@/components/BusinessComponents/SearchInput";
import styles from "./index.module.css"; import styles from "./index.module.css";
const currencies = [ const currencies = [
{ {
value: 'ALL', value: "ALL",
label: '全部', label: "全部",
}, },
{ {
value: 'RUNNING', value: "RUNNING",
label: '正在运行', label: "正在运行",
}, },
{ {
value: 'SUCCEEDED', value: "SUCCEEDED",
label: '运行成功', label: "运行成功",
}, },
{ {
value: 'FAILED', value: "FAILED",
label: '运行失败', label: "运行失败",
}, },
{ {
value: 'ABORTED', value: "ABORTED",
label: '运行终止', label: "运行终止",
}, },
]; ];
let timer: string | number | NodeJS.Timeout | null | undefined = null let timer: string | number | NodeJS.Timeout | null | undefined = null;
const ProjectMembers = observer(() => { const ProjectMembers = observer(() => {
const { currentProjectStore } = useStores(); const { currentProjectStore } = useStores();
const projectId = toJS(currentProjectStore.currentProjectInfo.id); const projectId = toJS(currentProjectStore.currentProjectInfo.id);
const isPass = usePass(); const isPass = usePass();
const [jobName, setJobName] = useState('') const [jobName, setJobName] = useState("");
const [jobList, setJobList] = useState([]) const [jobList, setJobList] = useState([]);
const [currency, setCurrency] = useState('ALL'); const [currency, setCurrency] = useState("ALL");
const [page, setPage] = useState(0) const [page, setPage] = useState(0);
const [size, setSize] = useState(10) const [size, setSize] = useState(10);
const [rowsPerPage, setRowsPerPage] = useState(10) const [rowsPerPage, setRowsPerPage] = useState(10);
const [count, setCount] = useState(0) const [count, setCount] = useState(0);
/** 简单弹窗 */ /** 简单弹窗 */
const [jobData, setJobData] = useState(''); const [jobData, setJobData] = useState("");
const [openDialog, setOpenDialog] = useState(false); const [openDialog, setOpenDialog] = useState(false);
const [dialogType, setDialogType] = useState('del'); const [dialogType, setDialogType] = useState("del");
// 获取作业列表 // 获取作业列表
const { run: getWorkflowJobInfo } = useMyRequest(getWorkflowJobList, { const { run: getWorkflowJobInfo } = useMyRequest(getWorkflowJobList, {
onSuccess: (result: any) => { onSuccess: (result: any) => {
setJobList(result.data.content); setJobList(result.data.content);
setCount(result.data.totalElements) setCount(result.data.totalElements);
timer && clearTimeout(timer as number) timer && clearTimeout(timer as number);
timer = null; timer = null;
timer = setTimeout(() => { timer = setTimeout(() => {
getWorkflowJobInfo({ getWorkflowJobInfo({
...@@ -96,7 +93,7 @@ const ProjectMembers = observer(() => { ...@@ -96,7 +93,7 @@ const ProjectMembers = observer(() => {
page: page, page: page,
size: size, size: size,
name: jobName, name: jobName,
state: currency === 'ALL' ? "" : currency state: currency === "ALL" ? "" : currency,
}); });
}, 60000); }, 60000);
}, },
...@@ -104,22 +101,22 @@ const ProjectMembers = observer(() => { ...@@ -104,22 +101,22 @@ const ProjectMembers = observer(() => {
useEffect(() => { useEffect(() => {
return () => { return () => {
clearTimeout(timer as number) clearTimeout(timer as number);
} };
}, []) }, []);
const navigate = useNavigate() const navigate = useNavigate();
// 删除作业 // 删除作业
const { run: delWorkflowJob } = useMyRequest(deleteWorkflowJob, { const { run: delWorkflowJob } = useMyRequest(deleteWorkflowJob, {
onSuccess: (result: any) => { onSuccess: (result: any) => {
setOpenDialog(false) setOpenDialog(false);
getWorkflowJobInfo({ getWorkflowJobInfo({
projectId: currentProjectStore.currentProjectInfo.id as string, projectId: currentProjectStore.currentProjectInfo.id as string,
page: page, page: page,
size: size, size: size,
name: jobName, name: jobName,
state: currency === 'ALL' ? "" : currency state: currency === "ALL" ? "" : currency,
}); });
}, },
}); });
...@@ -127,23 +124,19 @@ const ProjectMembers = observer(() => { ...@@ -127,23 +124,19 @@ const ProjectMembers = observer(() => {
// 删除作业 // 删除作业
const { run: cancelWorkflowJobInfo } = useMyRequest(cancelWorkflowJob, { const { run: cancelWorkflowJobInfo } = useMyRequest(cancelWorkflowJob, {
onSuccess: (result: any) => { onSuccess: (result: any) => {
setOpenDialog(false) setOpenDialog(false);
getWorkflowJobInfo({ getWorkflowJobInfo({
projectId: currentProjectStore.currentProjectInfo.id as string, projectId: currentProjectStore.currentProjectInfo.id as string,
page: page, page: page,
size: size, size: size,
name: jobName, name: jobName,
state: currency === 'ALL' ? "" : currency state: currency === "ALL" ? "" : currency,
}); });
}, },
}); });
const searchChange = (data: any) => { const handleChange = (val: string) => {
setJobName(data.length > 30 ? data.slice(0, 30) : data); setCurrency(val);
}
const handleChange = (event: any) => {
setCurrency(event.target.value);
}; };
/** 关闭弹窗 */ /** 关闭弹窗 */
...@@ -155,12 +148,12 @@ const ProjectMembers = observer(() => { ...@@ -155,12 +148,12 @@ const ProjectMembers = observer(() => {
const onConfirm = () => { const onConfirm = () => {
if (dialogType === "del") { if (dialogType === "del") {
delWorkflowJob({ delWorkflowJob({
id: jobData id: jobData,
}) });
} else { } else {
cancelWorkflowJobInfo({ cancelWorkflowJobInfo({
jobid: jobData jobid: jobData,
}) });
} }
}; };
...@@ -170,32 +163,32 @@ const ProjectMembers = observer(() => { ...@@ -170,32 +163,32 @@ const ProjectMembers = observer(() => {
page: page, page: page,
size: size, size: size,
name: jobName, name: jobName,
state: currency === 'ALL' ? "" : currency state: currency === "ALL" ? "" : currency,
}); });
}, [projectId, getWorkflowJobInfo]); }, [projectId, getWorkflowJobInfo]);
const handleChangePage = (event: any, newPage: any) => { const handleChangePage = (event: any, newPage: any) => {
setPage(newPage) setPage(newPage);
getWorkflowJobInfo({ getWorkflowJobInfo({
projectId: currentProjectStore.currentProjectInfo.id as string, projectId: currentProjectStore.currentProjectInfo.id as string,
page: newPage, page: newPage,
size: size, size: size,
name: jobName, name: jobName,
state: currency === 'ALL' ? "" : currency state: currency === "ALL" ? "" : currency,
}); });
} };
const handleChangeRowsPerPage = (event: any) => { const handleChangeRowsPerPage = (event: any) => {
setRowsPerPage(event.target.value) setRowsPerPage(event.target.value);
setSize(event.target.value) setSize(event.target.value);
getWorkflowJobInfo({ getWorkflowJobInfo({
projectId: currentProjectStore.currentProjectInfo.id as string, projectId: currentProjectStore.currentProjectInfo.id as string,
page: page, page: page,
size: event.target.value, size: event.target.value,
name: jobName, name: jobName,
state: currency === 'ALL' ? "" : currency state: currency === "ALL" ? "" : currency,
}); });
} };
useEffect(() => { useEffect(() => {
setTimeout(() => { setTimeout(() => {
...@@ -204,40 +197,40 @@ const ProjectMembers = observer(() => { ...@@ -204,40 +197,40 @@ const ProjectMembers = observer(() => {
page: page, page: page,
size: size, size: size,
name: jobName, name: jobName,
state: currency === 'ALL' ? "" : currency state: currency === "ALL" ? "" : currency,
}); });
}, 300) }, 300);
}, [jobName, currency]); }, [jobName, currency]);
const renderStatusIcon = (data: string) => { const renderStatusIcon = (data: string) => {
switch (data) { switch (data) {
case "RUNNING": case "RUNNING":
return jobRun return jobRun;
case "ABORTED": case "ABORTED":
return jobCadence return jobCadence;
case "FAILED": case "FAILED":
return jobFail return jobFail;
case "SUCCEEDED": case "SUCCEEDED":
return jobSue return jobSue;
default: default:
return jobCadence return jobCadence;
}
} }
};
const renderStatusText = (data: string) => { const renderStatusText = (data: string) => {
switch (data) { switch (data) {
case "RUNNING": case "RUNNING":
return '正在运行' return "正在运行";
case "ABORTED": case "ABORTED":
return '运行终止' return "运行终止";
case "FAILED": case "FAILED":
return '运行失败' return "运行失败";
case "SUCCEEDED": case "SUCCEEDED":
return '运行成功' return "运行成功";
default: default:
return '未知' return "未知";
}
} }
};
/** 渲染字体颜色 */ /** 渲染字体颜色 */
const renderTextColor = (data: any) => { const renderTextColor = (data: any) => {
...@@ -278,7 +271,7 @@ const ProjectMembers = observer(() => { ...@@ -278,7 +271,7 @@ const ProjectMembers = observer(() => {
state: { taskId: id }, state: { taskId: id },
}); });
}, },
[navigate], [navigate]
); );
// 回车搜索 // 回车搜索
...@@ -286,19 +279,14 @@ const ProjectMembers = observer(() => { ...@@ -286,19 +279,14 @@ const ProjectMembers = observer(() => {
if (e.keyCode === 13) { if (e.keyCode === 13) {
setJobName(e.target.value); setJobName(e.target.value);
} }
} };
return ( return (
<Box className={styles.headerBox}> <Box className={styles.headerBox}>
<Box className={styles.tabHeader}> <Box className={styles.tabHeader}>
<Box sx={{ display: "flex" }}>
<Box sx={{ display: 'flex' }}> <SearchInput onKeyUp={handleKeyWordChangeKeyUp} sx={{ width: 340 }} />
<SearchInput {/* <Box className={styles.tabHeaderSelect}>
onKeyUp={handleKeyWordChangeKeyUp}
sx={{ width: 340 }}
/>
<Box className={styles.tabHeaderSelect}>
<TextField <TextField
select select
label="运行状态" label="运行状态"
...@@ -319,48 +307,86 @@ const ProjectMembers = observer(() => { ...@@ -319,48 +307,86 @@ const ProjectMembers = observer(() => {
}} }}
> >
{currencies.map((option) => ( {currencies.map((option) => (
<MenuItem key={option.value} value={option.value}>
{option.label} {option.label}
</MenuItem>
))} ))}
</TextField> </TextField>
</Box> */}
<Box className={styles.tabHeaderSelect}>
<MySelect
input={<OutlinedInput />}
value={currency}
onChange={handleChange}
options={currencies}
size="small"
sx={{
width: 180,
height: 32,
"& .MuiOutlinedInput-root": {
height: "32px",
color: "#1E2633",
fontSize: "14px",
},
"& .MuiInputLabel-root": {
color: "#8A9099",
fontSize: "14px",
},
}}
/>
</Box> </Box>
</Box> </Box>
<Box className={styles.tabUpdate} onClick={() => { <Box
className={styles.tabUpdate}
onClick={() => {
getWorkflowJobInfo({ getWorkflowJobInfo({
projectId: currentProjectStore.currentProjectInfo.id as string, projectId: currentProjectStore.currentProjectInfo.id as string,
page: page, page: page,
size: size, size: size,
name: jobName, name: jobName,
state: currency === 'ALL' ? "" : currency state: currency === "ALL" ? "" : currency,
}) });
}} > }}
>
<img alt="" src={onload} /> <img alt="" src={onload} />
</Box> </Box>
</Box> </Box>
<Box className={styles.body}> <Box className={styles.body}>
{ {jobList.length === 0 && (
jobList.length === 0 && <Box
<Box sx={{ sx={{
display: 'flex', alignItems: 'center', flexDirection: 'column', minHeight: 'calc(100vh - 376px)', display: "flex",
justifyContent: 'center' alignItems: "center",
}}> flexDirection: "column",
minHeight: "calc(100vh - 376px)",
justifyContent: "center",
}}
>
<img alt="" src={noData} /> <img alt="" src={noData} />
<Typography sx={{ fontSize: '12px', fontWeight: '400', color: '#8A9099' }}>暂无任务</Typography> <Typography
sx={{ fontSize: "12px", fontWeight: "400", color: "#8A9099" }}
>
暂无任务
</Typography>
</Box> </Box>
} )}
{ {jobList.length > 0 &&
jobList.length > 0 && jobList.map((item: any, key) => { jobList.map((item: any, key) => {
return ( return (
<Box className={styles.tabBox} onClick={() => rowClick(item.id)}> <Box className={styles.tabBox} onClick={() => rowClick(item.id)}>
<Box className={styles.tabBoxInfo}> <Box className={styles.tabBoxInfo}>
<div className={styles.tabBoxTitle}>{item.name}</div> <div className={styles.tabBoxTitle}>{item.name}</div>
<Box className={styles.tabBoxDescInfo}> <Box className={styles.tabBoxDescInfo}>
<div className={styles.tabBoxDesc} style={{ marginRight: "24px" }} >创建时间:{item.createTime}</div> <div
<div className={styles.tabBoxDesc}>创建人:{item.creator}</div> className={styles.tabBoxDesc}
style={{ marginRight: "24px" }}
>
创建时间:{item.createTime}
</div>
<div className={styles.tabBoxDesc}>
创建人:{item.creator}
</div>
</Box> </Box>
</Box> </Box>
<Box className={styles.tabBoxMiddle}> <Box className={styles.tabBoxMiddle}>
...@@ -373,76 +399,90 @@ const ProjectMembers = observer(() => { ...@@ -373,76 +399,90 @@ const ProjectMembers = observer(() => {
</Box> </Box>
<Box className={styles.tabBoxJobStatus}> <Box className={styles.tabBoxJobStatus}>
<img alt="" src={renderStatusIcon(item.state)} /> <img alt="" src={renderStatusIcon(item.state)} />
<div className={styles.tabBoxStatusText}>{renderStatusText(item.state)}</div> <div className={styles.tabBoxStatusText}>
<Box sx={{ width: '100%' }}> {renderStatusText(item.state)}
<MyProgress color={renderProgressColor(item.state)} value={(item.completeNum / item.totalNum) * 100} </div>
<Box sx={{ width: "100%" }}>
<MyProgress
color={renderProgressColor(item.state)}
value={(item.completeNum / item.totalNum) * 100}
sx={{ sx={{
marginRight: '16px', marginRight: "16px",
}} }}
/> />
</Box> </Box>
<div style={{ color: renderTextColor(item.state) }} className={styles.tabBoxStatusText}>{item.completeNum + "/" + item.totalNum}</div> <div
style={{ color: renderTextColor(item.state) }}
className={styles.tabBoxStatusText}
>
{item.completeNum + "/" + item.totalNum}
</div>
</Box> </Box>
{ {item.state === "RUNNING" &&
item.state === "RUNNING" && isPass("PROJECT_WORKBENCH_JOBS_STOP", 'USER') && <Box className={styles.tabBoxJobOperate}> isPass("PROJECT_WORKBENCH_JOBS_STOP", "USER") && (
<img alt="" <Box className={styles.tabBoxJobOperate}>
<img
alt=""
src={jobStop} src={jobStop}
style={{ cursor: "pointer" }} style={{ cursor: "pointer" }}
onClick={(event) => { onClick={(event) => {
event.stopPropagation(); event.stopPropagation();
event.nativeEvent.stopImmediatePropagation(); event.nativeEvent.stopImmediatePropagation();
setJobData(item.id) setJobData(item.id);
setOpenDialog(true) setOpenDialog(true);
setDialogType('stop') setDialogType("stop");
}} }}
/> />
</Box> </Box>
} )}
{ {item.state !== "RUNNING" &&
item.state !== "RUNNING" && isPass("PROJECT_WORKBENCH_JOBS_DELETE", 'MANAGER') && <Box className={styles.tabBoxJobOperate}> isPass("PROJECT_WORKBENCH_JOBS_DELETE", "MANAGER") && (
<img alt="" <Box className={styles.tabBoxJobOperate}>
<img
alt=""
src={jobDel} src={jobDel}
style={{ cursor: "pointer" }} style={{ cursor: "pointer" }}
onClick={(event) => { onClick={(event) => {
event.stopPropagation(); event.stopPropagation();
event.nativeEvent.stopImmediatePropagation(); event.nativeEvent.stopImmediatePropagation();
setJobData(item.id) setJobData(item.id);
setOpenDialog(true) setOpenDialog(true);
setDialogType('del') setDialogType("del");
}} }}
/> />
</Box> </Box>
} )}
</Box> </Box>
) );
}) })}
}
</Box> </Box>
<TablePagination <TablePagination
rowsPerPageOptions={[5, 10, 20, 50]} rowsPerPageOptions={[5, 10, 20, 50]}
labelRowsPerPage={'每页行数:'} labelRowsPerPage={"每页行数:"}
ActionsComponent={ActionsComponent} ActionsComponent={ActionsComponent}
component="div" component="div"
count={count || jobList.length} count={count || jobList.length}
rowsPerPage={rowsPerPage || 10} rowsPerPage={rowsPerPage || 10}
page={page} page={page}
onPageChange={handleChangePage}// onPageChange={handleChangePage} //
onRowsPerPageChange={handleChangeRowsPerPage}// onRowsPerPageChange={handleChangeRowsPerPage} //
/> />
<SimpleDialog <SimpleDialog
text={dialogType === "del" ? '任务被删除后将无法恢复,确认继续吗?' : '正在运行的任务终止后将无法重新运行,确认继续吗?'} text={
title={dialogType === "del" ? '删除任务' : '终止任务'} dialogType === "del"
? "任务被删除后将无法恢复,确认继续吗?"
: "正在运行的任务终止后将无法重新运行,确认继续吗?"
}
title={dialogType === "del" ? "删除任务" : "终止任务"}
openDialog={openDialog} openDialog={openDialog}
closeDialog={closeDialog} closeDialog={closeDialog}
onConfirm={onConfirm} onConfirm={onConfirm}
/> />
</Box>
</Box >
); );
}); });
......
import style from "./index.module.css";
import { MenuItem } from "@mui/material"; import { MenuItem } from "@mui/material";
import React, { useState, useEffect } from "react";
import MyInput from "@/components/mui/MyInput"; import MyInput from "@/components/mui/MyInput";
import MyDialog from "@/components/mui/MyDialog"; import MyDialog from "@/components/mui/MyDialog";
import React, { useState, useEffect } from "react";
import useMyRequest from "@/hooks/useMyRequest"; import useMyRequest from "@/hooks/useMyRequest";
import { hpczone, addProject } from "@/api/project_api"; import { hpczone, addProject } from "@/api/project_api";
import { useMessage } from "@/components/MySnackbar"; import { useMessage } from "@/components/MySnackbar";
...@@ -14,6 +14,8 @@ import { ...@@ -14,6 +14,8 @@ import {
getFiletokenAccordingToId, getFiletokenAccordingToId,
} from "@/views/Project/project"; } from "@/views/Project/project";
import style from "./index.module.css";
type zoneIdOption = { type zoneIdOption = {
id: string; id: string;
name: string; name: string;
......
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