forked from Gitlink/forgeplus-react
issue列表搜索
This commit is contained in:
parent
5a1dce9c61
commit
63c2e8ba8e
|
@ -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(
|
||||
<div>
|
||||
|
@ -348,14 +352,7 @@ function List(props){
|
|||
}
|
||||
</div>
|
||||
<div>
|
||||
<RangePicker onChange={changeBeginTime} style={{width:240,marginRight:20}}/>
|
||||
{/* <DatePicker
|
||||
value={begin_date ? moment(begin_date, 'YYYY-MM-DD') : ""}
|
||||
style={{ marginRight: "20px",width:125 }}
|
||||
placeholder="选择开始时间"
|
||||
onChange={changeBeginTime}
|
||||
/>
|
||||
<DatePicker style={{ marginRight: "20px",width:125 }} value={end_date ? moment(end_date, 'YYYY-MM-DD') : ""} placeholder="选择结束时间" onChange={changeEndTime} /> */}
|
||||
<RangePicker value={[begin_date ? moment(begin_date, 'YYYY-MM-DD') : "",end_date ? moment(end_date, 'YYYY-MM-DD') : ""]} onChange={changeBeginTime} style={{width:240,marginRight:20}}/>
|
||||
{
|
||||
permission && permission !== "Reporter" &&
|
||||
<Link to={`/${owner}/${projectsId}/issues/sign`} className="dorpdownButton"><img src={bj} alt="" className="mr5" />标记管理</Link>
|
||||
|
|
Loading…
Reference in New Issue