Commit 02cf96c3 authored by rocosen's avatar rocosen

Update index.tsx

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