From 63c2e8ba8eed2b3dd56c5281736e7c3af8ae6d00 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Wed, 15 Mar 2023 14:54:17 +0800 Subject: [PATCH 1/3] =?UTF-8?q?issue=E5=88=97=E8=A1=A8=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Issues/Pages/list.jsx | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/forge/Issues/Pages/list.jsx b/src/forge/Issues/Pages/list.jsx index 1a217f2a0..1cc6f590d 100644 --- a/src/forge/Issues/Pages/list.jsx +++ b/src/forge/Issues/Pages/list.jsx @@ -63,6 +63,7 @@ function List(props){ useEffect(()=>{ const datas = cookie.load('issuestates'); let states = datas === "undefined" ? undefined : datas; + console.log(states); if(states){ setAboutMe(states.participant_category); setCategory(states.category); @@ -72,8 +73,8 @@ function List(props){ setNames(states.names); setBegin(states.begin_date); setEnd(states.end_date); - if(states.participant_category ==="all" && states.category === "opened" && states.page === 1 && states.limit===defaultLimit) - Init({...states},states.page,states.names); + // if(states.participant_category ==="all" && states.category === "opened" && states.page === 1 && states.limit===defaultLimit) + // Init({...states},states.page,states.names); }else{ Init(); } @@ -102,7 +103,7 @@ function List(props){ } // 使用自定义hook - useUpdateEffect(handleAllDisabled, [aboutMe,keyword,category,limit,begin_date,end_date]); + useUpdateEffect(handleAllDisabled, [aboutMe,keyword,category,limit,end_date,updateIds]); function getDirection(id){ @@ -128,6 +129,7 @@ function List(props){ // 获取issue列表数据 function Init(params,p,names){ + setTotal(undefined); const datas = cookie.load('issuestates'); let states = datas === "undefined" ? undefined : datas; if(states){ @@ -179,7 +181,7 @@ function List(props){ ) function chooseAboutMe(e){ setPage(1); - setCategory("opened"); + // setCategory("opened"); setAboutMe(e.key); } @@ -188,14 +190,16 @@ function List(props){ setKeyword(undefined); setAboutMe("all"); setCategory("opened"); - setTotal(undefined); setUpdateIds(undefined); setAllValue([]); + setPage(1); setValue(undefined); setNames(undefined); setEnd(undefined); setBegin(undefined); - (!value || begin_date || end_date ) && Init(); + // if(!value){ + // Init(); + // } // 清除下拉选项 menuRef.current && menuRef.current.clearChoose(); } @@ -290,7 +294,7 @@ function List(props){ }else{ setUpdateIds(ids); setTotal(undefined); - Init(ids,1,n); + // Init(ids,1,n); } } @@ -316,8 +320,8 @@ function List(props){ // 选择搜索时间 function changeBeginTime(data, value){ setPage(1); - setBegin(value[0] || undefined); - setEnd(value[1] || undefined); + setBegin(value[0] || ''); + setEnd(value[1] || ''); } return(
@@ -348,14 +352,7 @@ function List(props){ }
- - {/* - */} + { permission && permission !== "Reporter" && 标记管理 From f6dbcaf1b28c83d02469720bc97f6aa4df6866b6 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Wed, 15 Mar 2023 15:21:57 +0800 Subject: [PATCH 2/3] issue #2598 --- src/forge/Issues/Component/allMenus.jsx | 1 + src/forge/Issues/Pages/list.jsx | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/forge/Issues/Component/allMenus.jsx b/src/forge/Issues/Component/allMenus.jsx index 740fb0301..302f27faf 100644 --- a/src/forge/Issues/Component/allMenus.jsx +++ b/src/forge/Issues/Component/allMenus.jsx @@ -44,6 +44,7 @@ function AllMenus({owner,projectsId,chooseFunc,update,defaultNames,defaultIds,op useEffect(()=>{ if(defaultIds){ + console.log("defaule:",defaultIds); setIds(defaultIds); } },[defaultIds]) diff --git a/src/forge/Issues/Pages/list.jsx b/src/forge/Issues/Pages/list.jsx index 1cc6f590d..e3488ac81 100644 --- a/src/forge/Issues/Pages/list.jsx +++ b/src/forge/Issues/Pages/list.jsx @@ -146,7 +146,7 @@ function List(props){ limit, begin_date,end_date, sort_direction:getDirection(params && params.sort_by), - sort_by:getBy(params && params.sort_by), + sort_by:getBy(params && params.sort_by),names:undefined } }).then(result=>{ if(result){ @@ -292,6 +292,11 @@ function List(props){ // setUpdateIds(ids); setUpdateChooseIds(ids); }else{ + if(ids.status_id === "5"){ + setCategory("closed"); + }else{ + setCategory("opened"); + } setUpdateIds(ids); setTotal(undefined); // Init(ids,1,n); @@ -304,6 +309,19 @@ function List(props){ } function changeCategory(value){ if(value !== category){ + let ids = {...updateIds}; + let ns = {...names}; + if(value === "closed"){ + ns = {...ns,status_name:"关闭"} + ids = {...ids,status_id:'5'}; + setNames(ns) + setUpdateIds(ids); + }else{ + ns = {...ns,status_name:undefined} + ids = {...ids,status_id:undefined}; + setNames(ns) + setUpdateIds(ids); + } setCategory(value); setPage(1); setTotal(undefined); From 4910bbcfeaf7299dabc461ebd7f66423cf41f9c0 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Wed, 15 Mar 2023 15:22:51 +0800 Subject: [PATCH 3/3] remove console --- src/forge/Issues/Component/menus.jsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/forge/Issues/Component/menus.jsx b/src/forge/Issues/Component/menus.jsx index 40370a071..10f6fd1ff 100644 --- a/src/forge/Issues/Component/menus.jsx +++ b/src/forge/Issues/Component/menus.jsx @@ -22,7 +22,6 @@ function Menus({name, ids , lists , size , imgControl , searchFunc , chooseFunc useEffect(()=>{ setChooseValue(ids); - console.log(ids); setShowValue(names); },[ids,names]) @@ -44,7 +43,6 @@ function Menus({name, ids , lists , size , imgControl , searchFunc , chooseFunc setChooseValue(l); setShowValue(nameArr.join(",")); chooseFunc(l,nameArr.join(",")); - console.log("choosed:",l); }else{ if(l && l.indexOf(id)>=0){ setChooseValue([]);