From b927d471a5fd07e7126912cd090cbb72a7210d49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=AB=A5=E5=B4=87?= <1261960504@qq.com> Date: Mon, 24 Jan 2022 16:19:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=93=E5=AE=B6=E8=AF=84?= =?UTF-8?q?=E5=AE=A1=E5=88=9D=E5=A7=8B=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../expert/expertUser/reviewTasks/index.jsx | 33 ++++++++++++------- .../expert/expertUser/taskDetail/index.jsx | 12 +++---- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/military/expert/expertUser/reviewTasks/index.jsx b/src/military/expert/expertUser/reviewTasks/index.jsx index 5fb9c000..56cd584d 100644 --- a/src/military/expert/expertUser/reviewTasks/index.jsx +++ b/src/military/expert/expertUser/reviewTasks/index.jsx @@ -20,12 +20,16 @@ function ReviewTasks({ form, showNotification, match, history }) { const [dataList, setDataList] = useState([]); const [total, setTotal] = useState(0); - const [searchObj, setSearchObj] = useState({ + let initSearchObj = sessionStorage.expertTask ? JSON.parse(sessionStorage.expertTask) : { containerName: '', containerType: 1, - statusString:-1, - }); + statusString: -1, + }; + const [searchObj, setSearchObj] = useState(initSearchObj); + useEffect(() => { + setFieldsValue(initSearchObj); + }, []); const columns = useMemo(() => { return [ @@ -59,7 +63,7 @@ function ReviewTasks({ form, showNotification, match, history }) { dataIndex: 'status', key: 'status', render: (text, record) => { - return text === -1 ? '未评审' : record.commitReview ? '已评审':'已过期' + return text === -1 ? '未评审' : record.commitReview ? '已评审' : '已过期' } }, { @@ -98,20 +102,19 @@ function ReviewTasks({ form, showNotification, match, history }) { function onSearch() { let values = getFieldsValue(['containerName', 'containerType', 'statusString']); + sessionStorage.setItem('expertTask', JSON.stringify(values)); setSearchObj(values); } function clearSearch() { - setFieldsValue({ + let initSearchObj={ containerName: '', containerType: 1, statusString: -1, - }); - setSearchObj({ - containerName: '', - containerType: 1, - statusString: -1, - }); + }; + setFieldsValue(initSearchObj); + setSearchObj(initSearchObj); + sessionStorage.setItem('expertTask', JSON.stringify(initSearchObj)); setCurPage(1); } @@ -123,6 +126,12 @@ function ReviewTasks({ form, showNotification, match, history }) { ), []); + + function onShowSizeChange(current, pageSize) { + setCurPage(current); + setPageSize(pageSize); + } + return (
@@ -147,7 +156,6 @@ function ReviewTasks({ form, showNotification, match, history }) { style={{ width: "250px" }} placeholder="所有领域" dropdownClassName="expert_register" - // onChange={(value) => { setSearchReviewArea(value) }} > {taskType.map(item => { return @@ -185,6 +193,7 @@ function ReviewTasks({ form, showNotification, match, history }) { total={total} setCurPage={setCurPage} current={curPage} + onShowSizeChange={onShowSizeChange} />
{ downFile(item) }}>{item.fileName}
- {/* {item.fileName} */}