diff --git a/package.json b/package.json index fd6bf219..cfa8ad5b 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "express": "^4.18.2", "flv.js": "^1.5.0", "fs-extra": "3.0.1", - "gsap": "^3.13.0", + "gsap": "^3.14.2", "http-proxy-middleware": "^2.0.6", "i18next": "^23.4.5", "immutability-helper": "^2.6.6", @@ -179,7 +179,7 @@ "/src/**/?(*.)(spec|test).{js,jsx,mjs}" ], "testEnvironment": "node", - "testURL": "http://localhost", + "testURL": "https://testforgeplus.trustie.net", "transform": { "^.+\\.(js|jsx|mjs)$": "/node_modules/babel-jest", "^.+\\.css$": "/config/jest/cssTransform.js", @@ -204,7 +204,7 @@ "eslintConfig": { "extends": "react-app" }, - "proxy": "http://172.20.32.203:4000/", + "proxy": "https://testforgeplus.trustie.net/", "port": "3007", "devDependencies": { "@babel/core": "^7.23.6", diff --git a/public/css/gitlink.min.css b/public/css/gitlink.min.css index 512b7ad8..847817c5 100644 --- a/public/css/gitlink.min.css +++ b/public/css/gitlink.min.css @@ -2042,6 +2042,10 @@ a.decoration { padding-right: 50px !important } +.pr80 { + padding-right: 80px !important +} + .pl0 { padding-left: 0 !important } @@ -2205,6 +2209,10 @@ a.decoration { box-sizing: border-box } +.line-normal{ + line-height: normal; +} + .lineh-12 { line-height: 12px !important } diff --git a/src/App.js b/src/App.js index 7f7b5623..16738b8e 100644 --- a/src/App.js +++ b/src/App.js @@ -150,7 +150,7 @@ const Home = Loadable({ }) const Store = Loadable({ - loader: () => import('./forge/Main/projectHomeNew/v2'), + loader: () => import('./forge/Main/projecthome/Index'), loading: Loading, }) @@ -227,7 +227,7 @@ const News = Loadable({ }); // 此处仅维护前端可能的一级路由,不用进行项目或者组织判断的字段。 -const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus","educoder", "glcc","bindlogin", "softbot","zone", "hiagent","softwareFactory", "development", "governance", "forums", "news"]; +const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus","educoder", "glcc","bindlogin", "softbot","zone", "hiagent","softwareFactory", "development", "governance", "forums", "news", "exploreStore", "factory"]; class App extends Component { constructor(props) { @@ -650,6 +650,12 @@ class App extends Component { } }> + ( + + )} + > ( @@ -657,6 +663,12 @@ class App extends Component { ) } /> + ( + + )} + > + { + return () + } + }> + + {/* 判断为用户/组织,并进入对应页面 */} { pathType === 'User' ? diff --git a/src/components/button/index.jsx b/src/components/button/index.jsx new file mode 100644 index 00000000..530fbfb9 --- /dev/null +++ b/src/components/button/index.jsx @@ -0,0 +1,11 @@ +import React from "react"; +import { Link } from "react-router-dom"; +import arrowIcon from '../../images/icon_arrow.png' +import './index.scss'; + +export const slidingArrowButton = ({href="/", name="探索更多内容", classname="font-16 font-bd", imageSrc}) =>{ + return + {name} + + +} \ No newline at end of file diff --git a/src/components/button/index.scss b/src/components/button/index.scss new file mode 100644 index 00000000..aaf6e888 --- /dev/null +++ b/src/components/button/index.scss @@ -0,0 +1,27 @@ +.slidingArrowButton{ + position: relative; + .arrowIconBox{ + display: inline-block; + overflow: hidden; + width: 25px; + height: 24px; + position: relative; + top: 5px; + } + .arrowIcon{ + width: 36px; + position: absolute; + left: -12px; + top: 7px; + transition: top 0.2s ease-out, left 0.2s ease-out; + } + &.color-white:hover{ + color: black !important; + } + &:hover{ + .arrowIcon{ + left: 7px; + top: -14px; + } + } +} \ No newline at end of file diff --git a/src/factory/components/Feature/index.jsx b/src/factory/components/Feature/index.jsx index c236472a..eeab08ed 100644 --- a/src/factory/components/Feature/index.jsx +++ b/src/factory/components/Feature/index.jsx @@ -40,7 +40,7 @@ function Feature(props) { return (
-

工厂引擎,全面赋能XX软件敏捷开发

+

工厂引擎,全面赋能菌用软件敏捷开发

diff --git a/src/factory/index.jsx b/src/factory/index.jsx index 56aaa4f0..e76d73d7 100644 --- a/src/factory/index.jsx +++ b/src/factory/index.jsx @@ -17,7 +17,7 @@ import DelayedScroll from '../forge/Utils/delayScroll' gsap.registerPlugin(ScrollTrigger); const bannerInfo = { - title: `软件工厂,开启xx软件研发新时代`, + title: `软件工厂,开启菌用软件研发新时代`, desc: '软件开发过程数字化,软件开发活动智能化,软件开发链路敏捷化', link: '/', forums: 'forums', diff --git a/src/factory/index.scss b/src/factory/index.scss index 8fe4a0eb..c1042e3b 100644 --- a/src/factory/index.scss +++ b/src/factory/index.scss @@ -314,6 +314,7 @@ &-video { margin-top: 83px; + display: none; video { opacity: 0; diff --git a/src/forge/AboutUs/AboutUs.jsx b/src/forge/AboutUs/AboutUs.jsx index cd2baa86..2d4528d9 100644 --- a/src/forge/AboutUs/AboutUs.jsx +++ b/src/forge/AboutUs/AboutUs.jsx @@ -169,7 +169,7 @@ function AboutUs(){
-

军事数智生态市场

+

菌事数智生态市场

支持代码溯源分析、   
许可证风险分析、开源漏洞检测和加固建议   
diff --git a/src/forge/Component/feedBack.jsx b/src/forge/Component/feedBack.jsx index a84187ed..0bd2aecd 100644 --- a/src/forge/Component/feedBack.jsx +++ b/src/forge/Component/feedBack.jsx @@ -23,7 +23,8 @@ $(window).scroll(function () { function SiderBar(props) { const {location, history,user, mygetHelmetapi= {}} = props; - const {navbar=[]} = mygetHelmetapi; + const {navbar=[], common} = mygetHelmetapi; + const {forums: forumsDoMain} = common || {}; const forumsList = navbar.filter(item=>item.link && item.link.includes("/forums")) const forumsUrl = forumsList[0] && forumsList[0].link; const {search, pathname} = location; @@ -86,12 +87,12 @@ function SiderBar(props) { // 意见反馈按钮点击事件 function feedBackClick(){ if(login){ - if(forumsUrl){ - return window.location.href=forumsUrl; + if(forumsDoMain){ + return window.location.href=`${forumsDoMain}/forums/new`; } setFeedBackModal(true); }else{ - history.push(`/login?go_page=${forumsUrl}`); + history.push(forumsDoMain ? `/login?go_page=${forumsDoMain}/forums/new` : `/login`); } } diff --git a/src/forge/Head/Header.js b/src/forge/Head/Header.js index f716612b..392f7797 100644 --- a/src/forge/Head/Header.js +++ b/src/forge/Head/Header.js @@ -322,6 +322,51 @@ class NewHeader extends Component { zoneList, isHome } = this.state; + const navbarlist = [ + { + "name": "军用可控开源社区", + "link": "/factory", + "index": "1", + "hidden": false + }, + { + "name": "社区动态", + "link": "/news", + "index": "5", + "hidden": false + }, + { + "name": "软件工厂专区", + "link": "/softwareFactory", + "index": "4", + "hidden": false + }, + { + "name": "开源软件仓库", + "link": "/exploreStore", + "index": "2", + "hidden": false + }, + { + "name": "供应链治理", + "link": "/projects", + "index": "3", + "hidden": false + }, + { + "name": "协作开发", + "link": "/projects", + "index": "3", + "hidden": false + }, + { + "name": "论坛交流", + "link": "/forums", + "index": "6", + "hidden": false + } + ] + const navbarByRoute = ["/factory", "/exploreStore", "/projects", "/softwareFactory", "/news", "/forums"].includes(this.props.match.path) ? navbarlist : settings ? settings.navbar : [] // let search_url = settings && settings.common && settings.common.search; return (
@@ -347,14 +392,14 @@ class NewHeader extends Component { }
*/} - {/* { + { settings && settings.nav_logo_url ? - 可控开源社区 + 菌用可控开源社区 : "" - } */} + } {/*
*/} { settings && settings.navbar && settings.navbar.length > 0 ? diff --git a/src/forge/Index.js b/src/forge/Index.js index dd9d7040..a00798ff 100644 --- a/src/forge/Index.js +++ b/src/forge/Index.js @@ -27,6 +27,11 @@ const ProjectHome = Loadable({ loading: Loading, }); +const ProjectHomeWH = Loadable({ + loader: () => import("./Main/projectHomeNew/v2/index"), + loading: Loading, +}); + class Index extends Component { componentDidUpdate = () => { @@ -68,6 +73,13 @@ class Index extends Component { ( + + )} + > + + ( )} diff --git a/src/forge/Main/projectHomeNew/index.jsx b/src/forge/Main/projectHomeNew/index.jsx index fdffb6a2..1203312b 100644 --- a/src/forge/Main/projectHomeNew/index.jsx +++ b/src/forge/Main/projectHomeNew/index.jsx @@ -31,7 +31,7 @@ function ProjectHomePage(props) { getCate(); getList(); getCateTopic(); - document.title = 'JY开源软件仓库'; + document.title = '菌用开源软件仓库'; }, []) useEffect(() => { @@ -247,4 +247,4 @@ function ProjectHomePage(props) {
} -export default TPMIndexHOC(ProjectHomePage) \ No newline at end of file +export default ProjectHomePage \ No newline at end of file diff --git a/src/forge/Main/projectHomeNew/v2/index.jsx b/src/forge/Main/projectHomeNew/v2/index.jsx index 4abd6c3b..107e2ec3 100644 --- a/src/forge/Main/projectHomeNew/v2/index.jsx +++ b/src/forge/Main/projectHomeNew/v2/index.jsx @@ -52,7 +52,7 @@ function ProjectHomePage(props) { getCate(); // getList(); getCateTopic(); - document.title = 'JY开源软件仓库'; + document.title = '菌用开源软件仓库'; // 获取总数 getInitCount(); }, []) @@ -154,8 +154,8 @@ function ProjectHomePage(props) {
-
JY开源软件仓库
-
汇聚全球顶尖开源力量,构建安全、协同、创新的软件生态,赋能军事数字化转型与智能化升级
+
菌用开源软件仓库
+
汇聚全球顶尖开源力量,构建安全、协同、创新的软件生态,赋能J事数字化转型与智能化升级
@@ -263,7 +263,7 @@ function ProjectHomePage(props) { }
})} -
: } +
: } {cateID && { setPage(page) }} className='center mt30' />}
@@ -272,4 +272,4 @@ function ProjectHomePage(props) {
} -export default TPMIndexHOC(ProjectHomePage) \ No newline at end of file +export default ProjectHomePage \ No newline at end of file diff --git a/src/forge/Main/projecthome/components/Banner.jsx b/src/forge/Main/projecthome/components/Banner.jsx index b6edd86b..e2f9aa08 100644 --- a/src/forge/Main/projecthome/components/Banner.jsx +++ b/src/forge/Main/projecthome/components/Banner.jsx @@ -6,7 +6,7 @@ import banner3 from '../../img/home/banner3.webp'; import { Link } from "react-router-dom"; const BANNER_DATA = [ - { key: 1, keyword: '仓库', name: 'JY开源软件仓库', title: 'JY开源软件仓库', content: '提供软件源码的集中托管与协作、编译构建后的制品统一管理,并支持一键搜索与下载成熟可用的应用程序,为军事软件的全生命周期提供一站式管理与分发服务', img: banner1 }, + { key: 1, keyword: '仓库', name: '菌用开源软件仓库', title: '菌用开源软件仓库', content: '提供软件源码的集中托管与协作、编译构建后的制品统一管理,并支持一键搜索与下载成熟可用的应用程序,为J事软件的全生命周期提供一站式管理与分发服务', img: banner1 }, { key: 2, keyword: '供应链', name: '供应链监测', title: '供应链监测', content: '实现供应链全流程可视化与智能决策。通过实时数据监控、需求预测与风险预警,优化库存与资源配置,助力精准掌控供应链动态,实现降本增效', img: banner2 }, // { key: 3, keyword: '软件工厂', name: '软件工厂专区', title: '软件工厂专区', content: '为您提供从需求到部署的一站式项目工程化管理。通过标准化流程、自动化流水线与统一制品库,赋能团队高效协作、规范交付,全面提升软件生产质量与效率', img: banner3 } ] diff --git a/src/forge/Main/projecthome/components/Store.jsx b/src/forge/Main/projecthome/components/Store.jsx index 4c68316f..5eb294ff 100644 --- a/src/forge/Main/projecthome/components/Store.jsx +++ b/src/forge/Main/projecthome/components/Store.jsx @@ -49,7 +49,7 @@ function Store(props) { return (
-

JY开源软件仓库

+

菌用开源软件仓库

一站式软件资源服务中心

{ diff --git a/src/forge/Main/projecthome/v2/animation.scss b/src/forge/Main/projecthome/v2/animation.scss new file mode 100644 index 00000000..dca0f5bd --- /dev/null +++ b/src/forge/Main/projecthome/v2/animation.scss @@ -0,0 +1,53 @@ +.title_v2{ + opacity: 0; + transform: translateY(50px); +} +.news_v2, .activities-container, .open-source-collaboration-container-content, .software-factory-content, .ecosystem-alliance-content, .forum-exchange-content, .governance-grid, .repository-v2-content{ + opacity: 0; + transform: translateY(50px); +} +.forum-exchange{ + opacity: 0; + transform: scale(0.9); + &.home_v2_visible .title_v2{ + animation-delay: 0.3s; + } + &.home_v2_visible .forum-exchange-content{ + animation-delay: 0.5s; + } +} +.home_v2_visible{ + .title_v2{ + animation: fadeInUp 0.8s ease-out forwards; + } + .news_v2, .open-source-collaboration-container-content, .software-factory-content, .ecosystem-alliance-content, .forum-exchange-content, .governance-grid, .repository-v2-content{ + animation: fadeInUp 0.8s ease-out forwards; + animation-delay: 0.3s; + } + .activities-container{ + animation: fadeInUp 0.8s ease-out forwards; + animation-delay: 0.6s; + } + &.forum-exchange{ + animation: resourceShow 0.8s ease-in-out forwards; + } +} + +@keyframes fadeInUp { + from { + opacity: 0; + transform: translateY(50px); + } + + to { + opacity: 1; + transform: translateY(0); + } +} + +@keyframes resourceShow { + to { + opacity: 1; + transform: scale(1); + } +} \ No newline at end of file diff --git a/src/forge/Main/projecthome/v2/components/banner.jsx b/src/forge/Main/projecthome/v2/components/banner.jsx index d3f0d1c2..09212124 100644 --- a/src/forge/Main/projecthome/v2/components/banner.jsx +++ b/src/forge/Main/projecthome/v2/components/banner.jsx @@ -37,16 +37,16 @@ function Banner({isVisible}) { return (
{/* 主要内容区域 */} -
+
- XX可控开源社区· + 菌队可控开源社区·
探索群智众创新范式
-
构建军方协同新生态
+
构建菌民协同新生态
{/* 克隆元素用于循环 */}
探索群智众创新范式
-
构建军方协同新生态
+
构建菌民协同新生态
@@ -91,19 +91,14 @@ function Banner({isVisible}) {
开源项目
-
-
100
-
合作伙伴
-
-
1000
-
应用软件
+
开发工具
99
-
漏洞数量
+
已治理组件
@@ -113,7 +108,12 @@ function Banner({isVisible}) {
21
-
论坛数量
+
论坛交流
+
+ +
+
50
+
生态伙伴
diff --git a/src/forge/Main/projecthome/v2/components/communityDynamic.jsx b/src/forge/Main/projecthome/v2/components/communityDynamic.jsx index 361d082c..18423ab0 100644 --- a/src/forge/Main/projecthome/v2/components/communityDynamic.jsx +++ b/src/forge/Main/projecthome/v2/components/communityDynamic.jsx @@ -3,13 +3,15 @@ import React, { Fragment, useEffect, useState } from 'react'; import { getSubDocList, getNewsDetail } from '../../../../Information/api'; import { BrowserRouter as Router, Route, Link } from "react-router-dom"; import moment from 'moment'; -import moreContentButton from './moreContentButton'; +import { slidingArrowButton } from '../../../../../components/button'; -const CommunityDynamic = () => { +const CommunityDynamic = ({isVisible}) => { const [list1, setList1] = useState([]); const [list2, setList2] = useState([]); const [firstActivity, setFirstActivity] = useState(undefined); const [list3, setList3] = useState([]); + // 轮播的active + const [activeId, setActiveId] = useState(0); const firstDynamics = list3[0] const firstByList1 = list1[0] || {} const list2_home = list2.slice(0,4); @@ -52,10 +54,10 @@ const CommunityDynamic = () => {
{firstByList1.name} -

+

{firstByList1.summary}

- + 了解更多 了解更多 @@ -66,7 +68,7 @@ const CommunityDynamic = () => { {list1.slice(1,5).map((item, index) => (
-
{item.name}
+
{item.name}

{item.summary}

{index < 3 && } @@ -79,14 +81,14 @@ const CommunityDynamic = () => {
-
+
{/* */} 精彩活动
    {list2_home.map((item, index) => ( -
  • +
  • - {item.summary} + {item.summary} {index === 1 && HOT} {/* {moment(item.publishTime).format('MM月DD日')} */} @@ -95,11 +97,11 @@ const CommunityDynamic = () => { ))}
- + {isVisible && list2_home && !!list2_home.length && {setActiveId(nextId)}}> {list2_home.map((item, index)=>{ return })} - + }
@@ -110,7 +112,8 @@ const CommunityDynamic = () => { {list3.slice(0,4).map((item, index) => (
  • - {item.name} + {/* {item.name} */} + {item.name} {index === 0 && NEW} {moment(item.publishTime).format('YYYY-MM-DD')} @@ -121,7 +124,7 @@ const CommunityDynamic = () => {
  • - {moreContentButton({ href: '/news' })} + {slidingArrowButton({ href: '/news' })}
    ); diff --git a/src/forge/Main/projecthome/v2/components/ecosystemAlliance.jsx b/src/forge/Main/projecthome/v2/components/ecosystemAlliance.jsx index 65bc04d5..5b05e118 100644 --- a/src/forge/Main/projecthome/v2/components/ecosystemAlliance.jsx +++ b/src/forge/Main/projecthome/v2/components/ecosystemAlliance.jsx @@ -1,60 +1,28 @@ import { Button } from 'antd'; import React, { useState, useEffect, useRef } from 'react'; +import { getMainInfos, getPartnerList } from '../../../../Information/api'; const EcosystemAlliance = () => { const [activeTab, setActiveTab] = useState('partners'); // 默认显示合作伙伴 + const [list, setList] = useState([]); + useEffect(()=>{ + getMainInfos("cszq").then(res=>{ + if(res && res.data && res.data.data){ + const {id} = res.data.data; + getPartnerList(id).then(res=>{ + if(res && res.data && res.data.rows){ + setList(res.data.rows) + } + }) + } + }) + + }, []) - // const partners = [ - // { name: '国防科技大学', logo: require('../image/logo1.png') }, - // { name: '航天工程大学', logo: require('../image/logo3.png').default }, - // { name: '信息工程大学', logo: require('../image/logo4.png').default }, - // { name: '海军工程大学', logo: require('../image/logo5.png') }, - // { name: '陆军工程大学', logo: require('../image/logo6.png') }, - // { name: '中国电子北京中软', logo: require('../image/logo7.png').default }, - // { name: '中国电科第十五研究所', logo: require('../image/logo8.png').default }, - // { name: '华为', logo: require('../image/logo2.png') }, - // { name: '麒麟', logo: require('../image/logo9.png') }, - // { name: '飞腾', logo: require('../image/logo10.png') }, - // { name: '阿里云', logo: require('../image/logo11.png') }, - // { name: '中国电子云', logo: require('../image/logo12.png') }, - // { name: '中国移动云', logo: require('../image/logo13.png').default } - // ]; // 将合作伙伴数据分成两部分 // const firstRowPartners = partners.slice(0, Math.ceil(partners.length / 2)); // const secondRowPartners = partners.slice(Math.ceil(partners.length / 2)); - const partners1 = [ - {title: "合作高校", children: [ - { name: '国防科技大学', logo: require('../image/logo1.png') }, - { name: '海军工程大学', logo: require('../image/logo5.png').default }, - { name: '南京信息工程大学', logo: require('../image/logo4.png').default }, - { name: '陆军工程大学', logo: require('../image/logo6.png').default }, - { name: '航天工程大学', logo: require('../image/logo3.png').default }, - { name: '信息工程大学', logo: require('../image/logo14.png').default }, - ]}, - {title: "合作企业", children: [ - { name: '中电太极', logo: require('../image/logo7.png').default }, - { name: '中国电科第十五研究所', logo: require('../image/logo8.png').default }, - { name: '华为', logo: require('../image/logo2.png') }, - { name: '阿里云', logo: require('../image/logo11.png') }, - { name: '飞腾', logo: require('../image/logo10.png') }, - { name: '航天706所', logo: require('../image/logo15.png') }, - { name: '麒麟', logo: require('../image/logo9.png') }, - { name: '中国电子云', logo: require('../image/logo12.png') }, - { name: '中国移动云', logo: require('../image/logo13.png').default } - ]}, - {title: "合作社区", children: [ - { name: 'GitLink', logo: require('../image/logo16.png') }, - { name: '红山开源', logo: require('../image/logo17.png') }, - { name: '麒麟社区', logo: require('../image/logo18.png') }, - { name: '鸿蒙社区', logo: require('../image/logo19.png') }, - { name: '鸥栖社区', logo: require('../image/logo20.png') }, - { name: '木兰开源社区', logo: require('../image/logo21.png').default }, - { name: '魔搭社区', logo: require('../image/logo22.png') }, - { name: '魔乐社区', logo: require('../image/logo25.png') }, - { name: '启智社区', logo: require('../image/logo23.png') }, - { name: '欧拉社区', logo: require('../image/logo24.png') }, - ]} - ] + // 标签切换处理 const handleTabChange = (tab) => { @@ -63,9 +31,11 @@ const EcosystemAlliance = () => { return (
    -
    生态联盟
    +
    生态联盟 · 合作伙伴
    +
    +
    开放协作,链接前沿技术,赋能合作伙伴,共筑可持续发展平台,共建软件开发新生态。
    -
    + {/*
    handleTabChange('partners')}> 合作伙伴 @@ -74,34 +44,34 @@ const EcosystemAlliance = () => { 项目贡献 -
    +
    */} -
    + {/*
    生态聚力 智创共赢
    -
    开放协作,与合作伙伴共拓市场蓝海。链接前沿技术,共建智慧产业新生态。赋能合作伙伴,
    共筑可持续发展平台
    +
    开放协作,链接前沿技术,赋能合作伙伴,共筑可持续发展平台,共建软件开发新生态。
    -
    +
    */} -
    - {partners1.map((i,key)=>{ - return
    -
    {i.title}
    -
    - {i.children.map((partner, index)=>{ - return
    - {partner.name} -
    - })} +
    + {list.map((i, key) => { + return
    +
    {i.typeName}
    +
    + {i.zonePartnersList.map((partner, index) => { + return
    + {partner.name} +
    + })} +
    -
    - })} + })} +
    - {/*
    { const forums = [ + { + id: 'software-factory', + title: '软件工厂技术交流分论坛', + description: '汇聚用户对“软件工厂”的功能/性能需求,交流讨论项目管理、\n软件质量管理、软件智能开发、软件流水线等方面的技术', + icon: require('../image/icon21.png') + }, { id: 'software-resources', - title: '软件资源需求分论坛', - description: '汇聚XX各单位对开源代码、三方组件、应用软件、\n模型数据、容器镜像等方面的资源需求', + title: '软件需求反馈分论坛', + description: '汇聚开源代码、三方组件、应用软件、模型数据、\n容器镜像等的软件应用反馈和资源需求', icon: require('../image/icon18.png') }, { id: 'supply-chain', title: '供应链治理分论坛', - description: '交流讨论对软件漏洞、软件溯源、\nSBOM等方面的知识', + description: '交流讨论软件漏洞、软件溯源、\n兼容性分析、SBOM等方面的知识', icon: require('../image/icon19.png') }, { id: 'open-source-development', title: '开源软件开发协作分论坛', - description: '交流讨论开源写作、漏洞治理、兼容性分析、\n缺陷修复、学习资源等方面的知识', + description: '交流讨论开源协作、技术创新、缺陷修复、\n学习资源等方面的知识', icon: require('../image/icon20.png') - }, - { - id: 'software-factory', - title: '软件工厂技术交流分论坛', - description: '汇聚用户对“软件工厂”的功能/性能需求,交流讨论项目管理、\n软件质量管理、软件智能开发、软件流水线等方面的知识', - icon: require('../image/icon21.png') } ]; @@ -55,36 +56,38 @@ const ForumExchange = () => {
    论坛交流
    -
    - {forums.map((forum, index) => ( - -
    - {forum.title} - {forum.title} -
    {forum.description}
    -
    - {index !== forums.length - 1 && } -
    - ))} -
    - 论坛交流 - -
    - {features.map((feature, index) => ( - -
    - {feature.title} -
    - {feature.title} -
    {feature.description}
    +
    +
    + {forums.map((forum, index) => ( + +
    + {forum.title} + {forum.title} +
    {forum.description}
    -
    - {index !== features.length - 1 && } - - ))} -
    -
    - {moreContentButton({href:"/forums", classname:"font-16 but-to-right font-bd color-white"})} + {index !== forums.length - 1 && } + + ))} +
    + 论坛交流 + +
    + {features.map((feature, index) => ( + +
    + {feature.title} +
    + {feature.title} +
    {feature.description}
    +
    +
    + {index !== features.length - 1 && } +
    + ))} +
    +
    + {slidingArrowButton({href:"/forums", classname:"font-16 font-bd color-white", imageSrc: icon_arrow1})} +
    ); diff --git a/src/forge/Main/projecthome/v2/components/moreContentButton.jsx b/src/forge/Main/projecthome/v2/components/moreContentButton.jsx deleted file mode 100644 index c540a57e..00000000 --- a/src/forge/Main/projecthome/v2/components/moreContentButton.jsx +++ /dev/null @@ -1,9 +0,0 @@ -import { Icon } from "antd"; -import React from "react"; -import { Link } from "react-router-dom"; - -function moreContentButton({href="/", name="探索更多内容", classname="font-16 but-to-right font-bd"}){ - return {name} -} - -export default moreContentButton \ No newline at end of file diff --git a/src/forge/Main/projecthome/v2/components/openSourceCollaboration.jsx b/src/forge/Main/projecthome/v2/components/openSourceCollaboration.jsx index dd9c674e..d0a73b3c 100644 --- a/src/forge/Main/projecthome/v2/components/openSourceCollaboration.jsx +++ b/src/forge/Main/projecthome/v2/components/openSourceCollaboration.jsx @@ -5,7 +5,7 @@ const OpenSourceCollaboration = () => { { id: 'code-hosting', title: '软件代码托管', - description: '提供开源代码git协议访问、分支管理、版本管理、许可证管理等服务', + description: '提供开源代码Git协议访问、分支管理、版本管理、许可证管理等服务', icon: require('../image/icon11.png') }, { diff --git a/src/forge/Main/projecthome/v2/components/openSourceCollaboration1.jsx b/src/forge/Main/projecthome/v2/components/openSourceCollaboration1.jsx index 3a2578fe..5df9c2d3 100644 --- a/src/forge/Main/projecthome/v2/components/openSourceCollaboration1.jsx +++ b/src/forge/Main/projecthome/v2/components/openSourceCollaboration1.jsx @@ -9,7 +9,7 @@ const OpenSourceCollaboration = ({isVisible}) => { const features = [ { title: '软件代码托管', - description: '提供开源代码git协议访问、分支管理、版本管理、许可证管理等服务', + description: '提供开源代码Git协议访问、分支管理、版本管理、许可证管理等服务', }, { title: '群智协同改进', @@ -25,6 +25,25 @@ const OpenSourceCollaboration = ({isVisible}) => { } ]; + useEffect(() => { + const interval = setInterval(() => { + setActive(prevActive => { + return prevActive === 1 ? 2 : 1; + }); + }, 6000); + + // 清理定时器 + return () => { + clearInterval(interval); + }; + }, []); + + useEffect(()=>{ + if(isVisible){ + setActive(1); + } + }, [isVisible]) + const handleFeatureClick = (feature) => { setSelectedFeature(selectedFeature === feature ? null : feature); }; @@ -32,53 +51,55 @@ const OpenSourceCollaboration = ({isVisible}) => { return (
    开源协作
    -
    -
    -
    - {features.map((feature, index) => ( -
    - - - {feature.title} - -
    {feature.description}
    +
    +
    +
    +
    + {features.map((feature, index) => ( +
    + + + {feature.title} + +
    {feature.description}
    +
    + ))} + + +
    + +
    + +
    +
    - ))} - -
    +
    -
    +
    -
    +
    + {active === 1 && + + } + {active === 2 && + + + + + + + } + +
    - -
    - -
    - -
    - {active === 1 && - - } - {active === 2 && - - - - - - - } - -
    -
    diff --git a/src/forge/Main/projecthome/v2/components/project.jsx b/src/forge/Main/projecthome/v2/components/project.jsx index 563c650f..76484d5b 100644 --- a/src/forge/Main/projecthome/v2/components/project.jsx +++ b/src/forge/Main/projecthome/v2/components/project.jsx @@ -20,7 +20,7 @@ const RepositoryV2 = () => { { id: 'distribution', title: '资源高效可靠分发', - description: '高校分发、可靠传输、多节点部署' + description: '高效分发、可靠传输、多节点部署' }, { id: 'storage', @@ -39,53 +39,57 @@ const RepositoryV2 = () => { {/* 标题 */}
    开源软件仓
    - {/* 导航标签 */} -
    - {tabs.map((tab) => ( -
    - {tab.label} - {tab.label} -
    - ))} -
    +
    + + {/* 导航标签 */} +
    + {tabs.map((tab) => ( +
    + {tab.label} + {tab.label} +
    + ))} +
    - {/* 主要内容区域 */} -
    - {/* 左侧功能介绍 */} -
    -
    数据统一可控访问
    + {/* 主要内容区域 */} +
    + {/* 左侧功能介绍 */} +
    +
    丰富多样 · 开放共享 · 认证溯源
    -
    - {features.map((feature) => ( -
    -
    - - {feature.title} +
    + {features.map((feature) => ( +
    +
    + + {feature.title} +
    +
    {feature.description}
    -
    {feature.description}
    -
    - ))} + ))} +
    + +
    - -
    - - {/* 右侧架构图 - 使用图片 */} -
    - 开源仓库架构图 + {/* 右侧架构图 - 使用图片 */} +
    + 开源仓库架构图 +
    +
    diff --git a/src/forge/Main/projecthome/v2/components/softwareFactory.jsx b/src/forge/Main/projecthome/v2/components/softwareFactory.jsx index f1f6f407..b14abb89 100644 --- a/src/forge/Main/projecthome/v2/components/softwareFactory.jsx +++ b/src/forge/Main/projecthome/v2/components/softwareFactory.jsx @@ -22,20 +22,20 @@ function SoftwareFactory() { return (
    软件工厂
    -
    +
    敏捷模式 - 轻松搭建 + 全流程迭代演化
    -
    依托敏捷模式灵活迭代,高效协同推进,让产品搭建更轻松便
    +
    敏捷模式聚焦需求 - 任务 - 代码 - 迭代 - 测试 - 制品的全流程
    数字化升级和在线化组织
    极速模式 - 高效快构 + 高效率快速响应
    极速模式聚焦任务 - 代码 - 制品,助力软件研发快速响应、
    实现极致效率
    diff --git a/src/forge/Main/projecthome/v2/components/supplyChainGovernance.jsx b/src/forge/Main/projecthome/v2/components/supplyChainGovernance.jsx index 5d8fb9ed..16e87de9 100644 --- a/src/forge/Main/projecthome/v2/components/supplyChainGovernance.jsx +++ b/src/forge/Main/projecthome/v2/components/supplyChainGovernance.jsx @@ -2,12 +2,13 @@ import React from 'react'; import icon1 from '../image/icon25.png'; import icon2 from '../image/icon22.png'; import icon3 from '../image/icon26.png'; +import { slidingArrowButton } from '../../../../../components/button'; const SupplyChainGovernance = () => { const governanceItems = [ { id: 'security', - title: '供应链安全XX库', + title: '供应链安全漏洞库', subtitle: '汇聚漏洞信息,恶意代码信息,组件信息三类关键供应链安全信息要素', image: require('../image/supply-chain-security.png').default, width: '40%', @@ -78,6 +79,10 @@ const SupplyChainGovernance = () => {
    ))}
    + +
    + {slidingArrowButton({href:"/governance"})} +
    ); }; diff --git a/src/forge/Main/projecthome/v2/image/logo1.png b/src/forge/Main/projecthome/v2/image/logo1.png deleted file mode 100644 index ee7e7379..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo1.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo10.png b/src/forge/Main/projecthome/v2/image/logo10.png deleted file mode 100644 index 35446271..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo10.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo11.png b/src/forge/Main/projecthome/v2/image/logo11.png deleted file mode 100644 index 889ee8f5..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo11.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo12.png b/src/forge/Main/projecthome/v2/image/logo12.png deleted file mode 100644 index eb48505f..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo12.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo13.png b/src/forge/Main/projecthome/v2/image/logo13.png deleted file mode 100644 index 7e106d93..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo13.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo14.png b/src/forge/Main/projecthome/v2/image/logo14.png deleted file mode 100644 index 3f88b694..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo14.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo15.png b/src/forge/Main/projecthome/v2/image/logo15.png deleted file mode 100644 index 9295745c..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo15.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo16.png b/src/forge/Main/projecthome/v2/image/logo16.png deleted file mode 100644 index a9ebc2eb..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo16.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo17.png b/src/forge/Main/projecthome/v2/image/logo17.png deleted file mode 100644 index e8fc22e8..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo17.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo18.png b/src/forge/Main/projecthome/v2/image/logo18.png deleted file mode 100644 index 9ceb98c2..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo18.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo19.png b/src/forge/Main/projecthome/v2/image/logo19.png deleted file mode 100644 index 6d9cff59..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo19.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo2.png b/src/forge/Main/projecthome/v2/image/logo2.png deleted file mode 100644 index 9894fa64..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo2.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo20.png b/src/forge/Main/projecthome/v2/image/logo20.png deleted file mode 100644 index 1009dcc9..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo20.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo21.png b/src/forge/Main/projecthome/v2/image/logo21.png deleted file mode 100644 index 101c478f..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo21.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo22.png b/src/forge/Main/projecthome/v2/image/logo22.png deleted file mode 100644 index 305640ae..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo22.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo23.png b/src/forge/Main/projecthome/v2/image/logo23.png deleted file mode 100644 index f51c0dfb..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo23.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo24.png b/src/forge/Main/projecthome/v2/image/logo24.png deleted file mode 100644 index cdf588f5..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo24.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo25.png b/src/forge/Main/projecthome/v2/image/logo25.png deleted file mode 100644 index a2c52585..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo25.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo3.png b/src/forge/Main/projecthome/v2/image/logo3.png deleted file mode 100644 index fd30447a..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo3.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo4.png b/src/forge/Main/projecthome/v2/image/logo4.png deleted file mode 100644 index ebd4a729..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo4.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo5.png b/src/forge/Main/projecthome/v2/image/logo5.png deleted file mode 100644 index a2d77661..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo5.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo6.png b/src/forge/Main/projecthome/v2/image/logo6.png deleted file mode 100644 index da36b1ca..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo6.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo7.png b/src/forge/Main/projecthome/v2/image/logo7.png deleted file mode 100644 index ceaab84c..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo7.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo8.png b/src/forge/Main/projecthome/v2/image/logo8.png deleted file mode 100644 index 43dd51aa..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo8.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/logo9.png b/src/forge/Main/projecthome/v2/image/logo9.png deleted file mode 100644 index 62bea016..00000000 Binary files a/src/forge/Main/projecthome/v2/image/logo9.png and /dev/null differ diff --git a/src/forge/Main/projecthome/v2/image/supply-chain-security.png b/src/forge/Main/projecthome/v2/image/supply-chain-security.png index 3e788950..27f62795 100644 Binary files a/src/forge/Main/projecthome/v2/image/supply-chain-security.png and b/src/forge/Main/projecthome/v2/image/supply-chain-security.png differ diff --git a/src/forge/Main/projecthome/v2/index.jsx b/src/forge/Main/projecthome/v2/index.jsx index afe99f4d..fec8612a 100644 --- a/src/forge/Main/projecthome/v2/index.jsx +++ b/src/forge/Main/projecthome/v2/index.jsx @@ -9,8 +9,10 @@ import OpenSourceCollaboration from './components/openSourceCollaboration1'; import SoftwareFactory from './components/softwareFactory'; import Forum from './components/forum'; import EcosystemAlliance from './components/ecosystemAlliance'; +import './animation.scss'; function Index(props) { + const {mygetHelmetapi: {name}, mygetHelmetapi} = props; const observer = useRef(); const [visibleItems, setVisibleItems] = useState({}); @@ -31,9 +33,7 @@ function Index(props) { } }); }, { - root: null, - rootMargin: '0px', - threshold: 0.1 + threshold: 0.3 }); // 观察所有子组件 @@ -48,18 +48,18 @@ function Index(props) { }, []); useEffect(() => { - document.title = props.mygetHelmetapi && props.mygetHelmetapi.name ? props.mygetHelmetapi.name : '生态创新治理中心'; - }, []) + document.title = name ? name : '菌用可控开源社区'; + }, [name]) return (
    - + - - + +
    ) diff --git a/src/forge/Main/projecthome/v2/index.scss b/src/forge/Main/projecthome/v2/index.scss index 42f6da54..eca836ea 100644 --- a/src/forge/Main/projecthome/v2/index.scss +++ b/src/forge/Main/projecthome/v2/index.scss @@ -134,6 +134,57 @@ font-weight: normal; position: absolute; right: 0; + font-size: 17px; + top: 3px; + } + } + .activity-section-item{ + position: relative; + &::after { + position: absolute; + bottom: -1px; + left: 0; + content: ''; + width: 0; + height: 1px; + background-color: #2149d4; + } + &-active::after{ + animation: bottomflowLight 3s forwards; + } + } + .activity-section-item-active .title-border-to-right-icon{ + padding-right: 20px; + color: #2149d4; + &+.hot-tag { + display: none; + } + &::before { + content: "\e9c4"; + font-family: 'iconfont'; + font-weight: normal; + font-size: 12px; + position: absolute; + right: 0px; + top: 4px; + } + } + .title-border-to-right-icon{ + position: relative; + &:hover{ + padding-right: 20px; + &+.hot-tag { + display: none; + } + } + &:hover::before { + content: "\e9c4"; + font-family: 'iconfont'; + font-weight: normal; + font-size: 12px; + position: absolute; + right: 0; + top: 4px; } } @@ -248,7 +299,7 @@ padding: 10px; position: absolute; top: 15%; - left: 8%; + left: 4%; } .center-left-code { @@ -279,21 +330,21 @@ padding: 10px; position: absolute; bottom: 8%; - right: 9.5%; + right: 5.2%; } .center-left-2 { opacity: 0.4; position: absolute; - bottom: -6%; - left: 18%; + bottom: -3%; + left: 14%; } .center-left-3 { opacity: 0.5; position: absolute; top: 19%; - right: 19.1%; + right: 14.5%; } } @@ -317,8 +368,8 @@ .center-1-bk { display: inline-block; - width: 866px; - height: 528px; + width: 1000px; + height: 600px; border-radius: 15px; background-image: url('./image/banner-bk.png'); background-size: 100% 100%; @@ -336,13 +387,14 @@ } .center-image-container-content { - height: 461px; - - background-image: url('./image/bk6.png'); + min-width: 940px; + height: 530px; + background-image: url('./image/bk6.png'), linear-gradient(145deg, #1d36a1, #171e41); background-size: 100% 100%; + border-radius: 15px; img { - max-width: 99%; + max-width: 95.4%; } &-title { @@ -361,7 +413,8 @@ .news_v2 { background-image: url('./image/img1.png'); - background-size: 100% 100%; + background-size: 100% auto; + background-repeat: no-repeat; } .highlight-news { @@ -390,17 +443,17 @@ width: 60%; } .activity-section-Carousel{ - width: 400px; - border-radius: 10px; - max-height: 211px; + width: 300px; + height: 200px; overflow: hidden; .slick-track{ display: flex; align-items: flex-end; } img{ - object-fit: cover; - max-width: 100%; + width: 300px; + height: 200px; + border-radius: 10px; } } @@ -479,7 +532,7 @@ } .supply-chain-governance { - padding: 60px 20px 30px; + padding: 30px 20px 50px; .governance-grid { display: flex; @@ -562,7 +615,8 @@ flex: 1; margin-top: 30px; height: 335px; - background-image: url('./image/software-assessment.png'), linear-gradient(156.13deg, #4f73f6 0%, #7babff 100%); + // background-image: url('./image/software-assessment.png'), linear-gradient(156.13deg, #4f73f6 0%, #7babff 100%); + background-image: url('./image/software-assessment.png'), linear-gradient(100.13deg, #4f73f600 0%, #7babff3c 100%); background-size: auto 100%; background-position: right; background-repeat: no-repeat; @@ -571,8 +625,8 @@ background-color:#f8f3ff; } .tag-value { - color:#091221; - background-color:#ffffff; + // color:#091221; + // background-color:#ffffff; } .governance-item-title{ padding-top: 20px; @@ -580,7 +634,7 @@ } div { - color: white; + // color: white; } } } @@ -717,7 +771,7 @@ } .software-left-item { - cursor: pointer; + // cursor: pointer; max-height: max-content; &.active { @@ -781,6 +835,7 @@ background-image: url('./image/bk3.png'); background-size: 100% auto; background-repeat: no-repeat; + background-position-y: -90px; padding: 90px 20px 60px 20px; .tabs_v2 { @@ -884,6 +939,7 @@ img { max-width: 80%; + max-height: 100%; } } } @@ -902,7 +958,7 @@ height: 40px; left: 50%; transform: translateX(-50%); - bottom: 150px; + bottom: -20px; } .content-wrapper { @@ -1286,4 +1342,14 @@ 100% { transform: translateY(0) scale(1) rotateX(0deg); } +} + +@keyframes bottomflowLight { + 0% { + width: 0; + } + + 100% { + width: 100%; + } } \ No newline at end of file diff --git a/src/forge/projectHome/explore/index.jsx b/src/forge/projectHome/explore/index.jsx index 68af1ae5..aa3695cb 100644 --- a/src/forge/projectHome/explore/index.jsx +++ b/src/forge/projectHome/explore/index.jsx @@ -1,4 +1,4 @@ -import React, { createRef, useEffect, useState } from "react"; +import React, { createRef, Fragment, useEffect, useState } from "react"; import axios from "axios"; import { Button, Carousel, Divider, Input, Pagination, Popover, Spin, Tooltip } from "antd"; import { Link } from "react-router-dom"; @@ -9,7 +9,12 @@ import RenderHtml from "../../../components/render-html"; import FeedBack from "../../../forge/Component/feedBack"; import './index.scss'; import ActionItem from "../../../factory/resource/components/ActionItem"; -import img1 from '../image/icon15.png' +import img1 from '../image/icon15.png'; +import img2 from '../image/icon9.png'; +import img3 from '../image/icon10.png'; +import img4 from '../image/icon11.png'; +import img5 from '../image/icon12.png'; +import img6 from '../image/icon13.png'; const { Search } = Input; function ProjectHomePage(props) { const carouselEL = createRef() @@ -25,9 +30,30 @@ function ProjectHomePage(props) { const [cateTopics, setCateTopics] = useState(undefined); const [topicId, setTopicId] = useState(undefined); const [topicDetail, setTopicDetail] = useState(undefined); - const [count, setCount] = useState({}); - const { countByGHM, countByOther, countByGHMType, countByMX, countByRQ } = count; + const [count, setCount] = useState([ + { + "name": "应用软件", + "value": "405+" + }, + { + "name": "三方组件", + "value": "10+" + }, + { + "name": "数据集", + "value": "1000+" + }, + { + "name": "智能模型", + "value": "99+" + }, + { + "name": "容器镜像", + "value": "10+" + } +]); const topicsByCateId = cateTopics && cateTopics[cateID]; + const logo = [img2, img3 ,img4, img5, img6] const topicsLength = topicsByCateId && topicsByCateId.length const LIMIT = !topicsLength ? 30 : 25; @@ -36,7 +62,7 @@ function ProjectHomePage(props) { getCate(); getList(); getCateTopic(); - document.title = 'JY开源软件仓库'; + document.title = '菌用开源软件仓库'; // 获取总数 getInitCount(); }, []) @@ -47,30 +73,9 @@ function ProjectHomePage(props) { }, [cateID, search, page, topicId]) function getInitCount() { - const obj = { - countByGHM: 20000, - countByOther: 0, - countByGHMType: 10 - } - axios.get(`/organizations/gh_mirrors/projects.json?page=1&limit=15&sort_by=updated_on&sort_direction=desc`).then(result => { - if (result && result.data) { - obj.countByGHM = result.data.total_count || 0 - } - return axios.get(`/projects.json?pinned=d&limit=1`) - }).then(result => { - if (result && result.data) { - obj.countByOther = result.data.total_count - obj.countByGHM - } - }).finally(() => { - // cateTopics && cateTopics[39] && (obj.countByGHMType = cateTopics[39].length) - setCount({ - countByGHM: 20000, - countByOther: obj.countByOther, - countByGHMType: 10, - countByMX: 99, - countByRQ: 10 - }); - }) + fetch('/statsConfig.json').then(r => r.json()).then(res => { + setCount(res) + }); } function getCateTopic() { @@ -128,38 +133,24 @@ function ProjectHomePage(props) { return
    {/* banner区域内容 */}
    -
    开源软件仓库·护航J事数智
    -
    汇聚全球顶尖开源力量,构建安全、协同、创新的软件生态,赋能J事数字化转型与智能化升级
    +
    开源软件仓库·护航菌事数智
    +
    汇聚全球顶尖开源力量,构建安全、协同、创新的软件生态,赋能菌事数字化转型与智能化升级
    -
    -
    -

    {countByOther}+

    - 应用软件 -
    - -
    -

    {countByGHMType}+

    - 三方组件 -
    - -
    -

    {countByGHM}+

    - 数据集 -
    - -
    -

    {countByMX}+

    - 智能模型 -
    - -
    -

    {countByRQ}+

    - 容器镜像 -
    +
    3 ? 'space-between' : 'space-around'}}> + {count.map((item, index)=>{ + const logoIndex = index%5 + return +
    +

    {item.value}

    + {item.name} +
    + {index < count.length-1 && } +
    + })}
    反馈需求,共建优质体验
    -
    欢迎大家随时通过官方渠道提出宝贵建议
    +
    欢迎大家提出宝贵建议或需求反馈
    @@ -197,7 +188,7 @@ function ProjectHomePage(props) {
    }
    {/* 推荐仓库 */} -
    + {bannerProjects && !!bannerProjects.length &&
    {bannerProjects.map(i => { const url = i.author ? `/${i.author.login}/${i.identifier}${i.author.login === "gh_mirrors" ? "/about" : "/about"}` : `` @@ -219,8 +210,8 @@ function ProjectHomePage(props) {
    })} -
    -
    +
    } +
    {topicId && topicDetail && topicDetail.intro && trigger.parentNode} content={ @@ -253,7 +244,7 @@ function ProjectHomePage(props) { return
    {i.lesson_url && } - {!i.lesson_url && } + {/* {!i.lesson_url && } */}
    {i.name}
    {/* 项目标签 */} @@ -268,8 +259,9 @@ function ProjectHomePage(props) { {i.description}
    } */} - {i.author && i.author.login !== "gh_mirrors" && 下载} - + {/* {i.author && i.author.login !== "gh_mirrors" && 下载} */} +
    {i.description}
    +
    })}
    : } diff --git a/src/forge/projectHome/explore/index.scss b/src/forge/projectHome/explore/index.scss index 4c3c4677..34f1b5e3 100644 --- a/src/forge/projectHome/explore/index.scss +++ b/src/forge/projectHome/explore/index.scss @@ -194,11 +194,18 @@ } .author_img { - width: 54px; - height: 54px; + width: 35px; + height: 35px; margin-right: 15px; border-radius: 6px; } + + + .detail-desc{ + position: absolute; + bottom: 10px; + top: 0; + } .download-icon { color: #8284a4; @@ -217,7 +224,8 @@ .detail-but-black { - width: 88%; + line-height: 32px; + width: 85%; color: #ffffff; background-color: #2149d4; border: none; diff --git a/src/forge/projectHome/projectList/index.jsx b/src/forge/projectHome/projectList/index.jsx index 987fa1d6..f86f42b2 100644 --- a/src/forge/projectHome/projectList/index.jsx +++ b/src/forge/projectHome/projectList/index.jsx @@ -83,7 +83,7 @@ function ProjectList() { limit: LIMIT, search: search, page: page, - sort_by: cateID ? undefined : "praises_count", + sort_by: cateID ? undefined : "updated_on", language_id: undefined }; axios.get(url, { params }).then(result => { @@ -179,7 +179,7 @@ function ProjectList() {
    -
    +
    开源项目
    @@ -199,7 +199,7 @@ function ProjectList() { {i.forked_count > 0 ? fork{i.forked_count} : ""}
    -
    +
    {i.description}
    @@ -217,9 +217,9 @@ function ProjectList() {
    { setPage(page) }} className='center mt10' />
    -
    + {projectsListByHot && userList && (!!userList.length || !!projectsListByHot.length) &&
    {/* 热门开发者 */} -
    + {userList && !!userList.length &&
    热门开发者 @@ -230,9 +230,9 @@ function ProjectList() { {user.name}
    })} -
    +
    } {/* 热门项目 */} -
    + {projectsListByHot && !!projectsListByHot.length &&
    热门项目 @@ -252,8 +252,8 @@ function ProjectList() { })} -
    -
    +
    } +
    }
    diff --git a/src/forge/projectHome/projectList/index.scss b/src/forge/projectHome/projectList/index.scss index 205f545f..a4eaff96 100644 --- a/src/forge/projectHome/projectList/index.scss +++ b/src/forge/projectHome/projectList/index.scss @@ -46,7 +46,7 @@ position: absolute; right: 0px; font-size: 16px; - top: 5px; + top: 6px; } } diff --git a/src/forums/api.js b/src/forums/api.js index bc9d0ccb..b9c76d81 100644 --- a/src/forums/api.js +++ b/src/forums/api.js @@ -9,7 +9,7 @@ export function getForumsList(params) { } export function getForumSections(id, params) { return fetch({ - url: `/api/forum_sections/${id}/managements`, + url: `/api/memos/forum_memos_right/${id}.json`, method: 'get', params }); @@ -29,4 +29,43 @@ export function getForumMemoById(id, params) { method: 'get', params }); +} + +export async function getReplyList(id,params) { + return fetch({ + url: `/api/memos/${id}/more_reply.json`, + method: 'get', + params + }); +} +export function postReply(id,data) { + return fetch({ + url: `api/memos/${id}/reply.json`, + method: 'post', + data + }); +} + +export function deleteReply(id) { + return fetch({ + url: `/api/memos/${id}.json`, + method: 'DELETE', + }); +} +export function postPlus(data) { + return fetch({ + url: `/api/memos/${data.id}/plus.json`, + method: 'post', + data + }); +} + +export function setWatch(id,isWatch) { + return fetch({ + url: `/api/memos/${id}/watch_memo.json`, + method: 'post', + data: { + is_watch:isWatch, + }, + }); } \ No newline at end of file diff --git a/src/forums/comments/editComment.jsx b/src/forums/comments/editComment.jsx new file mode 100644 index 00000000..1ccb151b --- /dev/null +++ b/src/forums/comments/editComment.jsx @@ -0,0 +1,167 @@ +import React from 'react'; +import { Button, message } from 'antd'; +import { getImageUrl } from 'educoder'; +import MDEditor from "../../modules/tpm/challengesnew/tpm-md-editor"; +import Upload from "../../forge/Upload/Index"; +import Attachments from "../../forge/Upload/attachment"; +import UploadImg from "../../forge/Images/upload.png"; +import './list.scss'; +import '../../forge/Order/order.scss' +import { useState } from 'react'; +import { Link } from 'react-router-dom'; +import axios from 'axios'; +import { postReply } from '../api'; +// import { addComment, editComment } from '../api' + +function EditComment(props){ + const {owner, projectsId, index} = props.match.params; + const {current_user, current_user:{login}, docId, showNotification, reloadComment, cancelMd, parentId, replyId, updateId, showUserImg=true} = props; + const [content, setContent] = useState(props.content); + const [quillFlag, setQuillFlag] = useState(false); + // 确认评论按钮loading效果 + const [journalSpin, setJournalSpin] = useState(false); + const [atWhoLoginList, setAtWhoLoginList] = useState(undefined); + const [fileList, setFileList] = useState(undefined); + const [attachmentClean, setAttachmentClean] = useState(true); + const [ save , setSave ] = useState(undefined); + + useState(()=>{ + setSave(props.defaultFileList); + },[props.defaultFileList]) + + // 评论点击函数 + function addJournals(){ + if(!content){ + setQuillFlag(true); + return + } + setJournalSpin(true); + console.log(updateId) + if(updateId){ + // 修改评论 + const params = { + id: updateId, + notes: content, + attachmentIds: fileList, + receivers_login:atWhoLoginList + } + // editComment(docId, params).then(res=>{ + // if(res && res.data && res.data.data){ + // // 刷新评论列表 + // reloadComment(); + // message.success('评论成功'); + // cancelMd(); + // setContent(undefined); + // } + // setJournalSpin(false); + // }) + }else{ + // 新建评论 + const params = { + parent_id: replyId || +docId, + content: content, + attachmentIds: fileList, + } + + postReply(docId, params).then(res=>{ + if(res && res.reply){ + // 刷新评论列表 + reloadComment(); + message.success('评论成功'); + cancelMd(); + setContent(undefined); + } + setJournalSpin(false); + }) + } + }; + function deleteLoad(id){ + let arr = []; + let list = save; + if(list && list.length>0 ){ + arr = list.filter(i=>i.id !== id); + } + setFileList(arr.map(i=>{return i.id})); + setSave(arr); + } + function UploadFunc(f){ + let list = []; + let arr = []; + if(save && save.length>0 ){ + arr = save.map(i=>{return i.id}); + } + list = arr && arr.length>0 ? f.concat(arr) : f ; + setFileList(list); + }; + + return( +
    + + + +
    + {setQuillFlag(false);setContent(value);}} + changeAtWhoLoginList = {(loginList)=>{setAtWhoLoginList(loginList); setAttachmentClean(true)}} + owner = {owner} + projectsId = {projectsId} + > +

    + {quillFlag && 请输入评论内容} +

    + {/* + } + size={100} + showNotification={showNotification} + // defaultFileList={props.defaultFileList} + /> + {props.defaultFileList && props.defaultFileList.length > 0 && + + } */} +

    + + +

    +
    +
    + ) +} +export default EditComment; \ No newline at end of file diff --git a/src/forums/comments/list.jsx b/src/forums/comments/list.jsx new file mode 100644 index 00000000..fb8448b1 --- /dev/null +++ b/src/forums/comments/list.jsx @@ -0,0 +1,234 @@ +import React, { useEffect, useState } from 'react'; +import { Button, Popconfirm, Radio, Input, message, Tooltip, Spin, Pagination, Divider } from 'antd'; +import axios from 'axios'; +import { getImageUrl, timeAgo, isPhone } from 'educoder'; +import Attachment from '../../forge/Upload/attachment'; +import EditComment from './editComment'; +import CheckProfile from '../../forge/Component/ProfileModal/Profile'; +import './list.scss'; +import { Link } from 'react-router-dom'; +// import { getCommentList, deleteComment } from '../api' +import RenderHtml from '../../components/render-html'; +import { deleteReply, getReplyList } from '../api'; + +function IssueCommentList(props){ + console.log('props', props); + + const{docId, history: {location}, reload, reloadComment, showNotification, current_user:{login, admin, image_url, username}, isManager, showLoginDialog, author} = props; + const {owner, projectsId, index} = props.match.params; + const [category, setCategory] = useState('comment'); + const [journals, setJournals] = useState(undefined); + // 是否展示新建/编辑评论markdown部分新建评论1 编辑父级评论2 回复评论3 编辑回复内容4 回复子机评论5 + const [showEdit, setShowEdit] = useState(false); + const [parentId, setParentId] = useState(undefined); + const [replyId, setReplyId] = useState(undefined); + // 修改评论id + const [updateId, setUpdateId] = useState(undefined); + // 操作日志展开效果 + const [open, setOpen] = useState(undefined); + // 加载中效果(缓冲css 线条效果) + const [spin, setSpin] = useState(false); + // issue 评论总数 + const [journalsCount, setJournalsCount] = useState(undefined); + // 分页 + const limit = 50; + const [page, setPage] = useState(1); + const [totalCount, setTotalCount] = useState(undefined); + // 操作记录 icon + const journalsIcon ={ + 'issue': 'icon-chuangjianqianbao', + 'branch_name': 'icon-fenzhi3', + 'assigner': 'icon-chengyuan2', + 'status_id': 'icon-xiugaibaobiaomoban', + 'fixed_version_id': 'icon-lichengbeiicon2', + 'due_date': 'icon-riqi', + 'issue_tag': 'icon-biaoji2', + 'description': 'icon-xiugaibaobiaomoban', + 'subject': 'icon-xiugaibaobiaomoban', + 'start_date': 'icon-riqi', + 'priority_id': 'icon-youxian', + 'attachment': 'icon-xiugaibaobiaomoban' + } + + useEffect(()=>{ + setSpin(true); + const params = { + limit: limit, + page: page + } + getReplyList(docId, params).then(res=>{ + console.log('res', res); + + if(res){ + const {memo_replies, memos_count, total_count} = res; + // if(category === 'all'){ + // const array = []; + // let start = undefined; + // let isJournalCount = 0; + // journals.map((item, index)=>{ + // !isJournalCount && (start = index) + // item.is_journal_detail && (isJournalCount++) + // if(!item.is_journal_detail && isJournalCount < 10){ + // isJournalCount = 0; + // return + // } + // if(isJournalCount >= 10 && (!item.is_journal_detail || journals.length-1 === index)){ + // array.push({start, count: isJournalCount}); + // isJournalCount = 0; + // } + // }) + // array.map((item, i)=>{ + // journals[item.start].numCount = item.count-1; + // for (let index = 0; index < item.count; index++) { + // journals[item.start+index].start = journals[item.start].id; + // journals[item.start+index].closeAndSpan = true; + // } + // }) + // } + setJournalsCount(memos_count); + setJournals(memo_replies); + setSpin(false) + } + }) + }, [reload, category, page]) + + function commentCtx(v){ + return ; + }; + + // 删除评论内容 + function deleteCommentFunc(id){ + deleteReply(id).then(res=>{ + if(res && !res.status){ + reloadComment(); + message.success('删除成功'); + } + }) + } + + // markdown 取消操作 + function cancelMd(){ + setShowEdit(false); + } + + return( + (isPhone() && journalsCount === 0) ? '' :
    + {/* 评论 */} +
    0 && 'pb15'}`}> +
    +
    评论{ journalsCount > 0 && `(${ journalsCount })` }
    +
    + +
    + {/* 评论快速入口-仅有评论且登录时展示 */} + {login && category !== 'operate' && journalsCount > 0 && !isPhone() &&
    0 && 'pt15'}`}>
    } + {/* 评论/操作日志 展示列表 */} + +
    + {journals && (journals.length > 0 && journals.map(item=>{return
    + {/* 评论 */} +
    + { + item.user_login ? + + : + + } +
    + {/* 判断是否是编辑状态 */} + {(showEdit === 2 && updateId === item.id) ?
    :
    +
    +
    +
    + {item.user_login ? {item.username}:{item.username}} + {item.time} +
    + {login && !isPhone() &&
    + {/* 平台管理员/仓库管理员/发布评论者/issue创建者 */} + {(admin || isManager || login === item.user_login || username === author) && 0 ? '子评论也将被一起删除。' : ''}`} + okText="是" + cancelText="否" + onConfirm={() => deleteCommentFunc(item.id)} + > + + } + {/* 仅评论者可修改 */} + {/* {login === item.user_login && } */} + {setParentId(item.id); setReplyId(item.id); setShowEdit(3)}}> +
    } +
    +
    {commentCtx(item.content)}
    + {item && item.attachments && item.attachments.length > 0 &&
    } +
    +
    } + {showEdit === 3 && replyId === item.id &&
    } + {/* 评论回复部分 */} + {item.children.map(i =>{ + return
    + {(showEdit === 4 && updateId === i.id) ?
    :
    +
    +
    + + {i.username} + {i.reply_user && 回复} + {i.reply_user && i.reply_user.name} + {i.time} +
    + {login && !isPhone() &&
    + {/* 平台管理员/仓库管理员/发布评论者/回复评论者/issue创建者 */} + {(admin || isManager || login === i.user_login || (i.reply_user && login === i.reply_user_login) || username === author) && deleteCommentFunc(i.id)} + > + + } + {/* 仅回复评论者可修改 */} + {/* {login === i.user_login && } */} + {/* {setParentId(item.id);setReplyId(i.id); setShowEdit(5)}}> + + */} +
    } +
    +
    {commentCtx(i.content)}
    + {i && i.attachments && i.attachments.length > 0 &&
    } +
    } + {showEdit === 5 && replyId === i.id &&
    } +
    })} +
    +
    }))} +
    +
    + {totalCount>limit &&
    + setPage(page)}/> +
    } + {/* 添加评论 */} + {category !== 'operate' && !isPhone() &&
    + {login ? showEdit === 1 ? :
    + +
    + {setShowEdit(1)}}> + + +
    +
    :
    + {/* 未登录用户 */} + {showLoginDialog()}}>登录并参与评论与回复 +
    } +
    } +
    + ) +} +export default IssueCommentList; \ No newline at end of file diff --git a/src/forums/comments/list.scss b/src/forums/comments/list.scss new file mode 100644 index 00000000..0ebac7ee --- /dev/null +++ b/src/forums/comments/list.scss @@ -0,0 +1,274 @@ +.commentListBox_forums { + background-color: #ffffff; + border-radius: 8px; + box-shadow: 0px 2px 6px rgba(35, 44, 121, 0.07); + padding: 25px 30px; + font-family: "alibabaReg"; + color:#091221; + a{ + color:#091221; + } + + .commentUserImg { + height: 28px; + width: 28px; + border-radius: 50%; + object-fit: cover; + } + + .issueCommentsBox { + + .operationLog, + .commentContentBox { + position: relative; + min-height: 62px; + display: flex; + + >.flexCenter, + >a { + z-index: 2; + } + + &::before, + &::after { + content: ''; + width: 1px; + height: 50%; + position: absolute; + background: #eee; + left: 12px; + z-index: 1; + } + + &::after { + background: #eee; + top: 50%; + } + } + + .commentContentBox+.operationLog .operationCommentBor, + .operationLog+.commentContentBox .commentOperationBor { + border-top: 1px solid #eee; + width: 98.5%; + position: absolute; + left: 12px; + } + + .operationLog+.commentContentBox { + + &>a, + &>.commentContentRight { + margin-top: 25px; + } + } + + .operationLog:last-child::after, + .operationLog:first-child::before, + .commentContentBox:last-child::after, + &.justComment .commentContentBox::before, + &.justComment .commentContentBox::after { + display: none; + } + + .operationLog:first-child, + .commentContentBox+.operationLog { + margin-top: -15px; + } + + .commentContentBox:last-child::before { + height: 35%; + } + + .flexCenter { + display: flex; + align-items: center; + justify-content: space-between; + } + + .commentRenderHtml.markdown-body p { + font-size: 14px !important; + } + + .commentReply { + border-radius: 4px; + padding: 15px 0 0 20px; + background-color: rgba(241, 243, 252, 0.55); + + &>div { + padding-bottom: 5px; + } + + &+.commentReply>div { + margin-top: -15px; + padding-top: 15px; + border-top: 1px dashed #eee; + } + } + + .opBox { + justify-content: flex-start; + // flex: 1; + // width: 100%; + } + + .commentContentBox { + display: flex; + align-items: flex-start; + } + + .commentContentRight { + flex: 1; + width: 0; + // background-color: #fafafc; + // border: 1px solid rgba(42, 97, 255, 0.23); + // border-radius: 6px; + // position: relative; + // top: -6px; + // padding: 10px 15px 16px; + + // &::before { + // content: ''; + // display: block; + // position: absolute; + // top: 13px; + // left: -14px; + // width: 0; + // height: 0; + // overflow: hidden; + // font-size: 0; + // line-height: 0; + // border: 7px; + // border-style: solid; + // border-color: transparent rgba(42, 97, 255, 0.23) transparent transparent; + // } + + // &::after { + // content: ''; + // display: block; + // width: 0; + // height: 0; + // overflow: hidden; + // font-size: 0; + // line-height: 0; + // border: 6px; + // border-style: solid; + // border-color: transparent #fafafc transparent transparent; + // position: absolute; + // top: 14px; + // left: -11px; + // } + } + } + + .attachmentBox { + margin-top: -8px; + } + + .color-grey-89 { + color: #898d9d; + // &:hover { + // color: #466aff; + // } + } + .color-grey-09{ + background-color:#F7F7F8; + border-radius:4px; + color:#091221; + padding: 0; + width:44px; + height:26px; + list-style: 26px; + } + + // 添加评论样式 + .unLoginComment { + height: 58px; + line-height: 58px; + background-color: #F6F7FF; + border-radius: 4px; + color: rgba(84, 87, 103, 1); + + .loginBtn { + color: #466aff; + } + } + + .quillFlagBox { + color: red; + margin-bottom: 5px !important; + height: 28px; + } + + .addComments { + display: flex; + align-items: center; + background-color: #F6F7FF; + border-radius: 4px; + padding: 7px 10px; + + &>img { + height: 28px; + width: 28px; + border-radius: 50%; + margin-right: 13px; + } + } + + .addCommentBox { + width: 100%; + height: 30px; + border: none; + + &:focus { + border-color: #466aff !important; + } + } + + .paginationIssueComment { + text-align: center; + } + + .gotoComment { + // background-color:#1A47FF; + background-color: rgba(241, 243, 252, 0.55); + border-radius: 4px; + color: rgba(172, 176, 191, 1); + padding: 8px 20px; + margin-top: -10px; + + &>a { + color: #466aff; + } + } + + // .commentStyle { + // &:hover { + // border-color: #466aff !important; + // } + // } + .colorButton { + background-color: #466aff; + border-color: #466aff; + + &:hover { + background-color: #1A47FF; + border-color: #466aff; + } + + &:focus { + background-color: #466aff; + border-color: #466aff; + } + } + + .colorButton2 { + &:hover { + border-color: #466aff; + color: #1A47FF; + } + + &:focus { + color: #466aff; + } + } +} \ No newline at end of file diff --git a/src/forums/detail/index.jsx b/src/forums/detail/index.jsx index aeeee8c4..69c33114 100644 --- a/src/forums/detail/index.jsx +++ b/src/forums/detail/index.jsx @@ -1,72 +1,100 @@ import React, { useEffect, useState } from "react"; import './index.scss'; -import { getForumMemoById } from "../api"; -import { Divider, Tag } from "antd"; +import { getForumMemoById, postPlus, setWatch } from "../api"; +import { Divider, message, Tag } from "antd"; import icon12 from '../image/icon12.png'; import icon6 from '../image/icon6.png'; import icon10 from '../image/icon10.png'; import RenderHtml from "../../components/render-html"; import Nodata from "../../forge/Nodata"; import { BrowserRouter as Router, Route, Link } from "react-router-dom"; +import CommentList from '../comments/list' +import { httpUrl } from "../fetch"; function detail(props) { - console.log('props', props); - const { match: { params: { id } } } = props; + const { match: { params: { id } }, current_user } = props; + const [reload, setReload] = useState(undefined); const [detail, setDetail] = useState(undefined); - const { memo = {}, author_info = {}, recent_memos=[] } = detail || {}; + const [commentReload, setCommentReload] = useState(undefined); + const { memo = {}, author_info = {}, recent_memos=[], memo_image_info } = detail || {}; useEffect(() => { id && getForumMemoById(id).then(res => { - console.log('res', res); setDetail(res); document.title = `${res.memo.subject}-论坛交流`; }) - }, [id]) + }, [id, reload]) const actions = [ { - id: 'add', + id: 'praises', title: '点赞', // icon: require('../image/likes.png').default, - key: 'praises_count' + key: 'praises_count', + memoKey: 'user_praise' }, { - id: 'edit', + id: 'watcher', title: '收藏', icon: require('../image/icon11.png'), - key: 'watchers_count' + key: 'watchers_count', + memoKey: 'memo_watched' }, { - id: 'delete', + id: 'reply', title: '评论', icon: require('../image/icon13.png'), key: 'replies_count' }, { - id: 'delete', + id: 'view', title: '浏览数', icon: icon12, key: 'viewed_count' } ] + + function actionClick(item){ + const {memoKey} = item; + if(memoKey === "user_praise"){ + postPlus({ + container_type: "Memo", + id: id, + type: memo[item.memoKey] ? 0 : 1, + }).then(res=>{ + if(res){ + message.success("操作成功"); + setReload(Math.random()); + } + }) + }else if(memoKey === "memo_watched"){ + setWatch(id, memo[item.memoKey] ? 0 : 1).then(res=>{ + if(res){ + message.success("操作成功"); + setReload(Math.random()); + } + }) + } + } + return (
    论坛交流 {memo.subject}
    -
    +
    {/* 左侧操作区 */}
    {actions.map((item, index) => ( - + {actionClick(item)}}> {item.icon ? : } - {memo[item.key]} + {memo[item.key]} ))}
    @@ -75,7 +103,7 @@ function detail(props) {
    {memo.is_original && 原创}
    - 【{memo.tag_name}】 + 【{memo.tag_name}】 {memo.subject} {memo.sticky && 置顶} {memo.is_fine && 精华} @@ -86,13 +114,18 @@ function detail(props) { {memo.published_time} {memo.viewed_count} - + {memo.replies_count}
    - {memo.content ? : } + {memo_image_info && memo_image_info.url && {memo.subject}} + {memo.content ? : } + {memo.attachment_url && !!memo.attachment_url.length && memo.attachment_url.map(attachment=>{ + return + })}
    {/* 评论 */} + { setCommentReload(Math.random()); setReload(Math.random()); }} />
    {/* 右侧 */} @@ -125,7 +158,9 @@ function detail(props) {
    {index+1} -

    {item.subject}

    + + {item.subject} + {index === 0 && new}
    diff --git a/src/forums/detail/index.scss b/src/forums/detail/index.scss index 6da3d035..915c0d89 100644 --- a/src/forums/detail/index.scss +++ b/src/forums/detail/index.scss @@ -28,7 +28,7 @@ background-color:#ffffff; box-shadow:0px 0px 10px rgba(35, 44, 121, 0.06); justify-content: center; - .action-fo-icon.add{ + .action-fo-icon.praises{ display: inline-block; width: 32px; height: 32px; @@ -60,6 +60,10 @@ opacity: 0.8; position: relative; top: -12px; + &.active{ + background-color:#2149d4; + color: white; + } } } .forums-detail-content{ @@ -84,6 +88,12 @@ background-color: #E9A69D; margin-right: 10px; } + .forums-detail-content-headImg{ + max-width: 80%; + } + img:not(.forums-detail-content-headImg){ + max-width: 100%; + } } .forums-detail-right{ width: 21%; @@ -93,7 +103,7 @@ max-width: 100%; } .user-img{ - background-color: #F7F7F7; + // background-color: #F7F7F7; border-radius: 50%; width:61px; height:61px; diff --git a/src/forums/fetch.js b/src/forums/fetch.js index c9b14515..e96c99bc 100644 --- a/src/forums/fetch.js +++ b/src/forums/fetch.js @@ -1,10 +1,7 @@ import javaFetch from '../forge/javaFetch'; let settings = localStorage && localStorage.chromesetting && localStorage.chromesetting !=="undefined" && JSON.parse(localStorage.chromesetting); -console.log('settings', settings); - -// let actionUrl = settings && settings.main_web_site_url; -let actionUrl = 'http://172.20.32.203:4001'; +let actionUrl = (settings && settings.common.forums) || 'http://172.20.32.203:4001'; const service = javaFetch(actionUrl); export const httpUrl = actionUrl; diff --git a/src/forums/list/index.jsx b/src/forums/list/index.jsx index 1b6b3a4a..9b420d82 100644 --- a/src/forums/list/index.jsx +++ b/src/forums/list/index.jsx @@ -1,25 +1,34 @@ import React, { useEffect, useState } from "react"; import './index.scss'; -import { Button, Divider, Tag } from "antd"; +import { Button, Carousel, Divider, Pagination, Tag } from "antd"; import { getForumsById, getForumSections, getForumsList } from "../api"; import { httpUrl } from "../fetch"; -import { getImageUrl, timeAgo } from 'educoder'; import { BrowserRouter as Router, Route, Link } from "react-router-dom"; import icon5 from '../image/icon5.png'; import icon6 from '../image/icon6.png'; import icon10 from '../image/icon10.png'; import Nodata from "../../forge/Nodata"; +import { forumSectionId } from "../static"; -function List() { +function List(props) { + const {mygetHelmetapi} = props; + const {common} = mygetHelmetapi || {}; + const {forums: forumsDoMain} = common || {}; const [forumsList, setForumsList] = useState([]); + const [forumsImgList, setForumsImgList] = useState([]); const [hottestForumsList, setHottestForumsList] = useState([]); // 板块信息 const [forumTag, setForumTag] = useState([]); // 选中的板块详情 const [forumTagDetail, setForumTagDetail] = useState(undefined); // 选中的板块对应的帖子列表 + const LIMIT = 10; + const [total, setTotal] = useState(0); + const [page, setPage] = useState(1); const [forumListByTag, setForumListByTag] = useState([]); - console.log('forumListByTag', forumListByTag); + // 轮播的active + const [activeId, setActiveId] = useState(0); + const sortImg1 = { 0: require('../image/icon7.png'), @@ -32,25 +41,27 @@ function List() { 2: require('../image/icon4.png'), } - useEffect(() => { document.title = '论坛交流'; getForumsList({ page: 1, - limit: 10, + limit: 6, sort: 'published_at', + homepage_show: true }).then(res => { if (res) { setForumsList(res.memos || []); + const imageList = res.memos.filter(item=>!!item.memo_image_info) + setForumsImgList(imageList) setHottestForumsList(res.hottest_memos || []); } }) - getForumSections(4).then(res => { - if (res && res.forum_tag) { + getForumSections(forumSectionId).then(res => { + if (res && res.recommend_forum_sections) { // 获取所有子板块 - const childrenTags = res.forum_tag.children_tags; + const childrenTags = res.recommend_forum_sections; // 并发请求所有板块的精华帖子 const fetchEssencePosts = async (tag) => { @@ -98,18 +109,19 @@ function List() { if (forumTagDetail && forumTagDetail.id) { const forums = forumTagDetail.essencePosts[0] || {} getForumsById(forumTagDetail.id, { - page: 1, - limit: 10, + page: page, + limit: LIMIT, sort: 'published_at', select_type: 'all', hide_id: forums.id }).then(res => { if (res) { setForumListByTag(res.memos || []); + setTotal(res.memos_count); } }) } - }, [forumTagDetail && forumTagDetail.id]) + }, [forumTagDetail && forumTagDetail.id, page]) return (
    @@ -117,15 +129,17 @@ function List() {
    论坛交流·解锁头脑风暴
    开源动态,社区前言新闻速递,开启开源新视野
    - + {forumsDoMain && }
    -
    - {forumsList[0] && forumsList[0].memo_image_info && } -
    + {forumsImgList && !!forumsImgList.length && {setActiveId(nextId)}}> + {forumsImgList.map((item, index)=>{ + return + })} + }
    - {forumsList.slice(0,6).map((item, index) => ( -
    + {forumsList.map((item, index) => ( +
    {item.subject} {index === 0 && new} @@ -154,7 +168,7 @@ function List() {
    -
    XXX论坛
    +
    精华论坛
    {/* 四个板块 */}
    @@ -162,26 +176,25 @@ function List() { const isSelected = forumTagDetail && forumTagDetail.id === item.id; const forums = item.essencePosts[0] || {}; return ( -
    {setForumTagDetail(item)}}> -
    {item.title}
    +
    {setForumTagDetail(item)}}> +
    {forums.memo_image_info && }
    - -
    {forums.subject}
    - - + {setForumTagDetail(item)}} className="AlignCenter pt10 pb10"> +
    {item.title}
    +
    {forums.username}
    -
    + {/*
    {forums.praises_count} {forums.replies_count} {forums.published_time} -
    +
    */}
    @@ -190,11 +203,12 @@ function List() {
    {/* 板块对应的帖子列表 */}
    - {forumListByTag.map((item, index) => ( -
    -
    - {index < 3 ? : {index + 1}} - {item.subject} + {forumListByTag.map((item, index) => { + const orderIndex = index+LIMIT*(page-1) + return
    +
    + {orderIndex < 3 ? : {orderIndex + 1}} + {item.subject} {item.sticky && 置顶} {item.is_original && 原创} {item.is_fine && 精华} @@ -214,10 +228,11 @@ function List() { {item.viewed_count}
    - ))} + })} {forumListByTag.length === 0 && ( -)} + )} + { setPage(page) }} className='center mt30' />
    diff --git a/src/forums/list/index.scss b/src/forums/list/index.scss index 6bf31155..171648f2 100644 --- a/src/forums/list/index.scss +++ b/src/forums/list/index.scss @@ -32,8 +32,8 @@ border-radius: 30px; background-color: #091221; border: 4px solid #CCD3E8; - height: 60px; - padding: 0px 53px; + padding: 16px 53px; + display: inline; // &:hover { // border: 1px solid; @@ -41,13 +41,15 @@ // } } - .first-img { + .ant-carousel{ width: 48.3%; - background-color: #CCD3E8; border-radius: 15px 0px 0px 15px; - + overflow: hidden; + } + .forums-list-left-Carousel { img { - max-width: 100%; + height: 392px; + object-fit: cover; } } @@ -79,20 +81,23 @@ } } - .forums-list-item:not(:last-of-type) { + .forums-list-item:not(:last-of-type):not(.forums-list-item-active) { .forums-subject { border-bottom: 1px dashed rgba(130, 132, 164, 0.4); } } - .forums-list-item:hover { + .forums-list-item:hover, .forums-list-item-active { background-color: #f7f9fd; border-radius: 10px; font-weight: bold; .forums-subject { - border-bottom: none; + border-bottom-color: transparent !important; + } + .ant-tag{ + font-weight: normal; } } @@ -113,7 +118,7 @@ width:24px; height:24px; border-radius: 50%; - background-color: #E9A69D; + // background-color: #E9A69D; margin-right: 10px; } .forums-section-box{ @@ -133,8 +138,10 @@ color: white; } } - img{ - max-width: 100%; + .memo_image_info{ + width: 100%; + height: 160px; + object-fit: cover; border-radius: 15px 15px 0 0; transition: transform .4s cubic-bezier(.25, .46, .45, .94); } @@ -197,6 +204,7 @@ display: none; } &:hover{ + padding-right: 20px; color:#2149d4; .icon-jiantou3{ display: inline-block; diff --git a/src/forums/static.js b/src/forums/static.js new file mode 100644 index 00000000..39566c4a --- /dev/null +++ b/src/forums/static.js @@ -0,0 +1,2 @@ +// 论坛首页,下面四个分论坛对应的一级板块id +export const forumSectionId = 4 \ No newline at end of file diff --git a/src/images/icon_arrow.png b/src/images/icon_arrow.png new file mode 100644 index 00000000..5b8b2d2a Binary files /dev/null and b/src/images/icon_arrow.png differ diff --git a/src/images/icon_arrow_white.png b/src/images/icon_arrow_white.png new file mode 100644 index 00000000..c4fa9208 Binary files /dev/null and b/src/images/icon_arrow_white.png differ diff --git a/src/news/detail/index.jsx b/src/news/detail/index.jsx index 76e6266f..c15a6c6b 100644 --- a/src/news/detail/index.jsx +++ b/src/news/detail/index.jsx @@ -10,7 +10,6 @@ import { getNewsDetail, getSubDocList } from "../../forge/Information/api"; import CommentList from "../../forge/Information/Component/comments/list"; function detail(props) { - console.log('props', props); const { match: { params: { id } } } = props; const [detail, setDetail] = useState({}); const [list1, setList1] = useState([]); diff --git a/src/news/image/bk3.png b/src/news/image/bk3.png index 8921895f..6867bf08 100644 Binary files a/src/news/image/bk3.png and b/src/news/image/bk3.png differ diff --git a/src/news/image/bk8.png b/src/news/image/bk8.png new file mode 100644 index 00000000..0a63b24a Binary files /dev/null and b/src/news/image/bk8.png differ diff --git a/src/news/image/icon13.png b/src/news/image/icon13.png new file mode 100644 index 00000000..9dc5ee01 Binary files /dev/null and b/src/news/image/icon13.png differ diff --git a/src/news/image/icon14.png b/src/news/image/icon14.png new file mode 100644 index 00000000..d81e4206 Binary files /dev/null and b/src/news/image/icon14.png differ diff --git a/src/news/list/index.jsx b/src/news/list/index.jsx index 6fd40806..481a5886 100644 --- a/src/news/list/index.jsx +++ b/src/news/list/index.jsx @@ -2,18 +2,20 @@ import React, { useEffect, useState } from "react"; import { getNewsDetail, getSubDocList } from "../../forge/Information/api"; import { getImageUrl, timeAgo } from "educoder"; import { BrowserRouter as Router, Route, Link } from "react-router-dom"; -import { Button } from "antd"; +import { Badge, Button } from "antd"; import "./index.scss"; import moment from "moment"; import RenderHtml from "../../components/render-html"; import icon2 from '../image/icon2.png' +import icon13 from '../image/icon13.png' +import icon14 from '../image/icon14.png' function List() { const [list1, setList1] = useState([]); const [list2, setList2] = useState([]); const [firstActivity, setFirstActivity] = useState(undefined); const [list3, setList3] = useState([]); - const firstDynamics = list3[0] + const firstDynamics = list3.slice(0,2); useEffect(() => { document.title = "社区动态"; @@ -38,7 +40,7 @@ function List() { }) } }) - getSubDocList(39).then(res => { + getSubDocList(39, {orderByColumn: "publishTime", isAsc: 'desc'}).then(res => { if (res && res.data.rows) { let rows = res.data.rows; setList3(rows); @@ -79,7 +81,10 @@ function List() {
    {list1.slice(4).map(item => { - return {item.name} + return + + {item.name} + })}
    @@ -97,9 +102,9 @@ function List() { {list2.slice(1, 6).map(item=>{ return
    -
    +
    {item.name} -
    {item.summary}
    +
    {item.summary}
    @@ -111,19 +116,23 @@ function List() {
    项目动态
    - {firstDynamics &&
    -
    {firstDynamics.name}
    -
    {firstDynamics.summary}
    - {/* */} + {firstDynamics && firstDynamics.length &&
    + {firstDynamics.map((item, index)=>{ + return
    + +
    {item.name}
    +
    {item.summary}
    +
    + })}
    }
    - {list3.slice(1, 9).map(item=>{ + {list3.slice(2, 10).map(item=>{ return
    - {item.name} - {moment(item.publishTime).format('YYYY-MM-DD')} + {item.name} + {moment(item.publishTime).format('YYYY-MM-DD')}
    -
    {item.summary}
    +
    {item.summary}
    }) } diff --git a/src/news/list/index.scss b/src/news/list/index.scss index 9e00887d..93844d64 100644 --- a/src/news/list/index.scss +++ b/src/news/list/index.scss @@ -89,7 +89,7 @@ box-shadow:0px 0px 6px rgba(92, 102, 193, 0.05); display: grid; grid-template-columns: repeat(2, 1fr); - gap: 6px 30px; + gap: 12px 30px; } } .first-activity{ @@ -112,6 +112,25 @@ margin-right: 20px; width: 25%; min-height: 420px; + flex-shrink: 0; +} +.firstDynamics-box{ + margin-right: 20px; + width: 25%; + flex-shrink: 0; + display: flex; + flex-direction: column; + gap: 20px; + justify-content: space-between; +} +.firstDynamics-item{ + border-radius: 10px; + padding: 20px 15px; + background-image: url('../image/bk3.png'); + background-size: 100% 100%; + &:nth-child(2){ + background-image: url('../image/bk8.png'); + } } .dynamics-box{ background-image:linear-gradient(179.88deg,#ffffff 0%,rgba(255, 255, 255, 0.62) 16.1%,rgba(255, 255, 255, 0) 100%); @@ -129,7 +148,7 @@ background-repeat: no-repeat; background-position: right center; background-size: auto 100%; - align-content: start; + align-content: space-between; } .activities-box{ background-image: url('../image/bk6.png'); @@ -147,4 +166,10 @@ height: 155px; } } + .activity-item-home-content-box{ + display: flex; + flex-direction: column; + align-items: flex-start; + justify-content: space-between; + } } \ No newline at end of file