forked from Gitlink/forgeplus-react
Merge branch 'gitlink_ssr_head' of https://gitlink.org.cn/Gitlink/forgeplus-react into gitlink_ssr_head
This commit is contained in:
commit
f3aa8af63e
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import React , { useState , useEffect } from 'react';
|
||||
import { Tag , Pagination } from 'antd';
|
||||
|
||||
import { getMemberAccountDetail, getPointsAccountEvent } from '../api';
|
||||
import { getMemberAccountDetail, getPointsTransaction } from '../api';
|
||||
|
||||
import '../indexUser.scss';
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ const transactionTypeMap = {
|
|||
};
|
||||
|
||||
function getPointsShow(item) {
|
||||
const config = transactionTypeMap[item.status];
|
||||
const config = transactionTypeMap[item.transactionType];
|
||||
if (!config) {
|
||||
return { className: '', pointsTxt: item.score, statusClass: '', status: '' };
|
||||
}
|
||||
|
|
@ -45,7 +45,7 @@ function scoreDetail(props){
|
|||
},[id, page])
|
||||
|
||||
function getDetail() {
|
||||
getPointsAccountEvent(id, { pageNum: page, pageSize: limit }).then(res => {
|
||||
getPointsTransaction(id, { pageNum: page, pageSize: limit }).then(res => {
|
||||
if (res && res.data && res.data.code === 200) {
|
||||
const processedRows = (res.data.rows || []).map(item => ({
|
||||
...item,
|
||||
|
|
|
|||
|
|
@ -380,10 +380,10 @@ function ZoneUser(props){
|
|||
onCancel={()=>setDocVisible(false)} onSure={() => { setDocVisible(false); setSuccessVisible(true);getInfo();}}
|
||||
/>
|
||||
<ApplyAcitvity visible={acitvityVisible} member={memberInfo} zoneName={zoneInfo?.name}
|
||||
onCancel={()=>setAcitvityVisible(false)} onSure={() => { showNotification(msg); setAcitvityVisible(false); getInfo();}}
|
||||
onCancel={()=>setAcitvityVisible(false)} onSure={(msg) => { showNotification(msg); setAcitvityVisible(false); getInfo();}}
|
||||
/>
|
||||
<ApplyQA visible={qaVisible} member={memberInfo} zoneName={zoneInfo?.name}
|
||||
onCancel={()=>setQaVisible(false)} onSure={() => { showNotification(msg); setQaVisible(false); getInfo();}}
|
||||
onCancel={()=>setQaVisible(false)} onSure={(msg) => { showNotification(msg); setQaVisible(false); getInfo();}}
|
||||
/>
|
||||
|
||||
<Modal
|
||||
|
|
|
|||
|
|
@ -239,6 +239,13 @@ export function getPointsAccountEvent(id){
|
|||
})
|
||||
}
|
||||
|
||||
export function getPointsTransaction(id){
|
||||
return fetch({
|
||||
url:`/zone/points/transaction/currentUser/${id}`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function getMemberAccountDetail(id, params){
|
||||
return fetch({
|
||||
url:`/zone/points/transaction/my/${id}`,
|
||||
|
|
|
|||
|
|
@ -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