diff --git a/public/css/gitlink.min.css b/public/css/gitlink.min.css index f0908d1c5..0d322e0c8 100644 --- a/public/css/gitlink.min.css +++ b/public/css/gitlink.min.css @@ -1462,6 +1462,10 @@ a.decoration { font-weight: 400 } +.margin0-auto { + margin: 0 auto; +} + .mt1 { margin-top: 1px } diff --git a/public/css/iconfont.css b/public/css/iconfont.css index f877beb85..9518a831c 100644 --- a/public/css/iconfont.css +++ b/public/css/iconfont.css @@ -1,8 +1,8 @@ @font-face { font-family: "iconfont"; /* Project id 2340181 */ - src: url('iconfont.woff2?t=1727340588188') format('woff2'), - url('iconfont.woff?t=1727340588188') format('woff'), - url('iconfont.ttf?t=1727340588188') format('truetype'); + src: url('iconfont.woff2?t=1757896728868') format('woff2'), + url('iconfont.woff?t=1757896728868') format('woff'), + url('iconfont.ttf?t=1757896728868') format('truetype'); } .iconfont { @@ -13,6 +13,194 @@ -moz-osx-font-smoothing: grayscale; } +.icon-tufaxingzhongdasuanlixuqiuyingjixiangying:before { + content: "\e9a0"; +} + +.icon-kuazhongxinxietongkeyanjisuanrenwutiaodu:before { + content: "\e9a1"; +} + +.icon-xingnengjizhunyupingce:before { + content: "\e9a8"; +} + +.icon-jiantou3:before { + content: "\e9a5"; +} + +.icon-jiantou21:before { + content: "\e9a6"; +} + +.icon-a-xiazai1:before { + content: "\e9a7"; +} + +.icon-binghangjisuankuangjia:before { + content: "\e9aa"; +} + +.icon-shouqi:before { + content: "\e99f"; +} + +.icon-zhankai1:before { + content: "\e9a2"; +} + +.icon-renwutiaoduguanli:before { + content: "\e9a3"; +} + +.icon-yigoushujuku:before { + content: "\e9a4"; +} + +.icon-shequissue:before { + content: "\e99c"; +} + +.icon-shequ-xuanzhong:before { + content: "\e99d"; +} + +.icon-shequ1:before { + content: "\e99e"; +} + +.icon-huanjingbianliang:before { + content: "\e99b"; +} + +.icon-liuliangkongzhi:before { + content: "\e991"; +} + +.icon-tingzhi:before { + content: "\e993"; +} + +.icon-qiangzhitingzhi:before { + content: "\e995"; +} + +.icon-zanting1:before { + content: "\e99a"; +} + +.icon-qidong1:before { + content: "\e996"; +} + +.icon-guanlianpeizhi:before { + content: "\e994"; +} + +.icon-shanchu9:before { + content: "\e997"; +} + +.icon-bianjipeizhi:before { + content: "\e998"; +} + +.icon-shilizhuce:before { + content: "\e999"; +} + +.icon-wangguanguanli:before { + content: "\e98d"; +} + +.icon-xiazaiYAML:before { + content: "\e98f"; +} + +.icon-huifu2:before { + content: "\e990"; +} + +.icon-zhongqi:before { + content: "\e992"; +} + +.icon-lianluzhuizong1:before { + content: "\e98e"; +} + +.icon-yincang3:before { + content: "\e986"; +} + +.icon-shoujihao:before { + content: "\e987"; +} + +.icon-xianshi1:before { + content: "\e988"; +} + +.icon-mima:before { + content: "\e989"; +} + +.icon-paixu:before { + content: "\e98a"; +} + +.icon-jiantou_xiangyou:before { + content: "\e98b"; +} + +.icon-a-fork1:before { + content: "\e98c"; +} + +.icon-dianzan1:before { + content: "\e983"; +} + +.icon-yonghuming:before { + content: "\e984"; +} + +.icon-youxiang2:before { + content: "\e985"; +} + +.icon-tongzhi1:before { + content: "\e981"; +} + +.icon-xinzeng:before { + content: "\e982"; +} + +.icon-a-fenzhi1:before { + content: "\e980"; +} + +.icon-yunxiazai:before { + content: "\e97b"; +} + +.icon-lunwen1:before { + content: "\e97c"; +} + +.icon-zhuanli2:before { + content: "\e97d"; +} + +.icon-jiantou2:before { + content: "\e97e"; +} + +.icon-jiantou-you-cuxiantiao:before { + content: "\e97f"; +} + .icon-gongxianquequan:before { content: "\e979"; } diff --git a/public/css/iconfont.js b/public/css/iconfont.js index 433c5d5f1..e8e3aa48a 100644 --- a/public/css/iconfont.js +++ b/public/css/iconfont.js @@ -1 +1 @@ -window._iconfont_svg_string_2340181='',(c=>{var a=(l=(l=document.getElementsByTagName("script"))[l.length-1]).getAttribute("data-injectcss"),l=l.getAttribute("data-disable-injectsvg");if(!l){var h,i,o,z,t,p=function(a,l){l.parentNode.insertBefore(a,l)};if(a&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(a){console&&console.log(a)}}h=function(){var a,l=document.createElement("div");l.innerHTML=c._iconfont_svg_string_2340181,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(a=document.body).firstChild?p(l,a.firstChild):a.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),h()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(o=h,z=c.document,t=!1,m(),z.onreadystatechange=function(){"complete"==z.readyState&&(z.onreadystatechange=null,v())})}function v(){t||(t=!0,o())}function m(){try{z.documentElement.doScroll("left")}catch(a){return void setTimeout(m,50)}v()}})(window); \ No newline at end of file +window._iconfont_svg_string_2340181='',(c=>{var a=(l=(l=document.getElementsByTagName("script"))[l.length-1]).getAttribute("data-injectcss"),l=l.getAttribute("data-disable-injectsvg");if(!l){var h,i,o,z,t,p=function(a,l){l.parentNode.insertBefore(a,l)};if(a&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(a){console&&console.log(a)}}h=function(){var a,l=document.createElement("div");l.innerHTML=c._iconfont_svg_string_2340181,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(a=document.body).firstChild?p(l,a.firstChild):a.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),h()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(o=h,z=c.document,t=!1,m(),z.onreadystatechange=function(){"complete"==z.readyState&&(z.onreadystatechange=null,v())})}function v(){t||(t=!0,o())}function m(){try{z.documentElement.doScroll("left")}catch(a){return void setTimeout(m,50)}v()}})(window); \ No newline at end of file diff --git a/public/css/iconfont.json b/public/css/iconfont.json index 4ebfc428b..f7322132b 100644 --- a/public/css/iconfont.json +++ b/public/css/iconfont.json @@ -5,6 +5,335 @@ "css_prefix_text": "icon-", "description": "", "glyphs": [ + { + "icon_id": "45509718", + "name": "突发性重大算力需求应急响应", + "font_class": "tufaxingzhongdasuanlixuqiuyingjixiangying", + "unicode": "e9a0", + "unicode_decimal": 59808 + }, + { + "icon_id": "45509716", + "name": "跨中心协同科研计算任务调度", + "font_class": "kuazhongxinxietongkeyanjisuanrenwutiaodu", + "unicode": "e9a1", + "unicode_decimal": 59809 + }, + { + "icon_id": "45509717", + "name": "性能基准与评测", + "font_class": "xingnengjizhunyupingce", + "unicode": "e9a8", + "unicode_decimal": 59816 + }, + { + "icon_id": "45509657", + "name": "箭头", + "font_class": "jiantou3", + "unicode": "e9a5", + "unicode_decimal": 59813 + }, + { + "icon_id": "45509658", + "name": "箭头2", + "font_class": "jiantou21", + "unicode": "e9a6", + "unicode_decimal": 59814 + }, + { + "icon_id": "45509659", + "name": "下载 (1)", + "font_class": "a-xiazai1", + "unicode": "e9a7", + "unicode_decimal": 59815 + }, + { + "icon_id": "45509654", + "name": "并行计算框架", + "font_class": "binghangjisuankuangjia", + "unicode": "e9aa", + "unicode_decimal": 59818 + }, + { + "icon_id": "45509663", + "name": "收起", + "font_class": "shouqi", + "unicode": "e99f", + "unicode_decimal": 59807 + }, + { + "icon_id": "45509660", + "name": "展开", + "font_class": "zhankai1", + "unicode": "e9a2", + "unicode_decimal": 59810 + }, + { + "icon_id": "45509661", + "name": "任务调度管理", + "font_class": "renwutiaoduguanli", + "unicode": "e9a3", + "unicode_decimal": 59811 + }, + { + "icon_id": "45509664", + "name": "异构数据库", + "font_class": "yigoushujuku", + "unicode": "e9a4", + "unicode_decimal": 59812 + }, + { + "icon_id": "45229517", + "name": "社区issue", + "font_class": "shequissue", + "unicode": "e99c", + "unicode_decimal": 59804 + }, + { + "icon_id": "45229516", + "name": "社区-选中", + "font_class": "shequ-xuanzhong", + "unicode": "e99d", + "unicode_decimal": 59805 + }, + { + "icon_id": "45229515", + "name": "社区", + "font_class": "shequ1", + "unicode": "e99e", + "unicode_decimal": 59806 + }, + { + "icon_id": "44951992", + "name": "环境变量", + "font_class": "huanjingbianliang", + "unicode": "e99b", + "unicode_decimal": 59803 + }, + { + "icon_id": "44779010", + "name": "流量控制", + "font_class": "liuliangkongzhi", + "unicode": "e991", + "unicode_decimal": 59793 + }, + { + "icon_id": "44779009", + "name": "停止", + "font_class": "tingzhi", + "unicode": "e993", + "unicode_decimal": 59795 + }, + { + "icon_id": "44779008", + "name": "强制停止", + "font_class": "qiangzhitingzhi", + "unicode": "e995", + "unicode_decimal": 59797 + }, + { + "icon_id": "44779007", + "name": "暂停", + "font_class": "zanting1", + "unicode": "e99a", + "unicode_decimal": 59802 + }, + { + "icon_id": "44778800", + "name": "启动", + "font_class": "qidong1", + "unicode": "e996", + "unicode_decimal": 59798 + }, + { + "icon_id": "44778675", + "name": "关联配置", + "font_class": "guanlianpeizhi", + "unicode": "e994", + "unicode_decimal": 59796 + }, + { + "icon_id": "44778677", + "name": "删除", + "font_class": "shanchu9", + "unicode": "e997", + "unicode_decimal": 59799 + }, + { + "icon_id": "44778671", + "name": "编辑配置", + "font_class": "bianjipeizhi", + "unicode": "e998", + "unicode_decimal": 59800 + }, + { + "icon_id": "44778674", + "name": "实例注册", + "font_class": "shilizhuce", + "unicode": "e999", + "unicode_decimal": 59801 + }, + { + "icon_id": "44778684", + "name": "网关管理", + "font_class": "wangguanguanli", + "unicode": "e98d", + "unicode_decimal": 59789 + }, + { + "icon_id": "44778683", + "name": "下载YAML", + "font_class": "xiazaiYAML", + "unicode": "e98f", + "unicode_decimal": 59791 + }, + { + "icon_id": "44778682", + "name": "恢复", + "font_class": "huifu2", + "unicode": "e990", + "unicode_decimal": 59792 + }, + { + "icon_id": "44778681", + "name": "重启", + "font_class": "zhongqi", + "unicode": "e992", + "unicode_decimal": 59794 + }, + { + "icon_id": "44778292", + "name": "链路追踪", + "font_class": "lianluzhuizong1", + "unicode": "e98e", + "unicode_decimal": 59790 + }, + { + "icon_id": "43884585", + "name": "隐藏", + "font_class": "yincang3", + "unicode": "e986", + "unicode_decimal": 59782 + }, + { + "icon_id": "43884586", + "name": "手机号", + "font_class": "shoujihao", + "unicode": "e987", + "unicode_decimal": 59783 + }, + { + "icon_id": "43884583", + "name": "显示", + "font_class": "xianshi1", + "unicode": "e988", + "unicode_decimal": 59784 + }, + { + "icon_id": "43884584", + "name": "密码", + "font_class": "mima", + "unicode": "e989", + "unicode_decimal": 59785 + }, + { + "icon_id": "43884582", + "name": "排序", + "font_class": "paixu", + "unicode": "e98a", + "unicode_decimal": 59786 + }, + { + "icon_id": "43884581", + "name": "箭头_向右", + "font_class": "jiantou_xiangyou", + "unicode": "e98b", + "unicode_decimal": 59787 + }, + { + "icon_id": "43884580", + "name": "fork (1)", + "font_class": "a-fork1", + "unicode": "e98c", + "unicode_decimal": 59788 + }, + { + "icon_id": "43884589", + "name": "点赞", + "font_class": "dianzan1", + "unicode": "e983", + "unicode_decimal": 59779 + }, + { + "icon_id": "43884587", + "name": "用户名", + "font_class": "yonghuming", + "unicode": "e984", + "unicode_decimal": 59780 + }, + { + "icon_id": "43884588", + "name": "邮箱", + "font_class": "youxiang2", + "unicode": "e985", + "unicode_decimal": 59781 + }, + { + "icon_id": "43788877", + "name": "通知", + "font_class": "tongzhi1", + "unicode": "e981", + "unicode_decimal": 59777 + }, + { + "icon_id": "43788876", + "name": "新增", + "font_class": "xinzeng", + "unicode": "e982", + "unicode_decimal": 59778 + }, + { + "icon_id": "39410543", + "name": "分支 (1)", + "font_class": "a-fenzhi1", + "unicode": "e980", + "unicode_decimal": 59776 + }, + { + "icon_id": "42234576", + "name": "云下载", + "font_class": "yunxiazai", + "unicode": "e97b", + "unicode_decimal": 59771 + }, + { + "icon_id": "42234575", + "name": "论文", + "font_class": "lunwen1", + "unicode": "e97c", + "unicode_decimal": 59772 + }, + { + "icon_id": "42234574", + "name": "专利", + "font_class": "zhuanli2", + "unicode": "e97d", + "unicode_decimal": 59773 + }, + { + "icon_id": "42234573", + "name": "箭头", + "font_class": "jiantou2", + "unicode": "e97e", + "unicode_decimal": 59774 + }, + { + "icon_id": "42234572", + "name": "箭头-右-粗线条", + "font_class": "jiantou-you-cuxiantiao", + "unicode": "e97f", + "unicode_decimal": 59775 + }, { "icon_id": "41876673", "name": "贡献确权", diff --git a/public/css/iconfont.ttf b/public/css/iconfont.ttf index 30b005296..bb7ff74ad 100644 Binary files a/public/css/iconfont.ttf and b/public/css/iconfont.ttf differ diff --git a/public/css/iconfont.woff b/public/css/iconfont.woff index fad2a7bab..0e4b1416b 100644 Binary files a/public/css/iconfont.woff and b/public/css/iconfont.woff differ diff --git a/public/css/iconfont.woff2 b/public/css/iconfont.woff2 index d8eab05f1..56a4f7b7c 100644 Binary files a/public/css/iconfont.woff2 and b/public/css/iconfont.woff2 differ diff --git a/src/forge/Information/Component/publicBanner.jsx b/src/forge/Information/Component/publicBanner.jsx index ce8c6960f..9bd3e1c35 100644 --- a/src/forge/Information/Component/publicBanner.jsx +++ b/src/forge/Information/Component/publicBanner.jsx @@ -55,10 +55,9 @@ function PublicBanner(props){
{!isNSCC &&

{data.mainTitle}

} {isNSCC && - -

+ +

{data.mainTitle} - /SUPERCOMPUTING

}

diff --git a/src/forge/Information/Pages/homepage/component/newsByNSCC.jsx b/src/forge/Information/Pages/homepage/component/newsByNSCC.jsx new file mode 100644 index 000000000..b75dbb18f --- /dev/null +++ b/src/forge/Information/Pages/homepage/component/newsByNSCC.jsx @@ -0,0 +1,174 @@ +import React , { useEffect, useState } from 'react'; +import { Link } from 'react-router-dom'; +import { getDirListById, getSubDocList } from '../../../api'; +import { Badge, Col, Divider, Icon, Row } from 'antd'; +import dirpng from '../image/new3.png' +import new4 from '../image/new4.png'; +import new5 from '../image/new5.png'; +import new6 from '../image/new6.png'; +import new7 from '../image/new7.png'; +import new8 from '../image/new8.png'; +import new9 from '../image/new9.png'; +import new10 from '../image/new10.png'; +import new11 from '../image/new11.png'; +import new12 from '../image/new12.png'; +import new13 from '../image/new13.png'; +import '../index.scss'; +import Nodata from '../../../../Nodata'; +import moment from 'moment'; + +function News(props) { + const {data} = props + const {key, homepageCmsTitle, id} = data || {}; + const logoByName = { + "智慧城市OS": new4, + "智慧交通OS": new5, + "智慧建设OS": new6, + "机器人OS": new7, + "智能家居OS": new8, + "桌面OS": new9, + "服务器OS": new10, + "移动智能终端OS": new11, + "嵌入式及物联网OS": new12, + "云OS": new13 + } + const [dirList, setDirList] = useState([]); + const firstDir = dirList[0]; + const secondDir = dirList[1]; + const dirs = dirList.slice(2) + + // const rows = Math.ceil(dirs.length / 6); + const [docListByFirstDir, setDocListByFirstDir] = useState([]); + const [docListBySecondDir, setDocListBySecondDir] = useState([]); + const [docListByDir, setDocListByDir] = useState([]); + const [activeDirId, setActiveDirId] = useState(undefined); + const [total, setTotal] = useState(0); + + useEffect(()=>{ + id && getDirListById(id).then(res=>{ + if(res){ + const rows = res.data.rows + setDirList(rows); + // 获取第一个栏目的第一条文章 + rows[0] && getDocById(rows[0].id, 4, (data)=>{ + setDocListByFirstDir(data) + }) + // 获取第2个栏目的第一条文章 + rows[1] && getDocById(rows[1].id, 3, (data)=>{ + setDocListBySecondDir(data) + }) + rows[2] && setActiveDirId(rows[2].id) + } + }) + }, [id]) + + useEffect(()=>{ + activeDirId && getDocById(activeDirId, 4, (data)=>{ + setDocListByDir(data) + }, (data)=>{setTotal(data)}) + }, [activeDirId]) + + // 根据招聘专栏的id获取其栏目下的招聘文章 + function getDocById(dirId, pageSize=10, setData, setTotal1){ + getSubDocList(dirId,{pageSize:pageSize,pageNum:1,auditStatus:1}).then(result=>{ + if(result && result.data.rows){ + let rows = result.data.rows; + setData(rows); + setTotal1 && setTotal1(result.data.total) + } + }) + } + + const renderItems = () => { + const itemsPerRow = 6; + let rendered = []; + let currentRow = []; + + dirs.forEach((item, index) => { + + // 添加项目到当前行 + currentRow.push( +
{setActiveDirId(item.id)}}> + +

{item.name}

+
+ ); + + // 如果达到每行项目数或是最后一个项目 + if ((index + 1) % itemsPerRow === 0 || index === dirs.length - 1) { + // 将当前行添加到渲染列表 + rendered = rendered.concat(currentRow); + + if (currentRow.some(item => item.key === activeDirId?.toString())) { + rendered.push( +
+
+ {docListByDir.map(item=>{ + return
+ + + {item.name} + +

{item.summary}

+
+ })} + {!docListByDir.length &&
暂无数据~
} +
+ {total > 4 &&
{window.scrollTo(0,450)}} className="color-blue font-15">查看更多
} +
+ ); + } + // 重置当前行 + currentRow = []; + } + }); + return rendered; + }; + + return
+
+

