diff --git a/src/App.js b/src/App.js index 4c5c53f5a..031f9a040 100644 --- a/src/App.js +++ b/src/App.js @@ -381,7 +381,7 @@ class App extends Component { )} > { return () diff --git a/src/forge/Images/nodata.png b/src/forge/Images/nodata.png index 5a1231e7f..b67197269 100644 Binary files a/src/forge/Images/nodata.png and b/src/forge/Images/nodata.png differ diff --git a/src/forge/Images/nodata_big.png b/src/forge/Images/nodata_big.png new file mode 100644 index 000000000..5a1231e7f Binary files /dev/null and b/src/forge/Images/nodata_big.png differ diff --git a/src/forge/Information/Component/publicBanner.jsx b/src/forge/Information/Component/publicBanner.jsx index e0cbc2db9..d94b5665b 100644 --- a/src/forge/Information/Component/publicBanner.jsx +++ b/src/forge/Information/Component/publicBanner.jsx @@ -12,14 +12,17 @@ import { Link } from 'react-router-dom'; function PublicBanner(props){ const [ key , setKey ] = useState("1"); const { pathname } = props.history.location; + const { data } = props; useEffect(()=>{ if(pathname){ + const head = /\/information\/[0-9]{0,}/g; const info = /\/information\/[0-9]{0,}\/news/g; - if(pathname === '/information'){ + const project = /\/information\/[0-9]{0,}\/projects/g; + if(head.test(pathname)){ setKey("1"); } - if(pathname === '/information/projects'){ + if(project.test(pathname)){ setKey("2"); } if(info.test(pathname)){ @@ -30,16 +33,19 @@ function PublicBanner(props){ return(
-
-

主标题文案内容占一行

-

专区副标题文案内容专区副标题文案内容专区副标题文案内容专区副标题文案内容专区副标题文案内容专区副标题文案内容专区副标题文案内容

-
+ { + data && +
+

{data.mainTitle}

+

{data.subTitle}

+
+ }
- 首页 - 开源项目 + 首页 + 开源项目 资源发布 - 领域资讯 + 领域资讯 Sig小组
diff --git a/src/forge/Information/Pages/headerPage.jsx b/src/forge/Information/Pages/headerPage.jsx new file mode 100644 index 000000000..72de047ec --- /dev/null +++ b/src/forge/Information/Pages/headerPage.jsx @@ -0,0 +1,166 @@ +import React,{ useState, useEffect } from 'react'; +import img1 from '../img/img1.png'; +import img2 from '../img/img2.png'; +import guideArrow from '../img/guideArrow.png'; +import { Link } from 'react-router-dom'; +import shijian from '../img/shijian.png'; +import axios from 'axios'; + +function HeaderPage(props){ + const [ projectList , setProjectList ] = useState(undefined); + const [ newsList, setNewsList ] = useState(undefined); + const { deptId } = props.match.params; + const { data } = props; + + useEffect(()=>{ + getProjectList(); + getNewsList(); + },[]) + + function getNewsList(){ + const url = `/cms/doc/open/zone/${deptId}/homePageDocList`; + axios.get(url).then(result=>{ + if(result){ + setNewsList(result.data.rows); + } + }).catch(error=>{}) + } + + function getProjectList(){ + const url = `/zone/open/${deptId}/project/list`; + axios.get(url,{params:{ + isHomepage:1,pageNum:1,pageSize:4 + }}).then(result=>{ + if(result){ + setProjectList(result.data.rows); + } + }).catch(console.error()) + } + return( +
+

{data && data.name}

+
+ { + data && +
+

{data.name}

+

{data.introductionContent}

+
+ } + { + data && data.introductionImage && + + } +
+
+

新闻动态

+ { + newsList && newsList.length>0 && +
+
+ +

{newsList[0].name}

+

{newsList[0].summary}

+

+ + {newsList[0].publishTime} +

+

+ 查看详情 +

+
+
    + { + newsList.map((i,k)=>{ + return( + k > 0 &&
  • + {i.name} +

    {i.summary}

    +

    + + + {i.publishTime} + + 查看详情 +

    +
  • + ) + }) + } +
+
+ } +
+
+

精选项目

+ { + projectList && projectList.length>0&& +
+ { + projectList.map((i,k)=>{ + return( +
  • + {i.projectProperties && i.projectProperties.authorImageUrl && } +
    + {i.fullName} +

    {i.projectProperties && i.projectProperties.description ? i.projectProperties.description : "暂无~"}

    +
    +
  • + ) + }) + } +
    + } +
    +
    +

    核心贡献者

    +
      +
    • + + 贡献者名字一 +

      我是贡献者的简介内容占两行我是贡献者的简介内容占两行我是贡献者的简介内容占两行

      +
    • +
    • + + 贡献者名字一2 +

      我是贡献者的简介内容占两行我是贡献者的简介内容占两行我是贡献者的简介内容占两行

      +
    • +
    • + + 贡献者名字一3 +

      我是贡献者的简介内容占两行我是贡献者的简介内容占两行我是贡献者的简介内容占两行

      +
    • +
    • + + 贡献者名字一4 +

      我是贡献者的简介内容占两行我是贡献者的简介内容占两行我是贡献者的简介内容占两行

      +
    • +
    +
    + +
    +

    合作伙伴

    +
      +
    • 合作伙伴一
    • +
    • 合作伙伴一
    • +
    • 合作伙伴一
    • +
    • 合作伙伴一
    • +
    • 合作伙伴一
    • +
    • 合作伙伴一
    • +
    • 合作伙伴一
    • +
    • 合作伙伴一
    • +
    • 合作伙伴一
    • +
    • 合作伙伴一
    • +
    • 合作伙伴一
    • +
    • 合作伙伴一
    • +
    • 合作伙伴一
    • +
    • 合作伙伴一
    • +
    • 合作伙伴一
    • +
    • 合作伙伴一
    • +
    • 合作伙伴一
    • +
    +
    +
    + ) +} +export default HeaderPage; \ No newline at end of file diff --git a/src/forge/Information/Pages/main.jsx b/src/forge/Information/Pages/main.jsx index fc4a4d63b..073e1bfe4 100644 --- a/src/forge/Information/Pages/main.jsx +++ b/src/forge/Information/Pages/main.jsx @@ -27,7 +27,7 @@ function Main(props){ },[deptId]) function getMainList(){ - const url = `/cms/doc/open/dept/${deptId}/docOverviewList`; + const url = `/cms/doc/open/zone/${deptId}/docOverviewList`; axios.get(url).then(result=>{ if(result){ setMainList(result.data.rows); @@ -36,7 +36,7 @@ function Main(props){ } function getHotList(){ - const url = `/cms/doc/open/dept/${deptId}/hotDocList`; + const url = `/cms/doc/open/zone/${deptId}/hotDocList`; axios.get(url,{ params:{pageSize:15,pageNum:1} }).then(result=>{ @@ -52,7 +52,7 @@ function Main(props){ return(
    - + {/* */}

    领域资讯

    { @@ -94,7 +94,7 @@ function Main(props){ ) }
    - {j.name} + {j.name}

    {j.summary}

    diff --git a/src/forge/Information/Pages/newsDetail.jsx b/src/forge/Information/Pages/newsDetail.jsx index 08dc2b3c5..2fe7f6476 100644 --- a/src/forge/Information/Pages/newsDetail.jsx +++ b/src/forge/Information/Pages/newsDetail.jsx @@ -7,7 +7,7 @@ import { Base64 } from 'js-base64'; import axios from 'axios'; function NewsDetail(props){ - const { deptId , cateId , id } = props.match.params; + const { deptId , id } = props.match.params; const [ detail , setDetail ] = useState(undefined); const [ cmsDir , setCmsDir ] = useState(undefined); @@ -29,13 +29,12 @@ function NewsDetail(props){ } return(
    - { detail &&
    领域资讯 - { cmsDir && {cmsDir.name} } + { cmsDir && {cmsDir.name} } 正文
    diff --git a/src/forge/Information/Pages/newsList.jsx b/src/forge/Information/Pages/newsList.jsx index 9e762bdbd..c187cdaec 100644 --- a/src/forge/Information/Pages/newsList.jsx +++ b/src/forge/Information/Pages/newsList.jsx @@ -8,6 +8,7 @@ import shijian from '../img/shijian.png'; import liulan from '../img/liulan.png'; import DefaultImg from '../Component/defaultImg'; import emptydata from '../../Images/nodata.png'; +import { Link } from 'react-router-dom'; function NewsList(props){ const { deptId , cateId } = props.match.params; @@ -44,7 +45,7 @@ function NewsList(props){ } function getColumnList(){ - const url = `/cms/doc/open/dept/${deptId}/dirList`; + const url = `/cms/doc/open/zone/${deptId}/dirList`; axios.get(url).then(result=>{ if(result){ setColumnList(result.data.rows); @@ -81,7 +82,7 @@ function NewsList(props){ return(
    - + {/* */}
    领域资讯 @@ -92,11 +93,11 @@ function NewsList(props){ { columnList && columnList.length>0 &&
    - + { columnList.map((i,k)=>{ return( - {i.name} + {i.name} ) }) } @@ -118,7 +119,7 @@ function NewsList(props){ }
    - {i.name} + {i.name}

    {i.summary}

    @@ -144,9 +145,12 @@ function NewsList(props){ }
    -
    - -
    + { + hostList && hostList.length>0 && +
    + +
    + }
    diff --git a/src/forge/Information/Pages/projectSource.jsx b/src/forge/Information/Pages/projectSource.jsx index b1fab2a18..6053df952 100644 --- a/src/forge/Information/Pages/projectSource.jsx +++ b/src/forge/Information/Pages/projectSource.jsx @@ -1,11 +1,64 @@ import React , { useEffect , useState } from 'react'; import Banner from '../Component/publicBanner'; import { Box , LongWidth } from '../../Component/layout'; -import { Input , Dropdown , Menu } from 'antd'; +import { Input , Menu , Pagination , Spin } from 'antd'; import { Link } from 'react-router-dom'; -const { Search } = Input +import Nodata from '../../Nodata'; +import axios from 'axios'; +const { Search } = Input; -function ProjectSource(props){ +function ProjectSource(props){ + const { deptId } = props.match.params; + const [ typeId , setTypeId ] = useState(0); + const [ typeList , setTypeList ] = useState(undefined); + const [ lists , setLists ] = useState(undefined); + const [ page, setPage ] = useState(1); + const [ total , setTotal ] = useState(0); + const pageSize = 20; + const [ searchName , setSearchName ] = useState(undefined); + const [ value , setValue ] = useState(undefined); + const [ loading , setLoading ] = useState(false); + + useEffect(()=>{ + if(deptId){ + getTypeList(); + } + },[deptId]) + + useEffect(()=>{ + if(deptId){ + setLoading(true); + getLists(); + } + },[deptId,typeId,page,searchName]) + + function getLists(){ + const url = `/zone/open/${deptId}/project/list`; + axios.get(url,{ + params:{ + pageNum:page, + name:searchName, + pageSize, + projectTypeId:typeId===0?undefined:typeId + } + }).then(result=>{ + if(result){ + setLists(result.data.rows); + setTotal(result.data.total); + setLoading(false); + } + }).catch(error=>{}) + } + + + function getTypeList(){ + const url = `/zone/open/${deptId}/projectType/list`; + axios.get(url).then(result=>{ + if(result){ + setTypeList(result.data.rows); + } + }).catch(error=>{}) + } const menu = ( 更新时间排序 @@ -16,51 +69,99 @@ function ProjectSource(props){ ) return(
    - + {/* */}

    开源项目

    • 项目分类
    • -
    • 全部分类
    • -
    • 项目分类
    • -
    • 项目分类
    • +
    • setTypeId(0)}>全部分类
    • + { + typeList && typeList.length>0 && + typeList.map((i,k)=>{ + return( +
    • setTypeId(i.id)}>{i.name}
    • + ) + }) + }
    setValue(e.target.value)} + onSearch={()=>setSearchName(value)} + allowClear={true} size={'large'} placeholder="请输入项目名称" style={{width:645}} enterButton={搜索} /> - + {/* 排序 - + */}
    -
    -
    - -
    -

    - GitLink/React-Build -

      -
    • 333
    • -
    • 22
    • -
    • 31
    • -
    -

    -
    - Gitlink平台,前端编译好的文件,直接将该文件放入后端项目中的public/react/build/目录下即可,如果没有build目录,直接将该入后端项目中的public/react/build/目录下即可,如果没有build目录,直接将该文件放入后端项直接将该文件放入后端 -
    -
      -
    • html
    • -
    • javascript
    • -
    -
    + +
    pageSize ?"in_box_line":""}`}> + { + lists && lists.length>0 ? + lists.map((i,k)=>{ + return( +
    + {i.projectProperties && } +
    +

    + {i.fullName} + { + i.projectProperties && +

      + {/*
    • 333
    • */} + { i.projectProperties.praisesCount > 0 &&
    • {i.projectProperties.praisesCount}
    • } + { i.projectProperties.forkedCount > 0 &&
    • {i.projectProperties.forkedCount}
    • } +
    + } +

    + { + i.projectProperties && i.projectProperties.description && +
    + {i.projectProperties.description} +
    + } + { + i.projectProperties && i.projectProperties.topics && +
      + { + i.projectProperties.topics.split(",").map(t=>{ + return( +
    • {t}
    • + ) + }) + } +
    + } +
      + { i.deptName &&
    • {i.deptName}
    • } + { i.projectType &&
    • {i.projectType}
    • } + { i.projectProperties && i.projectProperties.timeAgo &&
    • 更新于{i.projectProperties.timeAgo}
    • } +
    +
    +
    + ) + }) + :"" + } + { + lists && lists.length === 0 && + }
    -
    + + { + total > pageSize && +
    + {setPage(page);window.scrollTo(0,0)}} total={total} showQuickJumper/> +
    + }
    diff --git a/src/forge/Information/img/contributebg.png b/src/forge/Information/img/contributebg.png new file mode 100644 index 000000000..7f1186a69 Binary files /dev/null and b/src/forge/Information/img/contributebg.png differ diff --git a/src/forge/Information/img/img1.png b/src/forge/Information/img/img1.png new file mode 100644 index 000000000..298bc6205 Binary files /dev/null and b/src/forge/Information/img/img1.png differ diff --git a/src/forge/Information/img/img2.png b/src/forge/Information/img/img2.png new file mode 100644 index 000000000..4ec0f6e37 Binary files /dev/null and b/src/forge/Information/img/img2.png differ diff --git a/src/forge/Information/img/productBg1.png b/src/forge/Information/img/productBg1.png new file mode 100644 index 000000000..9ff8025fa Binary files /dev/null and b/src/forge/Information/img/productBg1.png differ diff --git a/src/forge/Information/img/productBg2.png b/src/forge/Information/img/productBg2.png new file mode 100644 index 000000000..9e9405c31 Binary files /dev/null and b/src/forge/Information/img/productBg2.png differ diff --git a/src/forge/Information/index.jsx b/src/forge/Information/index.jsx index 4eb7bf71d..728a11699 100644 --- a/src/forge/Information/index.jsx +++ b/src/forge/Information/index.jsx @@ -1,4 +1,4 @@ -import React ,{ useEffect } from "react"; +import React ,{ useEffect , useState } from "react"; import { Route, Switch } from "react-router-dom"; import { withRouter } from "react-router"; @@ -9,9 +9,14 @@ import { TPMIndexHOC } from "../../modules/tpm/TPMIndexHOC"; import Loadable from "react-loadable"; import Loading from "../../Loading"; import axios from 'axios'; +import PublicBanner from "./Component/publicBanner"; import { isDev } from 'educoder'; import './index.scss'; +const HeaderPage = Loadable({ + loader: () => import("./Pages/headerPage"), + loading: Loading, +}); const ProjectSource = Loadable({ loader: () => import("./Pages/projectSource"), loading: Loading, @@ -29,6 +34,9 @@ const Main = Loadable({ loading: Loading, }); function Index(props){ + const [ data , setData ] = useState(undefined); + const { deptId } = props.match.params; + useEffect(()=>{ axios.interceptors.request.use( config => { @@ -48,15 +56,25 @@ function Index(props){ } ) },[]) + + useEffect(()=>{ + if(deptId){ + getDetail(); + } + },[deptId]) + + function getDetail(){ + const url = `/zone/open/${deptId}`; + axios.get(url).then(result=>{ + if(result){ + setData(result.data.data); + } + }).catch(console.error()) + } return(
    + - ( - - )} - > ( @@ -64,7 +82,13 @@ function Index(props){ )} > ( + + )} + > + ( )} @@ -75,6 +99,12 @@ function Index(props){
    )} > + ( + + )} + >
    ) diff --git a/src/forge/Information/index.scss b/src/forge/Information/index.scss index 143900ab5..36b2222d7 100644 --- a/src/forge/Information/index.scss +++ b/src/forge/Information/index.scss @@ -176,7 +176,10 @@ &:last-child{ border-bottom: none; } - & >div >img{ + &>img{ + width:184px; + } + & >div >img,&>img{ margin-right: 20px; height: 117px; max-width: 184px; @@ -267,6 +270,9 @@ li{ padding:0px!important; border:none!important; + &.ant-menu-item-selected{ + background-color: #fff; + } } } } @@ -396,10 +402,18 @@ margin-bottom: 5px; } .in_list_box{ + min-height: 40vh; + &.in_box_line > div:last-child{ + border-bottom: 1px dashed rgba(141, 149, 172, 0.27); + } &>div{ display: flex; align-items: flex-start; - padding:20px 0px; + padding:20px 0px 15px; + border-bottom: 1px dashed rgba(141, 149, 172, 0.27); + &:last-child{ + border-bottom: none; + } .author_img{ width: 66px; height: 66px; @@ -436,11 +450,13 @@ color: #4c5876; line-height: 26px; max-height: 52px; + word-break: break-all; + margin-bottom: 10px!important; } .in_b_tag{ - margin-top: 10px; display: flex; align-items: center; + margin-bottom: 15px!important; li{ height:24px; line-height:24px; @@ -452,6 +468,41 @@ padding:0px 7px; } } + .in_b_infos{ + display: flex; + align-items: center; + color:#6c7283; + font-size: 13px; + .infos_cate{ + padding: 0px 10px; + position: relative; + margin-right: 10px; + &::before{ + position: absolute; + left: 0px; + top: 50%; + margin-top: -3px; + content: ""; + width:6px; + height:6px; + background-color:#466aff; + border-radius: 50%; + } + &::after{ + content: ""; + right: 0px; + position: absolute; + bottom: 50%; + height: 10px; + margin-bottom: -5px; + width: 1px; + background-color:#6c7283; + } + } + } + .infos_language{ + margin-right: 30px; + } } } } @@ -467,13 +518,14 @@ position: relative; padding-left: 34px; font-size:16px; - font-weight:500; cursor: pointer; color:#3d485d; &.u_t{ font-weight:700; color:#1f2329; font-size:18px; + font-weight:500; + cursor: default; } &.active{ color:#466aff; @@ -489,4 +541,210 @@ } } } +} +// -------------首页 +.zone_box{ + padding-top:70px; + background-color:#f7f9fc; + .zone_infos{ + background-color: #fff; + display: flex; + align-items: center; + margin-top: 54px; + &>img{ + border-radius: 0px 4px 4px 0px; + } + .zone_infos_desc{ + padding:0px 34px; + flex: 1; + .z_name{ + color:#1f2329; + font-size:20px; + height: 28px; + line-height: 28px; + margin-bottom: 35px!important; + } + .z_desc{ + color:#3d485d; + font-size:14px; + line-height:32px; + } + } + } + .zone_news{ + background-image: url(./img/productBg1.png); + background-size: 100% 100%; + min-height: 764px; + margin-top: 80px; + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + .zone_n_title{ + color:#1f2329; + font-size:17px; + height: 24px; + line-height: 24px; + } + .zone_n_desc{ + color:#4c5876; + font-size:14px; + line-height:27px; + margin-top: 15px; + word-break: break-all; + } + .zone_n_value{ + display: flex; + align-items: center; + justify-content: space-between; + height: 20px; + line-height: 20px; + margin-top: 15px; + } + .zone_new_first{ + background-color: #fff; + padding:30px; + flex:1; + border-radius: 4px; + } + .zone_new_three{ + margin-left: 30px; + display: flex; + flex-direction: column; + justify-content: space-between; + li{ + background-color: #fff; + width: 385px; + padding:20px; + border-radius: 4px; + &:last-child{ + margin-bottom: 0px; + } + } + } + } + .zone_projects{ + background-image:linear-gradient(180deg,#f9fbfe 0%,#ffffff 100%); + padding:70px 0px 80px; + .zone_p_lists{ + display: flex; + flex-wrap: wrap; + li{ + margin:0px 80px 30px 0px!important; + background-color:#fefefe; + border:2px solid; + border-color:#ffffff; + border-radius:4px; + box-shadow:0px 0px 15px rgba(35, 54, 185, 0.09); + width: 560px; + padding:35px 30px; + box-sizing: border-box; + display: flex; + align-items: flex-start; + &:nth-child(2n){ + margin-right: 0px!important; + } + &>img{ + width: 75px; + height: 75px; + border-radius: 8px; + margin-right: 14px; + } + &>div{ + flex:1; + .z_p_title{ + font-weight:700; + color:#1f2329; + font-size:16px; + margin-bottom: 10px!important; + height: 22px; + line-height: 22px; + display: block; + } + .z_p_desc{ + color:#4c5876; + font-size:14px; + line-height:22px; + word-break: break-all; + } + } + } + } + } + .zone_contributor{ + min-height: 466px; + background-image: url(./img/productBg2.png); + background-size: 100% 100%; + width: 100%; + padding:44px 0px 58px; + .zone_c_lists{ + display: flex; + align-items: center; + margin-top: 50px; + justify-content: space-between; + li{ + padding:17px 13px; + background-image: url(./img/contributebg.png); + width: 268px; + height: 268px; + border:1px solid #fff; + display: flex; + flex-direction: column; + align-items: center; + &>img{ + width: 80px; + height: 80px; + border-radius: 50%; + margin-bottom: 16px; + } + &>span{ + color:#000000; + font-size:16px; + display: flex; + text-align: center; + height: 22px; + line-height: 22px; + margin-bottom: 10px!important; + } + &>p{ + color:#4c5876; + font-size:14px; + line-height:26px; + text-align:center; + -webkit-line-clamp: 3; + } + } + } + } + .zone_parter{ + background-color: #fff; + padding:70px 0px 90px; + .zone_part_lists{ + display: flex; + flex-wrap: wrap; + margin-top: 70px; + li{ + width: 170px; + height: 70px; + line-height: 70px; + margin-left: 36px; + margin-bottom: 30px!important; + color:#1f2329; + font-size:20px; + text-align: center; + background-color:#ffffff; + border-radius:8px; + box-shadow:0px 0px 15px rgba(28, 48, 175, 0.08); + &:first-child,&:nth-child(12){ + margin-left: 0px; + } + &:nth-child(7){ + margin-left: 103px; + } + &:nth-child(11){ + margin-right: 103px; + } + } + } + } } \ No newline at end of file diff --git a/src/forge/css/index.scss b/src/forge/css/index.scss index 9d36571d6..7066e01fa 100644 --- a/src/forge/css/index.scss +++ b/src/forge/css/index.scss @@ -163,7 +163,6 @@ ul,ol,dl{ text-align: center; min-height: 320px; padding:40px 0px; - margin-bottom: 50px; display: flex; justify-content: center; align-items: center;