超算专区项目搜索改用全局搜索接口、添加项目弹窗传参修改
This commit is contained in:
parent
6c2b93aef6
commit
4f2dcb0f1c
|
|
@ -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{
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -342,7 +342,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