From bde05b06b15d32252acdf6d8f45ee2cfc9ebdbb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Sun, 14 Sep 2025 12:08:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/CoderDepot.jsx | 32 ++++++++++++++++++++++++++++++-- src/forge/Main/Index.js | 18 +++++++++++++----- src/forge/Main/Index.scss | 6 ++++++ 3 files changed, 49 insertions(+), 7 deletions(-) diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 2f854198c..ce679f1ec 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -78,6 +78,7 @@ function CoderDepot(props){ const [ releaseVersions , setReleaseVersions] = useState(undefined); const [ licenseVisible ,setLicenseVisible] = useState(false); const [ checkVisible ,setCheckVisible] = useState(false); + const [ collaborators, setCollaborators] = useState([]); const owner = props.match.params.owner; const projectsId = props.match.params.projectsId; @@ -188,6 +189,21 @@ function CoderDepot(props){ } },[platform,mirror_status]) + useEffect(()=>{ + const {current_user} = props; + const url = `/${owner}/${projectsId}/collaborators.json`; + current_user && current_user.login && axios.get(url, { + params: { + page: 1, role: "Manager", limit: 100, + }, + }) + .then((result) => { + if (result) { + setCollaborators(result.data.members || []); + } + }).catch((error) => {}); + },[props.current_user && props.current_user.login]) + // 获取readme信息 function getReadmeInfo(path, ref) { axios.get(`/${owner}/${projectsId}/readme.json`, { @@ -659,13 +675,13 @@ function CoderDepot(props){
-
关于 +
{desc ? '制品库' : '关于'} { projectDetail.permission && (projectDetail.permission==="Admin" || projectDetail.permission==="Owner" || projectDetail.permission==="Manager") && setOpenModal(true)} className="iconfont icon-a-shezhi color-grey-9 font-15 pointer"> }
- {desc &&

{desc}

} + {desc &&

} {/* 项目标签 */} {topics &&
{topics.map(item=>{item.name})} @@ -728,6 +744,18 @@ function CoderDepot(props){ } {/* {__CLIENT__ && projectDetail && projectDetail.project_id && !projectDetail.private && } */} + {/* 贡献单位:取项目管理员 */} + {collaborators.length > 0 &&
+
贡献单位
+
+ {collaborators.map(item=>{ + return + + {item.name} + + })} +
+
} {/* 贡献者 */} {mirror_status ===0 && } {/* 项目画像: 导入/fork项目不展示 */} diff --git a/src/forge/Main/Index.js b/src/forge/Main/Index.js index a968eeb62..afb633bb4 100644 --- a/src/forge/Main/Index.js +++ b/src/forge/Main/Index.js @@ -103,7 +103,7 @@ class Index extends Component { axios.get(url, { params: { user_id: current_user && current_user.user_id, - page, + page: page > parseInt(this.state.total/limit) ? 1 : page, limit, search, sort_by: sort, @@ -259,10 +259,17 @@ class Index extends Component { } render() { - const { current_user } = this.props; + const { current_user, mygetHelmetapi} = this.props; + const {common: {projectTotal}} = mygetHelmetapi || {} + const project_total = +projectTotal.split("/").pop(); const { projectsList , recommendList , languageList , languageId, isSpin, total, search, limit, page, typeList, categoryList, recommendOriList , CategoryList , category_id, project_type } = this.state; - + + // 第一个类别 总数+300 + let total1 = total + if(CategoryList && CategoryList[0] && (CategoryList[0].id == category_id)){ + total1 = total+project_total + } // const setting={ // dots: true, // infinite: true, @@ -343,11 +350,12 @@ class Index extends Component {
  • this.changeCategory(undefined)}>项目类别
  • { CategoryList && CategoryList.length > 0 ? CategoryList.map((item,key)=>{ + const projects_count = !key ? item.projects_count+project_total : item.projects_count return(
  • this.changeCategory(`${item.id}`)}>

    {item.name} - {item.projects_count} + {projects_count}

  • ) @@ -419,7 +427,7 @@ class Index extends Component {
    - {this.pagination(total,limit,page)} + {this.pagination(total1,limit,page)}
    diff --git a/src/forge/Main/Index.scss b/src/forge/Main/Index.scss index b894b6484..77959c548 100644 --- a/src/forge/Main/Index.scss +++ b/src/forge/Main/Index.scss @@ -577,4 +577,10 @@ img{ margin-bottom: 35px; } +} + +.collaborators_img{ + width: 40px; + height: 40px; + border-radius: 50%; } \ No newline at end of file