forked from Gitlink/forgeplus-react
Merge remote-tracking branch 'origin/pre_gitlink_ssr' into gitlink_ssr_head
This commit is contained in:
commit
32c64d2b91
|
|
@ -110,7 +110,7 @@ function AddProjects({id,visible,typeList,needAudit,role,onCancel,onFresh}){
|
|||
}
|
||||
const res = response.data;
|
||||
if(res && res.code === 200){
|
||||
message.success((needAudit === 1 && role && role.role !== "Manager") ? "操作成功,请等待管理员审核" : "操作成功!");
|
||||
message.success((needAudit === 1 && role !== "Manager") ? "操作成功,请等待管理员审核" : "操作成功!");
|
||||
Init(page,searchValue);
|
||||
onFresh();
|
||||
}else{
|
||||
|
|
|
|||
|
|
@ -130,11 +130,11 @@ function NewsIndex(props) {
|
|||
mainList && mainList.length > 0 &&
|
||||
<ul className='customMenus width1600'>
|
||||
<li className={!cateId ? "active" : ""}>
|
||||
<Link to={`/zone/${deptId}/news`}><img src={require(`../../img/1${!cateId ? "w" : "b"}.png`)} width={17} />全部新闻</Link>
|
||||
<Link to={`/zone/${deptId}/news`} onClick={()=>{setPageNum(1)}}><img src={require(`../../img/1${!cateId ? "w" : "b"}.png`)} width={17} />全部新闻</Link>
|
||||
</li>
|
||||
{mainList.map((i, k) => {
|
||||
return <li className={cateId && cateId === String(i.id) ? "active" : ""}>
|
||||
<Link to={`/zone/${deptId}/news/${i.id}`}>
|
||||
<Link to={`/zone/${deptId}/news/${i.id}`} onClick={()=>{setPageNum(1); setViewMode("default")}}>
|
||||
<img src={cateId && cateId === String(i.id) ? require(`../../img/${(k % 7) + 2}w.png`) : require(`../../img/${(k % 7) + 2}b.png`)} width={17} />
|
||||
{i.name}
|
||||
</Link>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import React, { Fragment, useEffect, useRef, useState } from 'react';
|
||||
import { Spin, Pagination, Divider, message, Input } from 'antd';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { getProjectsLists } from '../../../api';
|
||||
import { getProjectsLists, getGlobal } from '../../../api';
|
||||
import { projectCateConfig } from '../projectCateConfig';
|
||||
import nodata from '../../../img/nodata.png';
|
||||
import { getUniqueIdentifier, getUserName, getBrowserPlatform, getBrowserBrand } from '../../../utils';
|
||||
|
|
@ -118,6 +118,32 @@ function ProjectCateDetail(props) {
|
|||
}, [visibleSections.coreArea, visibleSections.projectList]);
|
||||
|
||||
function getLists() {
|
||||
if(searchName){
|
||||
getGlobal({
|
||||
extraSearchParam: {
|
||||
projectTypeId: cateId
|
||||
},
|
||||
keyword: searchName || "",
|
||||
pageNum: page,
|
||||
pageSize: pageSize,
|
||||
types: ["zone_project"],
|
||||
zoneId: id
|
||||
}).then(result => {
|
||||
if (result && result.data) {
|
||||
setLists(result.data.rows.map(item=>{
|
||||
return{
|
||||
...item,
|
||||
projectProperties: item.extendData
|
||||
}
|
||||
}));
|
||||
setTotal(result.data.total);
|
||||
setLoading(false);
|
||||
}
|
||||
}).catch(() => {
|
||||
setLoading(false);
|
||||
});
|
||||
return
|
||||
}
|
||||
getProjectsLists(id, {
|
||||
pageNum: page,
|
||||
pageSize: pageSize,
|
||||
|
|
@ -132,6 +158,7 @@ function ProjectCateDetail(props) {
|
|||
}).catch(() => {
|
||||
setLoading(false);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
@ -243,7 +270,7 @@ function ProjectCateDetail(props) {
|
|||
{lists.map((item, key) => (
|
||||
<div key={key} className='project-list-item'>
|
||||
<div className='df-center mb40'>
|
||||
{item.projectProperties && item.projectProperties.authorImageUrl && <img src={item.projectProperties.authorImageUrl} width={40} className='mr15'/>}
|
||||
{item.projectProperties && item.projectProperties.authorImageUrl && <img src={item.projectProperties.authorImageUrl} width={40} className='mr15' style={{borderRadius: '6px'}}/>}
|
||||
<div className='font-18 font-bd project-list-item-title mrat'>
|
||||
{item.projectProperties && item.projectProperties.fromOwner}/{item.projectProperties && item.projectProperties.name && item.projectProperties.name.split("/").pop()}
|
||||
</div>
|
||||
|
|
@ -263,7 +290,7 @@ function ProjectCateDetail(props) {
|
|||
)}
|
||||
<div className='df-center-between font-13 opacity8'>
|
||||
<div>
|
||||
{item.projectType && <span>{item.projectType}</span>}
|
||||
<span>{item.projectType || name}</span>
|
||||
{item.projectProperties && item.projectProperties.language && <Fragment>
|
||||
<Divider type="vertical" style={{ height: '0.7em' }} />
|
||||
<span>{item.projectProperties.language}</span>
|
||||
|
|
@ -271,7 +298,7 @@ function ProjectCateDetail(props) {
|
|||
</div>
|
||||
{item.projectProperties && item.projectProperties.timeAgo && <span>更新于{item.projectProperties.timeAgo}</span>}
|
||||
</div>
|
||||
<a className='font-15 project-list-item-btn' href={item.projectURL}>查看详情<i className='iconfont icon-zuojiantou1 ml5 font-12'></i></a>
|
||||
<a className='font-15 project-list-item-btn' href={`/${item.projectProperties.fullName}`}>查看详情<i className='iconfont icon-zuojiantou1 ml5 font-12'></i></a>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ function ProjectSource(props){
|
|||
const [ value , setValue ] = useState(undefined);
|
||||
const [ loading , setLoading ] = useState(false);
|
||||
const [ memberStatus , setMemberStatus] = useState(memberStatusEnum.notMember);
|
||||
const { id, temp, sectionProjectTitle , role } = props;
|
||||
const { id, temp, sectionProjectTitle , role, data } = props;
|
||||
|
||||
useEffect(()=>{
|
||||
let uuid = getUniqueIdentifier()
|
||||
|
|
@ -104,7 +104,7 @@ function ProjectSource(props){
|
|||
}
|
||||
return(
|
||||
<div className="in_pro">
|
||||
<AddProjects id={id} visible={visible} typeList={typeList} onCancel={()=>setVisible(false)} role={role && role.role} onFresh={getLists}/>
|
||||
<AddProjects needAudit={data && data.projectNeedAudit} id={id} visible={visible} typeList={typeList} onCancel={()=>setVisible(false)} role={role && role.role} onFresh={getLists}/>
|
||||
<div className="boxmain" style={{paddingTop:"56px"}}>
|
||||
<div className='titleButBox'>
|
||||
<p className="in_title">{sectionProjectTitle}</p>
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ function SearchIndex(props){
|
|||
lists.map((i,k)=>{
|
||||
return type==="zone_project" ? <div key={k}>
|
||||
{/* 开源项目 */}
|
||||
<div className='findName task-hide' dangerouslySetInnerHTML={{__html:i.title}} />
|
||||
<div className='findName task-hide' dangerouslySetInnerHTML={{__html:`${i.extendData && i.extendData.fromOwner}/${i.extendData && i.extendData.name && i.extendData.name.split("/").pop()}`}} />
|
||||
<p className='findDesc task-hide-2' dangerouslySetInnerHTML={{__html:i.content}} />
|
||||
<div className='findInfo mt30'>
|
||||
<ul>
|
||||
|
|
|
|||
|
|
@ -362,7 +362,7 @@ function Index(props){
|
|||
<Route
|
||||
path="/zone/:deptId/projects"
|
||||
render={(p) => (
|
||||
<ProjectSource {...props} {...p} id={id} temp={ temp } role={role} sectionProjectTitle={data && data.sectionProjectTitle}/>
|
||||
<ProjectSource {...props} {...p} id={id} temp={ temp } role={role} sectionProjectTitle={data && data.sectionProjectTitle} data={data}/>
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
|
|
|
|||
Loading…
Reference in New Issue