Commit 02cf96c3 authored by rocosen's avatar rocosen

Update index.tsx

parent f69316a2
......@@ -66,6 +66,7 @@ const currencies = [
},
];
let timer: string | number | NodeJS.Timeout | null | undefined = null
const ProjectMembers = observer(() => {
const { currentProjectStore } = useStores();
const projectId = toJS(currentProjectStore.currentProjectInfo.id);
......@@ -86,7 +87,9 @@ const ProjectMembers = observer(() => {
onSuccess: (result: any) => {
setJobList(result.data.content);
setCount(result.data.totalElements)
setTimeout(() => {
timer && clearTimeout(timer)
timer = null;
timer = setTimeout(() => {
getWorkflowJobInfo({
projectId: currentProjectStore.currentProjectInfo.id as string,
page: page,
......@@ -243,15 +246,15 @@ const ProjectMembers = observer(() => {
}
}
/** 点击每一行 */
const rowClick = useCallback(
(id: string) => {
navigate(`/product/cadd/projectJobDetail`, {
state: { taskId: id },
});
},
[navigate],
);
/** 点击每一行 */
const rowClick = useCallback(
(id: string) => {
navigate(`/product/cadd/projectJobDetail`, {
state: { taskId: id },
});
},
[navigate],
);
return (
<Box className={styles.headerBox}>
......@@ -327,7 +330,7 @@ const ProjectMembers = observer(() => {
{
jobList.length > 0 && jobList.map((item: any, key) => {
return (
<Box className={styles.tabBox} onClick={()=>rowClick(item.id)}>
<Box className={styles.tabBox} onClick={() => rowClick(item.id)}>
<Box className={styles.tabBoxInfo}>
<div className={styles.tabBoxTitle}>{item.name}</div>
<Box className={styles.tabBoxDescInfo}>
......
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