diff --git a/src/forge/Information/Component/publicBanner.jsx b/src/forge/Information/Component/publicBanner.jsx index 6bb64b595..33d6ab1f5 100644 --- a/src/forge/Information/Component/publicBanner.jsx +++ b/src/forge/Information/Component/publicBanner.jsx @@ -1,6 +1,5 @@ import React , { useState , useEffect } from 'react'; import { Menu } from 'antd'; -import banner from '../img/mainbanner.png' import { Link } from 'react-router-dom'; import { tempConfig } from '../tempInfo'; import TopEdition from './TopEdition' @@ -18,6 +17,7 @@ function PublicBanner(props){ const info = /[A-Za-z0-9]{0,}\/news/g; const infodetail = /[A-Za-z0-9]{0,}\/newdetail/g; const project = /[A-Za-z0-9]{0,}\/projects/g; + const source = /[A-Za-z0-9]{0,}\/source/g; const vip = /[A-Za-z0-9]{0,}\/VIP/g; if(pathname === `/zone/${deptId}`){ setKey("1"); @@ -25,6 +25,9 @@ function PublicBanner(props){ else if(project.test(pathname)){ setKey("2"); } + else if(source.test(pathname)){ + setKey("3"); + } else if(info.test(pathname) || infodetail.test(pathname)){ setKey("4"); } @@ -48,7 +51,7 @@ function PublicBanner(props){ 首页 开源项目 - {/* 资源发布 */} + 资源发布 { tempConfig[temp].mainTitle } {/* Sig小组 */} { tempConfig[temp].member } diff --git a/src/forge/Information/Pages/source.jsx b/src/forge/Information/Pages/source.jsx new file mode 100644 index 000000000..50fe33ed1 --- /dev/null +++ b/src/forge/Information/Pages/source.jsx @@ -0,0 +1,140 @@ +import React , { useEffect , useState } from 'react'; +import { Input , Pagination, Spin } from 'antd'; +import SourceIcon from '../img/sourceIcon.png'; +import { Link } from 'react-router-dom'; +import axios from 'axios'; +import { getSourceTypeList , getSourceList , getSourceZoneList } from '../api'; +import Nodata from '../../Nodata'; + +const { Search } = Input; + +function Source(props){ + const { deptId } = props.match.params; + const [ sourceList , setSourceList ] = useState(undefined); + const [ zoneList , setZoneList ] = useState(undefined); + const [ typeList , setTypeList ] = useState(undefined); + const [ chooseZoneId , setChooseZoneId ] = useState(undefined); + const [ chooseTypeId , setChooseTypeId ] = useState(undefined); + const [ page , setPage ] = useState(1); + const [ total , setTotal ] = useState(0); + const [ search , setSearch ] = useState(undefined); + const [ isSpin , setIsSpin ] = useState(true); + const limit = 20; + const { id , temp } = props; + + + useEffect(()=>{ + id && getLists(); + },[id,chooseTypeId,chooseZoneId,page,search]) + + useEffect(()=>{ + id && getZoneList(); + id && getTypeList(); + },[id]) + + function getZoneList(){ + getSourceZoneList(id).then(response=>{ + if(response && response.data){ + setZoneList(response.data.rows); + } + }).catch(error=>{}) + } + + function getTypeList(){ + getSourceTypeList(id).then(response=>{ + if(response && response.data){ + setTypeList(response.data.rows); + } + }).catch(error=>{}) + } + + function getLists(){ + setIsSpin(true); + getSourceList({ + id,pageSize:limit,pageNum:page,typeId:chooseTypeId,domainId:chooseZoneId,name:search + }).then(response=>{ + if(response){ + setSourceList(response.data.rows); + setTotal(response.data.total); + setIsSpin(false); + } + }).catch(error=>{}) + } + + + function onSourceSearch(value){ + setSearch(value); + setPage(1); + } + + return( +
+

资源发布

+
+ 搜索} + /> +
+
+
    +

    资源领域

    + { + zoneList && zoneList.length>0&& + zoneList.map((i,k)=>{ + return( +
  • {setChooseZoneId(i.id === chooseZoneId ?undefined : i.id)}} className={chooseZoneId && chooseZoneId === i.id ? "active":"" }>{i.name}
  • + ) + }) + } +

    资源类别

    + { + typeList && typeList.length>0&& + typeList.map((i,k)=>{ + return( +
  • {setChooseTypeId(i.id === chooseTypeId ?undefined : i.id)}} className={chooseTypeId && chooseTypeId === i.id ? "active":"" }>{i.name}
  • + ) + }) + } +
+ +
+ { + sourceList && sourceList.length > 0 && +
+ {sourceList.map((i,k)=>{ + return( +
+ {i.name} +

+ {i.introduction} +

+

{i.downloadCount}

+
+ ) + }) + } +
+ } + {sourceList && sourceList.length === 0 && +
+ +
+ } + { + total > limit && +
+ setPage(p)} showQuickJumper/> +
+ } +
+
+
+
+ ) +} +export default Source; \ No newline at end of file diff --git a/src/forge/Information/Pages/sourceDetail.jsx b/src/forge/Information/Pages/sourceDetail.jsx new file mode 100644 index 000000000..d51b70282 --- /dev/null +++ b/src/forge/Information/Pages/sourceDetail.jsx @@ -0,0 +1,67 @@ +import React , { useEffect , useState } from 'react'; +import { Breadcrumb } from 'antd'; +import SourceFile from '../img/sourceFile.png'; +import RenderHtml from '../../../components/render-html'; +import { getSourceDetail } from '../api'; + + +function SourceDetail(props){ + const { deptId , sourceid } = props.match.params; + const [ detail , setDetail ] = useState(undefined); + + useEffect(()=>{ + if(sourceid){ + getDetails(); + } + },[sourceid]) + + function getDetails(){ + getSourceDetail(sourceid).then(response=>{ + if(response){ + setDetail(response.data.data); + } + }).catch(error=>{}) + } + return( +
+ + 资源列表 + 详情页 + + { + detail && +
+
{detail.name}
+ { + detail.fileList && detail.fileList.length > 0 && +
    + { + detail.fileList.map((i,k)=>{ + return( +
  • + + {i.fileOriginName} + {i.fileSizeInfo} + 下载 +
  • + ) + }) + } +
+ } + + { detail.introduction && +
+ +
+ } +
+ } +
+ ) +} +export default SourceDetail; diff --git a/src/forge/Information/api.js b/src/forge/Information/api.js index e11159e88..80d2f30d5 100644 --- a/src/forge/Information/api.js +++ b/src/forge/Information/api.js @@ -98,4 +98,31 @@ export function applyJoin(id,data) { method: 'post', data: data }); +} + +// 资源模块 +export function getSourceTypeList(id){ + return fetch({ + url:`/zone/open/${id}/resourceType/list`, + method: 'get', + }) +} +export function getSourceZoneList(id){ + return fetch({ + url:`/zone/open/${id}/resourceDomain/list`, + method: 'get', + }) +} +export function getSourceList(params){ + return fetch({ + url:`/zone/open/${params.id}/resource/list`, + method: 'get', + params + }) +} +export function getSourceDetail(id){ + return fetch({ + url:`/zone/open/resource/detail/${id}`, + method: 'get' + }) } \ No newline at end of file diff --git a/src/forge/Information/img/sourceCardBack.png b/src/forge/Information/img/sourceCardBack.png new file mode 100644 index 000000000..427d682d1 Binary files /dev/null and b/src/forge/Information/img/sourceCardBack.png differ diff --git a/src/forge/Information/img/sourceFile.png b/src/forge/Information/img/sourceFile.png new file mode 100644 index 000000000..fecb37c53 Binary files /dev/null and b/src/forge/Information/img/sourceFile.png differ diff --git a/src/forge/Information/img/sourceIcon.png b/src/forge/Information/img/sourceIcon.png new file mode 100644 index 000000000..64a59ea90 Binary files /dev/null and b/src/forge/Information/img/sourceIcon.png differ diff --git a/src/forge/Information/img/zone1Menu3.png b/src/forge/Information/img/zone1Menu3.png new file mode 100644 index 000000000..e2043c097 Binary files /dev/null and b/src/forge/Information/img/zone1Menu3.png differ diff --git a/src/forge/Information/img/menu3.png b/src/forge/Information/img/zoneMenu3.png similarity index 100% rename from src/forge/Information/img/menu3.png rename to src/forge/Information/img/zoneMenu3.png diff --git a/src/forge/Information/index.jsx b/src/forge/Information/index.jsx index 33de4f597..4ae855792 100644 --- a/src/forge/Information/index.jsx +++ b/src/forge/Information/index.jsx @@ -15,10 +15,18 @@ import "slick-carousel/slick/slick.css"; import "slick-carousel/slick/slick-theme.css"; import { tempEnum } from "./tempInfo"; +const SourceDetail = Loadable({ + loader: () => import("./Pages/sourceDetail"), + loading: Loading, +}); const VIP = Loadable({ loader: () => import("./Pages/zoneVIP"), loading: Loading, }); +const Source = Loadable({ + loader: () => import("./Pages/source"), + loading: Loading, +}); const HeaderPage = Loadable({ loader: () => import("./Pages/headerPage"), loading: Loading, @@ -115,6 +123,18 @@ function Index(props){ )} > + ( + + )} + > + ( + + )} + > ( diff --git a/src/forge/Information/index.scss b/src/forge/Information/index.scss index cd9a04db2..4c8adf741 100644 --- a/src/forge/Information/index.scss +++ b/src/forge/Information/index.scss @@ -1221,4 +1221,108 @@ line-height: 32px; margin-bottom: 8px!important; } +} +.source_search_box{ + .ant-input-lg{ + border-color: #fff; + } +} +.sources{ + display: flex; + align-items: flex-start; + padding:45px 0px; + .source_left_ul{ + width: 610px; + background-image:linear-gradient(89.9deg,#f5f7fa 0%,#f5f7fa 70.54%,rgba(255, 255, 255, 0.97) 100%); + display: flex; + flex-direction: column; + align-items: flex-end; + padding:5px 0px; + margin-right: 6px; + p,li{ + height: 60px; + line-height: 60px; + padding-left: 34px; + width: 250px; + } + p{ + font-weight:700; + color:#1f2329; + font-size:18px; + } + li{ + border-right: 3px solid #fff; + font-weight:500; + color:#3d485d; + cursor: pointer; + font-size:16px; + &.active{ + border-color: var(--primary-color); + color: var(--primary-color); + background-image:linear-gradient(89.9deg,rgba(70, 106, 255, 0) 0%,rgba(70, 106, 255, 0.09) 100%); + } + } + } + .source_lists{ + width: 100%; + display: flex; + flex-wrap: wrap; + .source_lists_card{ + margin-left: 29px; + width: 286px; + min-height: 180px; + background-color: rgba(255, 255, 255, 0.986); + padding:20px; + margin-bottom: 29px; + position: relative; + background-image: url(./img/sourceCardBack.png); + background-size: 100% 100%; + border-radius: 2px; + a.task-hide{ + color:#1f2329; + font-size:16px; + height: 28px; + line-height: 28px; + display: block; + margin-bottom: 15px; + } + .desc{ + color:#4c5876; + height: 54px; + line-height: 27px; + margin-bottom: 14px!important; + } + } + } +} +.source_detail_box{ + background-color: #fff; + padding:10px 35px 30px; + .s_d_title{ + padding:25px 0px; + border-bottom: 1px dashed rgba(141, 149, 172, 0.27); + color:#1f2329; + font-size:22px; + margin-bottom: 20px!important; + } + .files_box{ + padding:11px 30px; + background-color:#f6f8fa; + li{ + display: flex; + align-items: center; + height: 42px; + &>span{ + color:#3d485d; + font-size:15px; + min-width: 190px; + &.task-hide{ + min-width: 400px; + } + } + &>a{ + color: var(--primary-color); + } + } + } } \ No newline at end of file