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} />

) diff --git a/src/military/expert/expertUser/taskDetail/index.jsx b/src/military/expert/expertUser/taskDetail/index.jsx index e2229491..ec1185bd 100644 --- a/src/military/expert/expertUser/taskDetail/index.jsx +++ b/src/military/expert/expertUser/taskDetail/index.jsx @@ -63,7 +63,6 @@ function ReviewTasks({ showNotification, match, history, current_user }) { return text && text.map(item => { return

{ downFile(item) }}>{item.fileName}

- {/* {item.fileName} */}
}) } @@ -212,8 +211,6 @@ function ReviewTasks({ showNotification, match, history, current_user }) { let dataArr = []; if (res && Array.isArray(res.data)) { for (const item of res.data) { - let fileId = item.work_attachments && item.work_attachments.split('?')[0].split('/')[3]; - console.log(fileId); dataArr.push({ comments: "", expertId: current_user.expertId, @@ -224,8 +221,8 @@ function ReviewTasks({ showNotification, match, history, current_user }) { gradesThree: '', gradesTwo: '', opsContent: item.works_remark, - opsFiles: fileId, - opsFilesAttachments: item.work_attachments ? [{ id: fileId, fileName: '作品下载', fileDownPath: item.work_attachments }] : [], + opsFiles: item.work_file.id, + opsFilesAttachments: item.work_file, opsId: item.id, opsParentId: containerId, opsParentType: containerType, @@ -235,6 +232,7 @@ function ReviewTasks({ showNotification, match, history, current_user }) { } } setDataList(dataArr); + !dataArr.length && setLoading(false); disabled && setLoading(false); !disabled && dataArr.length && rules && initScoringDetails(dataArr).then(res => { if (res) { @@ -251,7 +249,7 @@ function ReviewTasks({ showNotification, match, history, current_user }) { let url = httpUrl + '/busiAttachments/download/' + item.id; window.open(url); } else { - let url = main_web_site_url + item.fileDownPath; + let url = main_web_site_url + `/attachments/send_file/${item.id}?disposition=attachment`; window.open(url); } } @@ -443,7 +441,7 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
{containerType == 1 ? '任务' : '赛事'}链接 {containerType == 1 && {`${window.location.origin}/task/taskDetail/${rules.containerId}`}} - {containerType == 2 && {`${main_web_site_url}/competitions/${rules.containerId}/home`}} + {containerType == 2 && {`${main_web_site_url}/competitions/${rules.containerId}/home`}}