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 && @@ -88,18 +106,18 @@ function SpecialProjects({data, subTitle}) { {table2} {table3} {list.map(item=>{ - const {author, company} = item; - const detail = item.relevancyObject; + const {author, company, remark, link} = item; + const detail = item.relevancyObject || item; const {name, createUser, id} = detail return - - {title === "论文" ? : title === "专利" ? : } + {title !== "会议报告" ? + {title === "论文" ? : title === "专利" ? : } {name} - + : link ? {name} : {name}} {author} - {company || '-'} + {company || remark || '-'} })} @@ -159,7 +177,7 @@ function SpecialProjects({data, subTitle}) { // 如果当前行包含选中项,添加详情面板 if (currentRow.some(item => item.key === selectedItem?.toString())) { - const {detail, PAPER={rows:[]}, PATENT={rows:[]}, PROJECT={rows:[]}} = projectDetail; + const {detail, PAPER={rows:[]}, PATENT={rows:[]}, PROJECT={rows:[]}, REPORT={rows:[]}} = projectDetail; const {name, projectLeader, awards, introductionImageIdentifier} = detail || {}; rendered.push(

@@ -171,10 +189,11 @@ function SpecialProjects({data, subTitle}) { { introductionImageIdentifier &&

简介:

}
{ - PAPER.rows.length + PATENT.rows.length + PROJECT.rows.length > 0 &&
+ PAPER.rows.length + PATENT.rows.length + PROJECT.rows.length > 0 + REPORT.rows.length > 0 &&
{listItem("论文", "论文标题", "作者", "单位", PAPER)} {listItem("专利", "专利标题", "作者", "单位", PATENT)} {list2Item("开源项目", "项目名称", "参与者", PROJECT)} + {listItem("会议报告", "报告名称", "报告人", "备注", REPORT)}
}
diff --git a/src/forge/Information/api.js b/src/forge/Information/api.js index 6d2105c28..62f6b46a5 100644 --- a/src/forge/Information/api.js +++ b/src/forge/Information/api.js @@ -374,6 +374,14 @@ export function getSpecialProjectDetail(specialProjectId,params) { }) } +export function getSpecialReportList(params) { + return fetch({ + url: `/zone/open/ZoneSpecialProjectReport/list`, + method: 'GET', + params + }) +} + // 专区统计数据 export function getZoneStatistics(id) { return fetch({