{homepageCmsTitle}

+
+ {/* 第一个顺序栏目 */} + {firstDir &&
+ {/* 第一篇文章 */} + {docListByFirstDir[0] &&
+ +
+

{docListByFirstDir[0].name}

+ {moment(docListByFirstDir[0].publishTime).format('MM.DD')} +
+
} + {docListByFirstDir.length > 1 && docListByFirstDir.slice(1).map(item=>{ + return
+ {item.name} + {moment(item.publishTime).format('YYYY-MM-DD')} + +
+ })} +
} + {/* 第二个顺序栏目 */} + {secondDir &&
+ + {window.scrollTo(0,450)}} className="font-18 font-bd">{secondDir.name} + {docListBySecondDir.map(item=>{ + return
+

+ {window.scrollTo(0,450)}}>{item.name} +

+
+ {item.summary} +
+ 查看详情 +
+ })} + {docListBySecondDir && !docListBySecondDir.length &&
} +
} +
+ {/* {dirs && !!dirs.length &&
+ {renderItems()} +
} */} +
+
+} +export default News; \ No newline at end of file diff --git a/src/forge/Information/Pages/homepage/component/projectByNSCC.jsx b/src/forge/Information/Pages/homepage/component/projectByNSCC.jsx new file mode 100644 index 000000000..c73383dd8 --- /dev/null +++ b/src/forge/Information/Pages/homepage/component/projectByNSCC.jsx @@ -0,0 +1,156 @@ +import React, { useEffect, useState } from 'react'; +import '../index.scss'; +import { getProjectListByScore, getProjectsTypeLists } from '../../../api'; +import { Carousel, Divider, Pagination, Spin } from 'antd'; +import Nodata from '../../../../Nodata'; +import Slider from 'react-slick'; + +function TypeCarousel({pageSize=4, list=[], typeId, onClick}) { + const setting = { + prevArrow: , + nextArrow: , + afterChange: (currentSlide)=>{onClick(list[currentSlide*pageSize].id)} + } + const pages = [] + for (let i = 0; i < Math.ceil(list.length / pageSize); i++) { + const start = i * pageSize; + const end = start + pageSize; + pages.push(list.slice(start, end)); + } + return + {pages.map((page, index)=>{ + return
+
+ {page.map((item, i) => { + const order = index*pageSize+i + const iconName = { + "并行计算框架": "icon-binghangjisuankuangjia", + "异构数据库": "icon-yigoushujuku", + "性能基准与评测": "icon-xingnengjizhunyupingce", + "任务调度管理": "icon-renwutiaoduguanli", + 1: "icon-binghangjisuankuangjia", + 2: "icon-yigoushujuku", + 3: "icon-xingnengjizhunyupingce", + 4: "icon-renwutiaoduguanli" + } + return
{ onClick(item.id) }}> + {/* 项目 */} + {/* */} + + {item.name} +
+ })} +
+
+ })} +
+} + +function Project({ data }) { + const { id, homepageProjectTitle } = data || {}; + const [typeList, setTypeList] = useState([]); + const [typeId, setTypeId] = useState(undefined); + const [lists, setLists] = useState([]); + const [loading, setLoading] = useState(false); + const [page, setPage] = useState(1); + const [total, setTotal] = useState(0); + const pages = []; + + useEffect(() => { + id && getProjectsTypeLists(id, { + pageNum: 1, + pageSize: 100, + }).then(result => { + if (result) { + const rows = result.data.rows; + rows[0] && setTypeId(rows[0].id) + setTypeList(rows); + } + }).catch(() => { }) + }, [id]) + + useEffect(() => { + if (typeId) { + setLoading(true); + getProjectListByScore(id, { + pageNum: page, + pageSize: 9, + projectTypeId: typeId + }).then(result => { + if (result) { + setLists(result.data.rows); + setTotal(result.data.total); + setLoading(false); + } + }).catch(() => { }) + } + }, [id, typeId, page]) + + const listPerPage = 6; + for (let i = 0; i < Math.ceil(total / listPerPage); i++) { + const start = i * listPerPage; + const end = start + listPerPage; + pages.push(lists.slice(start, end)); + } + + const projectDetail = (className="online_detail", i, index, length) => { + const { extra: { commitCount, contributorsCount, lastWeekScore, scoreChange } } = i || {} + return
window.open(i.projectURL)}> +
+ {i.projectProperties && i.projectProperties.name} + {className === "online_detail" && } +
+
+ {i.projectProperties.description || "暂无描述"} +
+
+
    + {i.projectProperties.language &&
  • {i.projectProperties.language}
  • } + { + i.projectProperties && i.projectProperties.topics && + i.projectProperties.topics.split(",").map(t => { + return ( +
  • {t}
  • + ) + }) + } +
+
+

+

+ 开发者{contributorsCount || 0} + + 历史提交总量{commitCount || 0} + + 活跃度{lastWeekScore || 0} +
+ {!!scoreChange && + 较上周 + 0 ? 'color-red' : "color-green"}>{scoreChange > 0 ? `+${scoreChange}` : scoreChange} + } +

