Commit 710fd2a6 authored by rocosen's avatar rocosen

fix:bug

parent a76e2c1e
<?xml version="1.0" encoding="UTF-8"?>
<svg width="13px" height="12px" viewBox="0 0 13 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>刷新</title>
<g id="上线UI" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="任务列表" transform="translate(-1394.000000, -308.000000)">
<g id="刷新" transform="translate(1384.000000, 298.000000)">
<g id="编组" transform="translate(8.000000, 8.000000)">
<rect id="矩形" x="0" y="0" width="16" height="16"></rect>
<path d="M14.1034483,5.0750097 L12.3103448,6.87501758 C11.862069,4.9250128 10.0689767,3.42499873 7.97701897,3.42499873 C5.51150172,3.42499873 3.49426034,5.45000759 3.49426034,7.92501842 C3.49426034,10.3999842 5.51150172,12.4249931 7.97701897,12.4249931 C10.3678534,12.4249931 12.3850948,10.5500599 12.4597328,8.15001941 L13.8045603,6.8000135 C13.8793103,7.17501139 13.9540603,7.55002053 13.9540603,8.0000225 C13.9540603,11.2999882 11.2644052,14 7.97701897,14 C4.68965517,14 2,11.2999882 2,8.0000225 C2,4.70001181 4.68965517,2 7.97701897,2 C9.91954397,2 11.712681,2.97499677 12.7586207,4.40000675 L12.9080086,4.17500577 L15,4.17500577 L14.1034483,5.0750097 Z" id="路径" fill="#8A9099"></path>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
......@@ -5,6 +5,7 @@
.tabHeader {
display: flex;
align-items: center;
justify-content: space-between;
}
.tabHeaderSelect {
......@@ -84,4 +85,18 @@
width: 10%;
display: flex;
justify-content: center;
}
.tabUpdate {
cursor: pointer;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
}
.tabUpdate:hover {
background: #F0F2F5;
border-radius: 4px;
}
\ No newline at end of file
......@@ -29,11 +29,15 @@ import jobCadence from '../../../../assets/project/jobCadence.svg'
import jobStop from '../../../../assets/project/jobStop.svg'
import jobDel from '../../../../assets/project/jobDel.svg'
import noData from '../../../../assets/project/noTemplate.svg'
import onload from '../../../../assets/project/onload.svg'
import {
getWorkflowJobList,
deleteWorkflowJob,
cancelWorkflowJob
} from "@/api/workbench_api";
import { toJS } from "mobx";
import { observer } from "mobx-react-lite";
import usePass from "@/hooks/usePass";
const currencies = [
{
......@@ -58,8 +62,10 @@ const currencies = [
},
];
const ProjectMembers = () => {
const ProjectMembers = observer(() => {
const { currentProjectStore } = useStores();
const projectId = toJS(currentProjectStore.currentProjectInfo.id);
const isPass = usePass();
const [jobName, setJobName] = useState('')
const [jobList, setJobList] = useState([])
const [currency, setCurrency] = useState('ALL');
......@@ -76,6 +82,15 @@ const ProjectMembers = () => {
onSuccess: (result: any) => {
setJobList(result.data.content);
setCount(result.data.totalElements)
setTimeout(() => {
getWorkflowJobInfo({
projectId: currentProjectStore.currentProjectInfo.id as string,
page: page,
size: size,
name: jobName,
state: currency === 'ALL' ? "" : currency
});
}, 60000);
},
});
......@@ -141,7 +156,7 @@ const ProjectMembers = () => {
name: jobName,
state: currency === 'ALL' ? "" : currency
});
}, [currentProjectStore.currentProjectInfo.id, getWorkflowJobInfo]);
}, [projectId, getWorkflowJobInfo]);
const handleChangePage = (event: any, newPage: any) => {
setPage(newPage)
......@@ -227,43 +242,58 @@ const ProjectMembers = () => {
<Box className={styles.headerBox}>
<Box className={styles.tabHeader}>
<OutlinedInput
onChange={(e: any) => {
searchChange(e.target.value)
}}
value={jobName}
placeholder="输入关键词搜索"
size="small"
sx={{ width: 340, height: 32 }}
endAdornment={<SearchIcon style={{ color: "#8A9099" }} />}
/>
<Box className={styles.tabHeaderSelect}>
<TextField
select
label="运行状态"
value={currency}
onChange={handleChange}
size="small"
sx={{
width: 180, height: 32,
['& .MuiOutlinedInput-root']: {
height: '32px',
color: "#1E2633",
fontSize: '14px'
},
['& .MuiInputLabel-root']: {
color: "#8A9099",
fontSize: '14px'
},
<Box sx={{ display: 'flex' }}>
<OutlinedInput
onChange={(e: any) => {
searchChange(e.target.value)
}}
>
{currencies.map((option) => (
<MenuItem key={option.value} value={option.value}>
{option.label}
</MenuItem>
))}
</TextField>
value={jobName}
placeholder="输入关键词搜索"
size="small"
sx={{ width: 340, height: 32 }}
endAdornment={<SearchIcon style={{ color: "#8A9099" }} />}
/>
<Box className={styles.tabHeaderSelect}>
<TextField
select
label="运行状态"
value={currency}
onChange={handleChange}
size="small"
sx={{
width: 180, height: 32,
['& .MuiOutlinedInput-root']: {
height: '32px',
color: "#1E2633",
fontSize: '14px'
},
['& .MuiInputLabel-root']: {
color: "#8A9099",
fontSize: '14px'
},
}}
>
{currencies.map((option) => (
<MenuItem key={option.value} value={option.value}>
{option.label}
</MenuItem>
))}
</TextField>
</Box>
</Box>
<Box className={styles.tabUpdate} onClick={() => {
getWorkflowJobInfo({
projectId: currentProjectStore.currentProjectInfo.id as string,
page: page,
size: size,
name: jobName,
state: currency === 'ALL' ? "" : currency
})
}} >
<img alt="" src={onload} />
</Box>
</Box>
......@@ -276,7 +306,7 @@ const ProjectMembers = () => {
justifyContent: 'center'
}}>
<img alt="" src={noData} />
<Typography sx={{ fontSize: '12px', fontWeight: '400', color: '#8A9099' }}>任务</Typography>
<Typography sx={{ fontSize: '12px', fontWeight: '400', color: '#8A9099' }}>任务</Typography>
</Box>
}
{
......@@ -317,20 +347,38 @@ const ProjectMembers = () => {
<div style={{ color: renderProgress(item.state) }} className={styles.tabBoxStatusText}>{item.completeNum + "/" + item.totalNum}</div>
</Box>
<Box className={styles.tabBoxJobOperate}>
<img alt=""
src={item.state === "RUNNING" ? jobStop : jobDel}
style={{ cursor: "pointer" }}
onClick={(event) => {
event.stopPropagation();
event.nativeEvent.stopImmediatePropagation();
setJobData(item.id)
setOpenDialog(true)
setDialogType(item.state === "RUNNING" ? 'stop' : 'del')
}}
/>
</Box>
{
item.state === "RUNNING" && isPass("PROJECT_WORKBENCH_JOBS_STOP", 'USER') && <Box className={styles.tabBoxJobOperate}>
<img alt=""
src={jobStop}
style={{ cursor: "pointer" }}
onClick={(event) => {
event.stopPropagation();
event.nativeEvent.stopImmediatePropagation();
setJobData(item.id)
setOpenDialog(true)
setDialogType('stop')
}}
/>
</Box>
}
{
item.state !== "RUNNING" && isPass("PROJECT_WORKBENCH_JOBS_DELETE", 'MANAGER') && <Box className={styles.tabBoxJobOperate}>
<img alt=""
src={jobDel}
style={{ cursor: "pointer" }}
onClick={(event) => {
event.stopPropagation();
event.nativeEvent.stopImmediatePropagation();
setJobData(item.id)
setOpenDialog(true)
setDialogType('del')
}}
/>
</Box>
}
</Box>
)
})
......@@ -357,8 +405,8 @@ const ProjectMembers = () => {
onConfirm={onConfirm}
/>
</Box>
</Box >
);
};
});
export default memo(ProjectMembers);
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