uos专项项目新增会议报告类型
This commit is contained in:
parent
810df7d249
commit
028d7102c4
|
|
@ -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 <p className='center color-blue mb10'>
|
||||
<a onClick={async () => {
|
||||
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 && <React.Fragment>
|
||||
|
|
@ -88,18 +106,18 @@ function SpecialProjects({data, subTitle}) {
|
|||
<Col span={6} className='s_p_rowList_t font-bd'>{table2}</Col>
|
||||
<Col span={6} className='s_p_rowList_t font-bd'>{table3}</Col>
|
||||
{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 <React.Fragment>
|
||||
<Col span={12} className='task-hide'>
|
||||
<a href={`/zone/${key}/source/${id}`}>
|
||||
{title === "论文" ? <img src={require('../image/s_project1.png')} width={24} className='mr10'/> : title === "专利" ? <img src={require('../image/s_project2.png')} width={24} className='mr10'/> : <img src={createUser.avatar}/>}
|
||||
{title !== "会议报告" ? <a href={`/zone/${key}/source/${id}`}>
|
||||
{title === "论文" ? <img src={require('../image/s_project1.png')} width={24} className='mr10' /> : title === "专利" ? <img src={require('../image/s_project2.png')} width={24} className='mr10' /> : <img src={createUser.avatar} />}
|
||||
{name}
|
||||
</a>
|
||||
</a> : link ? <a href={link}>{name}</a> : <span>{name}</span>}
|
||||
</Col>
|
||||
<Col span={6} className='task-hide'>{author}</Col>
|
||||
<Col span={6} className='task-hide'>{company || '-'}</Col>
|
||||
<Col span={6} className='task-hide' title={company || remark}>{company || remark || '-'}</Col>
|
||||
</React.Fragment>
|
||||
})}
|
||||
</Row>
|
||||
|
|
@ -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(
|
||||
<div key={`details-${selectedItem}`} className="item-details">
|
||||
|
|
@ -171,10 +189,11 @@ function SpecialProjects({data, subTitle}) {
|
|||
{ introductionImageIdentifier &&<p className='font-15 pb5 intro imageLayerParent'>简介:<img className="intro-img pointer" src={ getImage(introductionImageIdentifier) } alt="" /></p>}
|
||||
</div>
|
||||
{
|
||||
PAPER.rows.length + PATENT.rows.length + PROJECT.rows.length > 0 && <div style={{padding: '22px 33px'}}>
|
||||
PAPER.rows.length + PATENT.rows.length + PROJECT.rows.length > 0 + REPORT.rows.length > 0 && <div style={{padding: '22px 33px'}}>
|
||||
{listItem("论文", "论文标题", "作者", "单位", PAPER)}
|
||||
{listItem("专利", "专利标题", "作者", "单位", PATENT)}
|
||||
{list2Item("开源项目", "项目名称", "参与者", PROJECT)}
|
||||
{listItem("会议报告", "报告名称", "报告人", "备注", REPORT)}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -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({
|
||||
|
|
|
|||
Loading…
Reference in New Issue