+
+ } + + return
+
+

{homepageProjectTitle}

+ {setTypeId(id); setPage(1)}}/> + +
+ {lists.slice(0, 3).map((i, index)=>{ + return projectDetail("online_detail", i, index, 3) + })} +
+ {lists.length > 3 &&
+ {lists.slice(3).map((i, index)=>{ + return projectDetail("second_detail", i, index, lists.slice(4).length) + })} +
} + {setPage(page)}} className='center mt30'/> + {!loading && lists.length === 0 && } +
+
+
+} +export default Project; \ No newline at end of file diff --git a/src/forge/Information/Pages/homepage/component/projectVerticalSlider.jsx b/src/forge/Information/Pages/homepage/component/projectVerticalSlider.jsx new file mode 100644 index 000000000..357186a79 --- /dev/null +++ b/src/forge/Information/Pages/homepage/component/projectVerticalSlider.jsx @@ -0,0 +1,68 @@ +import React from 'react'; +import Slider from 'react-slick'; + +/* 分组函数,不补位 */ +const groupProjects = (list, size = 4) => { + const groups = []; + for (let i = 0; i < list.length; i += size) { + groups.push(list.slice(i, i + size)); + } + return groups; +}; + +export default function projectVerticalSlider({ + projectList, +}) { + const groups = groupProjects(projectList, 4); + + const settings = { + vertical: true, + verticalSwiping: true, + slidesToShow: 1, + slidesToScroll: 1, + autoplay: true, + autoplaySpeed: 3000, + infinite: groups.length > 1, // 只有多页才允许循环 + arrows: false, + dots: false, + }; + + /* 单页渲染 */ + const renderPage = (pageProjects, baseIndex) => ( +
+
+ {pageProjects.map((item, idx) => { + const globalIndex = baseIndex + idx; + return ( +
+ + 课题{globalIndex + 1} + +

{item.name}

+ {item.responsibleCompany && ( +
+ {item.responsibleCompany} +
+ )} +

{item.projectLeader}

+
+ ); + })} +
+
+ ); + + /* 不足 4 个时不走轮播 */ + if (groups.length <= 1) { + return <>{renderPage(projectList, 0)}; + } + + return {groups.map((g, i) => renderPage(g, i * 4))}; +} \ No newline at end of file diff --git a/src/forge/Information/Pages/homepage/component/sourceByNSCC.jsx b/src/forge/Information/Pages/homepage/component/sourceByNSCC.jsx new file mode 100644 index 000000000..0bc54349d --- /dev/null +++ b/src/forge/Information/Pages/homepage/component/sourceByNSCC.jsx @@ -0,0 +1,87 @@ +import React , { Fragment, useEffect, useState } from 'react'; +import { getSourceList, getSourceZoneList } from '../../../api'; +import png from '../image/source2.png' +import { Divider, Pagination, Spin } from 'antd'; +import { Link } from 'react-router-dom'; +import Nodata from '../../../../Nodata'; +import '../index.scss'; + +function Source({data}) { + const {id, key, homepageResourceTitle="资源发布"} = data || {}; + const [ chooseZoneId , setChooseZoneId ] = useState(undefined); + const [ zoneList , setZoneList ] = useState([]); + const [ sourceList , setSourceList ] = useState([]); + const [ total , setTotal ] = useState(0); + const [page, setPage] = useState(1); + const [ isSpin , setIsSpin ] = useState(true); + + useEffect(()=>{ + id && getSourceZoneList(id).then(response=>{ + if(response && response.data){ + const rows = response.data.rows; + rows[0] && setChooseZoneId(rows[0].id) + setZoneList(rows); + } + }).catch(error=>{}) + },[id]) + + useEffect(()=>{ + if(chooseZoneId){ + setIsSpin(true); + getSourceList({ + id,pageSize:9,pageNum:page,domainId:chooseZoneId + }).then(response=>{ + if(response){ + setSourceList(response.data.rows); + setTotal(response.data.total); + setIsSpin(false); + } + }).catch(error=>{}) + } + },[chooseZoneId, page]) + + return
+
+

{homepageResourceTitle}

+
+ {zoneList.slice(0,4).map((item, index)=>{ + return +
{setChooseZoneId(item.id);}} style={{flex: '25%'}}> +

{item.name}

+
{item.introduction || '暂无描述,待补充'}
+
+ {index < 3 && } +
+ })} +
+ +
+ {sourceList.map(i => { + const time = i.updateTime || i.createTime + return
+ +
+ + + + + + + + 下载 +
+

{i.name}

+

{i.summary}

+ +
+ })} +
+ {setPage(page)}} className='center mt30'/> +
+ {!isSpin && !sourceList.length && } +
+
+
+
+} +export default Source; \ No newline at end of file diff --git a/src/forge/Information/Pages/homepage/component/specialProjectsByNSCC.jsx b/src/forge/Information/Pages/homepage/component/specialProjectsByNSCC.jsx new file mode 100644 index 000000000..33b48e792 --- /dev/null +++ b/src/forge/Information/Pages/homepage/component/specialProjectsByNSCC.jsx @@ -0,0 +1,96 @@ +import React, { useEffect, useState } from 'react'; +import { getSpecialProjectDetail, getSpecialProjectList, getSpecialProjectTypeList, getImage, getSpecialReportList } from '../../../api'; +import { Col, Divider, Icon, Row, Tag } from 'antd'; +import Nodata from '../../../../Nodata'; +import '../index.scss'; +import ProjectVerticalSlider from './projectVerticalSlider'; +function SpecialProjects({ data }) { + const { key, homepageSpecialProjectTitle, id } = data || {}; + const [typeList, setTypeList] = useState([]); + const [typeId, setTypeId] = useState(undefined); + const [projectList, setProjectList] = useState([]); + const [selectedItem, setSelectedItem] = useState(null); + const [projectDetail, setProjectDetail] = useState({}); + + useEffect(() => { + id && getSpecialProjectTypeList(id, { + pageNum: 1, + pageSize: 100, + }).then(res => { + if (res) { + const rows = res.data.rows; + rows[0] && setTypeId(rows[0].id) + setTypeList(rows); + } + }) + }, [id]) + + useEffect(() => { + typeId && getSpecialProjectList(id, typeId).then(res => { + if (res) { + const rows = res.data.rows; + // rows[0] && setTypeId(rows[0].id) + setProjectList(rows); + } + }) + }, [typeId]) + + async function getRelevancyList(id, type, pageSize = 5) { + const res = await getSpecialProjectDetail(id, { + type, + pageNum: 1, + pageSize + }); + return res.data; + } + + async function getRelevancyListByReport(id, pageSize = 5) { + const res = await getSpecialReportList({ + specialProjectId: id, + pageNum: 1, + pageSize + }); + return res.data; + } + + const showMore = (type, isShowAll) => { + return

+ { + const data = type === "REPORT" ? await getRelevancyListByReport(selectedItem, isShowAll ? 5 : 1000) : await getRelevancyList(selectedItem, type, isShowAll ? 5 : 1000); + const detail = { + ...projectDetail + } + detail[type] = data + setProjectDetail(detail); + }}>{isShowAll ? '收起' : '展开'} +

+ } + + + return
+
+

{homepageSpecialProjectTitle}

+
+ +
+ {typeList.map((item, i) => { + return
+

{ setTypeId(item.id) }}> + {item.name} + {typeId !== item.id && } +

+ {typeId === item.id && item.introduction &&
+
} +
+ })} +
+ + {!projectList.length &&
} +
+ +
+
+} +export default SpecialProjects; \ No newline at end of file diff --git a/src/forge/Information/Pages/homepage/component/vipByNSCC.jsx b/src/forge/Information/Pages/homepage/component/vipByNSCC.jsx new file mode 100644 index 000000000..123309232 --- /dev/null +++ b/src/forge/Information/Pages/homepage/component/vipByNSCC.jsx @@ -0,0 +1,64 @@ +import React , { useEffect, useState } from 'react'; +import { getHomePageList } from '../../../api'; +import { Card, Carousel } from 'antd'; +import '../index.scss'; +import Nodata from '../../../../Nodata'; +import Slider from 'react-slick'; + +function Member({data, subTitle}) { + const {id, key, homepageMemberTitle} = data || {}; + const [typeList, setTypeList] = useState([]); + const [typeId, setTypeId] = useState(undefined); + const [ vipsMap , setVipsMap ] = useState({}); + const [ vipList , setVipList ] = useState([]); + const [current, setCurrent] = useState(0); + const list = vipsMap[typeId] || [] + const pages = []; + + useEffect(()=>{ + id && getHomePageList(id).then(response=>{ + if(response && response.data){ + setVipList(response.data.rows); + } + }).catch(error=>{}) + },[id]) + + const settings = { + dots: true, + infinite: true, + speed: 500, + slidesToShow: 3, // 可见 3 + slidesToScroll: 1, // 滑 1 + autoplay: true, + autoplaySpeed: 3000, + pauseOnHover: true, + centerMode: false + }; + + return
+
+

{homepageMemberTitle}

+ + {vipList.map((item, i) => { + const isCenter = i === (current + 1); + return
+
+
+ +
+

{item.name}

+ {item.memberLevel} +
+
+
+ {item.introduction || '暂无介绍, 待补充'} +
+
+
+ })} +
+ {vipList && !vipList.length && } +
+
+} +export default Member; \ No newline at end of file diff --git a/src/forge/Information/Pages/homepage/image/bkImg.png b/src/forge/Information/Pages/homepage/image/bkImg.png new file mode 100644 index 000000000..9891a2070 Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/bkImg.png differ diff --git a/src/forge/Information/Pages/homepage/image/bkImg1.png b/src/forge/Information/Pages/homepage/image/bkImg1.png new file mode 100644 index 000000000..88a3467ae Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/bkImg1.png differ diff --git a/src/forge/Information/Pages/homepage/image/bkImg2.png b/src/forge/Information/Pages/homepage/image/bkImg2.png new file mode 100644 index 000000000..df68a306c Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/bkImg2.png differ diff --git a/src/forge/Information/Pages/homepage/image/bkImg3.png b/src/forge/Information/Pages/homepage/image/bkImg3.png new file mode 100644 index 000000000..27f23efc2 Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/bkImg3.png differ diff --git a/src/forge/Information/Pages/homepage/image/bkImg4.png b/src/forge/Information/Pages/homepage/image/bkImg4.png new file mode 100644 index 000000000..0d58b786b Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/bkImg4.png differ diff --git a/src/forge/Information/Pages/homepage/image/bkImg5.png b/src/forge/Information/Pages/homepage/image/bkImg5.png new file mode 100644 index 000000000..f7047ce42 Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/bkImg5.png differ diff --git a/src/forge/Information/Pages/homepage/image/bkImg6.png b/src/forge/Information/Pages/homepage/image/bkImg6.png new file mode 100644 index 000000000..a7c3ddb66 Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/bkImg6.png differ diff --git a/src/forge/Information/Pages/homepage/image/bkImg7.png b/src/forge/Information/Pages/homepage/image/bkImg7.png new file mode 100644 index 000000000..21e752d97 Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/bkImg7.png differ diff --git a/src/forge/Information/Pages/homepage/image/bkImg8.png b/src/forge/Information/Pages/homepage/image/bkImg8.png new file mode 100644 index 000000000..bb9fad3d6 Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/bkImg8.png differ diff --git a/src/forge/Information/Pages/homepage/image/bkImg9.png b/src/forge/Information/Pages/homepage/image/bkImg9.png new file mode 100644 index 000000000..d5b6460aa Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/bkImg9.png differ diff --git a/src/forge/Information/Pages/homepage/image/projectBk1.png b/src/forge/Information/Pages/homepage/image/projectBk1.png new file mode 100644 index 000000000..d6baaf642 Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/projectBk1.png differ diff --git a/src/forge/Information/Pages/homepage/image/projectBk2.png b/src/forge/Information/Pages/homepage/image/projectBk2.png new file mode 100644 index 000000000..f71e6381d Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/projectBk2.png differ diff --git a/src/forge/Information/Pages/homepage/image/projectBk3.png b/src/forge/Information/Pages/homepage/image/projectBk3.png new file mode 100644 index 000000000..a65a81076 Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/projectBk3.png differ diff --git a/src/forge/Information/Pages/homepage/image/source6.png b/src/forge/Information/Pages/homepage/image/source6.png new file mode 100644 index 000000000..96beea1d1 Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/source6.png differ diff --git a/src/forge/Information/Pages/homepage/image/source7.png b/src/forge/Information/Pages/homepage/image/source7.png new file mode 100644 index 000000000..1f92e519e Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/source7.png differ diff --git a/src/forge/Information/Pages/homepage/image/source8.png b/src/forge/Information/Pages/homepage/image/source8.png new file mode 100644 index 000000000..ed5348cb8 Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/source8.png differ diff --git a/src/forge/Information/Pages/homepage/image/source9.png b/src/forge/Information/Pages/homepage/image/source9.png new file mode 100644 index 000000000..0b1db8944 Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/source9.png differ diff --git a/src/forge/Information/Pages/homepage/image/source_bk1.png b/src/forge/Information/Pages/homepage/image/source_bk1.png new file mode 100644 index 000000000..8225e46be Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/source_bk1.png differ diff --git a/src/forge/Information/Pages/homepage/image/source_bk2.png b/src/forge/Information/Pages/homepage/image/source_bk2.png new file mode 100644 index 000000000..a2b309caf Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/source_bk2.png differ diff --git a/src/forge/Information/Pages/homepage/image/top1.png b/src/forge/Information/Pages/homepage/image/top1.png new file mode 100644 index 000000000..54801a4f7 Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/top1.png differ diff --git a/src/forge/Information/Pages/homepage/image/top2.png b/src/forge/Information/Pages/homepage/image/top2.png new file mode 100644 index 000000000..041a204ad Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/top2.png differ diff --git a/src/forge/Information/Pages/homepage/image/top3.png b/src/forge/Information/Pages/homepage/image/top3.png new file mode 100644 index 000000000..db657442a Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/top3.png differ diff --git a/src/forge/Information/Pages/homepage/image/vipbk.png b/src/forge/Information/Pages/homepage/image/vipbk.png new file mode 100644 index 000000000..45a1d3020 Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/vipbk.png differ diff --git a/src/forge/Information/Pages/homepage/image/vipbk1.png b/src/forge/Information/Pages/homepage/image/vipbk1.png new file mode 100644 index 000000000..14432b582 Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/vipbk1.png differ diff --git a/src/forge/Information/Pages/homepage/image/vipbk2.png b/src/forge/Information/Pages/homepage/image/vipbk2.png new file mode 100644 index 000000000..77444f5e1 Binary files /dev/null and b/src/forge/Information/Pages/homepage/image/vipbk2.png differ diff --git a/src/forge/Information/Pages/homepage/index.scss b/src/forge/Information/Pages/homepage/index.scss index 40d3fe4ca..527660d6e 100644 --- a/src/forge/Information/Pages/homepage/index.scss +++ b/src/forge/Information/Pages/homepage/index.scss @@ -2,6 +2,9 @@ width: 1200px; margin:0px auto; } +.gap20{ + gap: 20px; +} .align{ text-align: center; justify-content: center; @@ -12,6 +15,9 @@ .between{ justify-content: space-between } +.baseline{ + align-items: baseline; +} .color-theme{ color: $primary-color; } @@ -30,12 +36,36 @@ .color848{ color: #848992; } +.color5d6{ + color:#5d6371; +} +.color131{ + color:#131415; +} +.color828{ + color:#8284a4; +} +.color82880{ + color:#8284a480; +} +.color020{ + color:#020814; +} +.color181{ + color:#181818; +} +.color606{ + color: #606673 +} .backWhite{ background-color: white; } .pointer{ cursor: pointer; } +.mt-15{ + margin-top: -15px; +} .zone_1_carousel{ .slick-dots li button:before{ font-size: 12px; @@ -508,4 +538,448 @@ right: -8px; } } +} + +.nscc_homepage_box{ + .account_nscc{ + display: inline-block; + min-width:134px; + height:46px; + line-height:46px; + border:1px solid; + border-color:#5d6371; + border-radius:23px; + } + .nscc_introduction{ + background-image: url('./image/bkImg.png'); + background-size: 100% 100%; + } + .specialProjects_NSCC{ + background-image: url('./image/bkImg1.png'); + background-size: 100% 100%; + .slick-active .s_p_detail_NSCC{ + border-radius: 20px; + box-shadow: 0px 0px 12px rgba(33, 73, 212, 0.1); + } + .s_p_detail_NSCC{ + width:399px; + height:172px; + padding: 25px; + background-image: url('./image/bkImg2.png'); + background-size: 100% 100%; + flex-direction: column; + position: relative; + + &:nth-of-type(4n+1) .s_p_d_order{ + color: #1c9907; + background-image: linear-gradient(178.25deg, #bfeab8 0%, rgba(255, 255, 255, 0) 100%); + } + + &:nth-of-type(4n+2) .s_p_d_order{ + color: #466aff; + background-image: linear-gradient(178.25deg, #cfd8ff 0%, rgba(255, 255, 255, 0) 100%); + } + + &:nth-of-type(4n+3) .s_p_d_order{ + color: #514cf9; + background-image: linear-gradient(178.25deg, #cecdfc 0%, rgba(255, 255, 255, 0) 100%); + } + + &:nth-of-type(4n) .s_p_d_order{ + color: #f8952d; + background-image: linear-gradient(178.25deg, #ffdcb9 0%, rgba(255, 231, 231, 0.5) 50.09%, rgba(255, 255, 255, 0) 100%); + } + .s_p_d_order { + position: absolute; + top: 0; + right: 0; + display: inline-block; + padding: 3px 12px 5px 22px; + border-radius: 0 13px 0 0; + clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%); + } + } + .page_NSCC { + display: flex; + align-content: flex-start; + min-height: 394px; + } + .s_p_detail_NSCC { + flex: 0 0 48%; + } + .slick-list{ + padding: 20px 0 0 0; + } + } + .specialProjectTypeBox{ + width: 340px; + margin-right: 40px; + transition: height .5s; + .desc_spt{ + padding-right: 30px; + padding-bottom: 30px; + border-bottom: 1px dashed #C7CADA; + transition: height .3s ease-out; + opacity: 1; + animation: animation1 .3s ease-in-out .3s backwards; + } + @keyframes animation1{ + 0% { + opacity: 0; + transform: translateY(30px); + } + 100% { + opacity: 1; + transform: translateY(0); + } + } + } + .carousel-row { + align-items: center; + .carousel-arrow{ + width:30px; + height:30px; + text-align: center; + line-height: 30px; + border-radius: 50%; + background-color:#ffffff; + box-shadow:0px 3px 6px rgba(70, 106, 255, 0.1); + margin: 0 20px; + &:hover .iconfont{ + color: $primary-color; + } + } + .dot_nscc{ + width:4px; + height:4px; + border-radius: 50%; + background-color:#ced0d3; + margin: 0 2px; + &.active{ + width:24px; + height:4px; + border-radius:2px; + transition: width .3s linear; + & span{ + display: block; + width: 0; + height: 100%; + border-radius:2px; + background-color: #5D6371; + animation: leftToRight 3s linear forwards; + } + } + } + @keyframes leftToRight { + 0% { + width: 0; + } + 100% { + width: 100%; + } + } + } +} +.news_1_bg_NSCC{ + background-image: url('./image/bkImg5.png'); + background-size: 100% 100%; + background-color: #EBEFFA; + .firstDir_NSCC{ + width:690px; + background-color: #F6F8FD; + border-radius:15px; + box-shadow:0px 0px 12px rgba(33, 73, 212, 0.1); + } + .firstDoc{ + position: relative; + } + .firstDoc_Img{ + width:690px; + object-fit: cover; + border-radius:15px; + } + .firstDocName{ + position: absolute; + bottom: 0; + padding-bottom: 15px; + padding-left: 25px; + width: 100%; + background-image:linear-gradient(180deg,rgba(0, 0, 0, 0) 0%,rgba(0, 0, 0, 0.36) 49.09%,rgba(0, 0, 0, 0.6) 100%); + border-radius:0 0 15px 15px; + } + .secondDir_NSCC{ + border-radius:15px; + box-shadow:0px 0px 12px rgba(33, 73, 212, 0.1); + background: linear-gradient(180deg,#f4f7ff 0%,#F6F8FD 100%), url('./image/bkImg6.png') top/contain no-repeat; + background-blend-mode: multiply; + padding: 30px 25px; + } + .docBySecondDir_NSCC{ + background-image:linear-gradient(180deg,#f4f7ff 0%,#ffffff 100%); + border-radius:15px; + box-shadow:0px 0px 12px rgba(33, 73, 212, 0.06); + padding: 16px 20px; + &:hover{ + background-image: url('./image/bkImg7.png'); + background-size: 100% 100%; + div, a{ + color: white !important; + } + } + } + .docBox_o{ + .icon-jiantou3{ + display: none; + } + &:hover .icon-jiantou3{ + display: inline-block; + } + &:hover a{ + color: $primary-color; + } + } +} +.project_1_bg_NSCC { + background-image: url('./image/bkImg8.png'); + background-size: 100% 100%; + + .typeCarouselByNSCC { + display: inline-flex; + background-color: rgba(255, 255, 255, 0.3); + border: 1px solid #ffffff; + border-radius: 30px; + padding: 6px 0; + .p_1_icon{ + width: 22px; + height: 22px; + background-size: 100% 100%; + } + .proTypeBox { + padding: 4px 15px; + &.active { + color: $primary-color; + background-color: #ffffff; + border-radius: 23px; + .iconfont{ + color: $primary-color; + } + } + &:first-of-type{ + margin-left: 6px; + } + &:last-of-type{ + margin-right: 6px; + } + } + } + .online_detail{ + background-image: url('./image/projectBk1.png'); + background-size: 100% 100%; + flex: 0 0 calc(33.333% - 15px); + padding: 22px 20px 20px 20px; + border-radius:15px; + box-shadow:0px 0px 12px rgba(33, 73, 212, 0.1); + &:hover{ + background-image: url('./image/projectBk2.png'); + span, div{ + color: white; + } + .color5d6:not(.task-hide-2){ + opacity: 0.8; + } + .pd_tag_NSCC li{ + color:#ffffff; + background-color:rgba(255, 255, 255, 0.12); + border: 1px solid rgba(255, 255, 255, 0.5); + } + } + } + .second_detail{ + flex: 0 0 calc(33.333% - 15px); + padding: 0 20px; + &:nth-child(3n+1), &:nth-child(3n+2) { + border-right: 1px dashed rgba(146, 164, 201, 0.56); + } + &:nth-child(3n+2){ + margin: 0 20px; + } + &.pb30{ + padding-bottom: 30px; + } + &.noBor{ + border-right: none; + } + } + .second_detailBox{ + background-image: url('./image/projectBk3.png'); + background-size: 100% 100%; + padding: 25px 0; + border-radius: 15px; + box-shadow: 0px 0px 12px rgba(33, 73, 212, 0.1); + } + .pd_tag_NSCC{ + li{ + padding: 0 8px; + border-radius:4px; + color:#466aff; + background-color:#E5EAFF; + &:nth-of-type(3n+2){ + color:#1c9907; + background-color:#EBF5ED; + } + + &:nth-of-type(3n+3){ + color:#514cf9; + background-color:#EFF0FF; + } + } + } +} +.source_1_bg_NSCC{ + background-image: url('./image/bkImg9.png'); + background-size: 100% 100%; + .s_1_souce_NSCC{ + padding: 30px 20px; + flex: 0 0 calc(33.333% - 20px); + background-image: url('./image/source_bk1.png'); + background-size: 100% 100%; + transition: all .5s ease; + border-radius: 15px; + box-shadow: 0px 0px 12px rgba(33, 73, 212, 0.1); + &:hover{ + background-image: url('./image/source_bk2.png'); + .hoverImg, .icon-jiantou3{ + display: inline-block; + } + p, span{ + color:#ffffff !important; + } + .souce_icon_box{ + background-color:rgba(255, 255, 255, 0.2); + border:1px solid rgba(255, 255, 255, 0.3); + } + } + .hoverImg, &:hover .normalImg, .icon-jiantou3{ + display: none; + } + .souce_icon_box{ + width:40px; + height:40px; + text-align: center; + line-height: 40px; + background-color:#ffffff; + border-radius:6px; + box-shadow:0px 0px 6px rgba(70, 106, 255, 0.06); + } + } +} + +.vip_1_bg_NSCC{ + background-image: url('./image/vipbk.png'); + background-size: 100% 100%; + padding-bottom: 150px; + .vip-slide-1{ + background-image: url('./image/vipbk1.png'); + background-size: 100% 100%; + align-items: center; + padding: 33px 36px; + border-radius: 15px 15px 0px 0px; + img{ + width:54px; + height:54px; + border-radius: 50%; + background-color: white; + } + } + .vip-slide-2{ + min-height:171px; + background-image:linear-gradient(155.1deg,#f4f7ff 0%,#ffffff 100%); + border-radius:0px 0px 15px 15px; + } + .vip-slide-NSCC{ + transition: all .5s ease; + border-radius: 15px; + box-shadow:0px 0px 12px rgba(33, 73, 212, 0.05); + } + .vip_NSCC_Slider{ + .slick-list{ + padding: 50px 0 0 0; + } + .slick-arrow{ + width:36px; + height:36px; + border-radius: 50%; + background-color:#ffffff; + box-shadow:0px 3px 6px rgba(70, 106, 255, 0.1); + &.slick-next:before, &.slick-prev:before{ + font-size: 14px; + font-family: "iconfont"; + color: #606673; + font-weight: 700; + } + &:hover{ + &.slick-next:before, &.slick-prev:before{ + color: $primary-color; + } + } + } + .slick-next:before{ + content: "\e8de"; + } + .slick-prev{ + z-index: 1; + } + .slick-prev:before{ + content: "\e8df"; + } + .slick-dots li button:before{ + color: #8a9099; + } + li.slick-active button::before{ + content: ""; + width:24px; + height:4px; + background-color:#9da0a6; + border-radius:2px; + top: 7px; + left: 5px; + } + .slick-dots{ + bottom: -33px; + } + .slick-dots li:not(.slick-active){ + width: 5px; + } + // 视图第一张 + .slick-current.slick-active{ + padding-right: 40px; + // 视图第二张 + &+.slick-slide { + .vip-slide-NSCC { + width: 110% !important; + margin-left: -5%; + position: relative; + top: -12px; + } + .vip-slide-1 { + position: relative; + padding: 40px 36px 55px; + background-image: url('./image/vipbk2.png'); + img { + background: none; + position: absolute; + bottom: 0px; + right: 25px; + width: 200px; + height: 200px; + margin-right: 0; + border-radius: 0; + } + } + } + &+.slick-slide+.slick-slide{ + padding-left: 40px; + } + } + } } \ No newline at end of file diff --git a/src/forge/Information/Pages/homepage/nscc.jsx b/src/forge/Information/Pages/homepage/nscc.jsx new file mode 100644 index 000000000..ee5b0e16f --- /dev/null +++ b/src/forge/Information/Pages/homepage/nscc.jsx @@ -0,0 +1,132 @@ +import React, { createRef, useEffect, useState } from 'react'; +import NewsByNSCC from './component/newsByNSCC'; +import ProjectByNSCC from './component/projectByNSCC'; +import SourceByNSCC from './component/sourceByNSCC'; +import MemberByNSCC from './component/vipByNSCC'; +import Partner from './component/partner'; +import SpecialProjectsByNSCC from './component/specialProjectsByNSCC'; +import '../../indexZone1.scss' +import './index.scss' +import { getUniqueIdentifier, getUserName, getBrowserPlatform, getBrowserBrand } from '../../utils' +import { getNewsDetail, getSubDocList, getZoneStatistics, setZoneVisits } from '../../api' +import { Anchor, Carousel } from 'antd'; +import { Base64 } from 'js-base64'; +function HeaderPageUos(props) { + const label = { + communityUserCount: "社区用户", + cmsDocVisits: "文章访问数", + projectCount: "代码仓库", + resourceCount: "社区资源", + cmsDocCount: "社区新闻", + specialProjectCount: "重点项目", + } + + const { data } = props; + const { id, firstTitle, homepageSpecialProjectTitle, homepageCmsTitle, homepageProjectTitle, homepageResourceTitle, homepageMemberTitle } = data || {}; + const [data1, setData1] = useState({}); + const [mainList, setMainList] = useState([]); + const carouselEL = createRef() + const [current, setCurrent] = useState(0); + const [ showAnchor, setShowAnchor ] = useState(false); + + useEffect(() => { + let uuid = getUniqueIdentifier() + let url = props.location.pathname + let platform = getBrowserPlatform() + let browser = getBrowserBrand() + let username = getUserName(props.current_user) + // if(!username) uuid = getUniqueIdentifier() + let remark = ` 操作系统:${platform};浏览器:${browser};` + setZoneVisits({ url, username, uuid, remark }) + + // 获取【关于超算】栏目的文章列表 + getSubDocList(window.location.host === "www.gitlink.org.cn" ? 1039 : 2810, { pageSize: 100, pageNum: 1, auditStatus: 1 }).then(async (result) => { + if (!result) return; + const rows = result.data.rows; + await Promise.all( + rows.map(async (item) => { + const detail = await getNewsDetail(item.id); + if (detail) item.docContent = detail.data.data.content; + }) + ); + setMainList(rows); + }).catch(console.error); + + // 滚动监听 + document.addEventListener("scroll", scroll); + return () => { + document.removeEventListener("scroll", scroll); + }; + }, []) + + useEffect(() => { + id && getZoneStatistics(id).then(res => { + setData1(res.data && res.data.data) + }) + }, [id]) + + const scroll = () =>{ + let sTop = document.documentElement.scrollTop; + if(sTop >= 600){ + setShowAnchor(true); + }else{ + setShowAnchor(false); + } + } + + return ( +
+ {showAnchor && + + + + + + + + + } +
+
+ {firstTitle} +
+
+ {Object.keys(label).map(item => { + return
+ {data1[item]}+ +

{label[item]}

+
+ })} +
+ + {mainList.map(item => { + return
+ })} +
+ {mainList.length >1 &&
+ carouselEL.current.prev()}> + + + {mainList.map((_, i) => ( +
  • carouselEL.current.goTo(i)} + className={`dot_nscc ${i === current ? 'active' : ''}`} // 高亮 + > + +
  • + ))} + carouselEL.current.next()}> + + +
    } +
    + + + + + +
    + ) +} +export default HeaderPageUos; \ No newline at end of file diff --git a/src/forge/Information/index.jsx b/src/forge/Information/index.jsx index bc6d3301d..a08a0b3e3 100644 --- a/src/forge/Information/index.jsx +++ b/src/forge/Information/index.jsx @@ -100,6 +100,11 @@ const HomePageByUos = Loadable({ loader : () => import("./Pages/homepage/uos"), loading : Loading, }); + +const HomePageByNSCC = Loadable({ + loader : () => import("./Pages/homepage/nscc"), + loading : Loading, +}); const DatasetFileList = Loadable({ loader : () => import("./Pages/dataset/fileList"), loading : Loading, @@ -298,6 +303,7 @@ function Index(props){ deptId === "JCC" ? : deptId === "uos" ? : deptId==="xjykyzx" ? : + deptId==="NSCC" ? : temp === tempEnum.zone ? : )} diff --git a/src/forge/Information/index.scss b/src/forge/Information/index.scss index cd975cb86..73cc5a641 100644 --- a/src/forge/Information/index.scss +++ b/src/forge/Information/index.scss @@ -223,8 +223,10 @@ font-family: "ziyouwenyihei"; } .sub_t{ - font-size:15px; + font-size:18px; color:#ffffff; + line-height: 36px; + letter-spacing: 7px; } } } diff --git a/src/forge/Information/indexZone1.scss b/src/forge/Information/indexZone1.scss index 2d174f7fc..f551f106c 100644 --- a/src/forge/Information/indexZone1.scss +++ b/src/forge/Information/indexZone1.scss @@ -1152,6 +1152,45 @@ left: -3px; background-color:#07a583; } + &.anchor_nscc{ + top: 35%; + background: none; + + .ant-anchor-ink{ + border-left: 1px dashed rgba(146, 164, 201, 0.56); + &::before{ + background: none; + } + } + .ant-anchor-link-title{ + font-size: 15px; + color:#131415; + } + .ant-anchor-link-title-active,.ant-anchor-link-active{ + color: $primary-color; + } + .ant-anchor-link{ + margin: 10px 0px; + padding-top: 14px; + padding-bottom: 14px; + position: relative; + &:not(.ant-anchor-link-active)::after{ + position: absolute; + content: ""; + top: 20px; + left: -3px; + width:5px; + height:5px; + border-radius: 50%; + background-color:#7d89a4; + } + } + .ant-anchor-link-active::before{ + width: 3px; + border-radius: 3px; + background-color:$primary-color; + } + } } .system_open{