diff --git a/src/forge/Information/Pages/homepage/component/specialProjects.jsx b/src/forge/Information/Pages/homepage/component/specialProjects.jsx index 58fe5b381..280d60a92 100644 --- a/src/forge/Information/Pages/homepage/component/specialProjects.jsx +++ b/src/forge/Information/Pages/homepage/component/specialProjects.jsx @@ -1,5 +1,5 @@ import React , { useEffect, useState } from 'react'; -import { getSpecialProjectDetail, getSpecialProjectList, getSpecialProjectTypeList, getImage } from '../../../api'; +import { getSpecialProjectDetail, getSpecialProjectList, getSpecialProjectTypeList, getImage, getSpecialReportList } from '../../../api'; import { Col, Divider, Icon, Row, Tag } from 'antd'; import Nodata from '../../../../Nodata'; import '../index.scss'; @@ -48,25 +48,38 @@ function SpecialProjects({data, subTitle}) { return res.data; } + async function getRelevancyListByReport(id, pageSize=5) { + const res = await getSpecialReportList({ + specialProjectId: id, + pageNum: 1, + pageSize + }); + return res.data; + } + const handleItemClick = async (id) => { setSelectedItem(selectedItem === id ? null : id); if(id === selectedItem) return const data = await Promise.all(relevancyTypes.map(async (item) => { return {[item]: await getRelevancyList(id, item)}; })); - const [a,b,c] = data + data.push({ + REPORT: await getRelevancyListByReport(id) + }) + const [a,b,c,d] = data setProjectDetail({ detail: projectList.find(item => item.id === id), ...a, ...b, - ...c + ...c, + ...d }); }; const showMore = (type, isShowAll) => { return
{
- const data = await getRelevancyList(selectedItem, type, isShowAll ? 5 : 1000);
+ const data = type === "REPORT" ? await getRelevancyListByReport(selectedItem, isShowAll ? 5 : 1000): await getRelevancyList(selectedItem, type, isShowAll ? 5 : 1000);
const detail = {
...projectDetail
}
@@ -77,7 +90,12 @@ function SpecialProjects({data, subTitle}) {
}
const listItem = (title, table1, table2, table3, res)=>{
- const type = title === "论文" ? "PAPER": "PATENT"
+ const typekey = {
+ "论文": "PAPER",
+ "专利": "PATENT",
+ "会议报告": "REPORT"
+ }
+ const type = typekey[title];
const {rows:list, total} = res;
const isShowAll = list.length === total
return !!list.length &&
: title === "专利" ?
: }
+ {title !== "会议报告" ?
+ {title === "论文" ?
: title === "专利" ?
: }
{name}
-
+
简介: