diff --git a/src/forge/Information/Component/publicBanner.jsx b/src/forge/Information/Component/publicBanner.jsx index 3a718caa..68519bd7 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 00000000..a85f41d0 --- /dev/null +++ b/src/forge/Information/Pages/source.jsx @@ -0,0 +1,160 @@ +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'; +import '../indexZone1.scss'; + +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( +
+
+

资源发布

+
+ 搜索 :undefined} + /> +
+
+
+
+
    +

    资源领域

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

    资源类别

    +
    + { temp === "zone1" &&
  • setChooseTypeId(undefined)} className={!chooseTypeId ?"active":""}>全部
  • } + { + 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} +

+ {temp === "zone1" &&

+ {i.domainName} + {i.typeName} +

+ } +
+ ) + }) + } +
+ } + {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 00000000..fec5bc5c --- /dev/null +++ b/src/forge/Information/Pages/sourceDetail.jsx @@ -0,0 +1,70 @@ +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'; +import { Link } from 'react-router-dom'; +import axios from 'axios'; + + +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 e11159e8..80d2f30d 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 00000000..427d682d 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 00000000..29cacb36 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 00000000..64a59ea9 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 00000000..e2043c09 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 f6d39c17..33cc40bf 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 c1f47f89..53782e39 100644 --- a/src/forge/Information/index.scss +++ b/src/forge/Information/index.scss @@ -1224,4 +1224,114 @@ line-height: 32px; margin-bottom: 8px!important; } +} +.zone_source_box{ + padding-top: 56px; + .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%); + } + } + } + .s_m_list{ + width: 945px; + } + .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; + } + } + } + } +} +.primaryColor{ + color: var(--primary-color)!important; } \ No newline at end of file diff --git a/src/forge/Information/indexZone1.scss b/src/forge/Information/indexZone1.scss index ff767f7e..e6984fd6 100644 --- a/src/forge/Information/indexZone1.scss +++ b/src/forge/Information/indexZone1.scss @@ -646,4 +646,120 @@ } } } +} +.zone1_source_box{ + padding-bottom: 30px; + .source_h{ + padding-top: 40px; + width: 100%; + height:280px; + background-image:linear-gradient(180deg,#f4f6fb 0%,#e8ebf1 100%); + } + .sources{ + margin-top: -97px; + .source_left_ul{ + width: 1200px; + margin:0px auto; + background-color:#fefefe; + border-radius:4px; + padding:30px 30px 6px; + .source_l_u{ + display: flex; + margin-bottom: 12px!important; + align-items: flex-start; + &>p{ + font-weight:400; + color:#1f2329; + font-size:16px; + line-height:22px; + height:22px; + margin-right: 20px; + } + &>div{ + flex:1; + display: flex; + flex-wrap: wrap; + li{ + cursor: pointer; + margin:0px 18px 12px!important; + font-weight:400; + color:#3d485d; + font-size:16px; + line-height:22px; + height:22px; + &.active{ + color: var(--primary-color); + } + } + } + } + } + .s_m_list{ + width: 1200px; + margin: 30px auto 0px; + background-color: #fff; + .source_lists{ + padding:0px 30px; + .source_lists_card{ + position: relative; + padding: 20px 0px 16px; + border-bottom: 1px dashed rgba(170, 175, 190,0.43); + &:last-child{ + border-bottom: none; + } + a.task-hide{ + display: block; + padding-right: 100px; + color:#1f2329; + font-size:16px; + height: 22px; + line-height: 22px; + } + .load_count{ + position: absolute; + right: 0px; + top:17px; + } + .desc{ + margin-top: 15px; + color:#4c5876; + line-height:26px; + } + .load_source{ + position: relative; + padding-left: 14px; + color:#8d95ac; + font-size:14px; + line-height:26px; + height:26px; + margin-top: 10px; + &::before{ + position: absolute; + content: ""; + background-color: var(--primary-color); + width: 8px; + height: 8px; + border-radius: 50%; + left: 0px; + top:50%; + margin-top: -4px; + } + &>span:last-child{ + padding-left: 21px; + position: relative; + &::before{ + position: absolute; + left: 10px; + height: 12px; + top: 1px; + content: ""; + width: 1px; + background-color: #8d95ac; + } + } + } + } + } + } + } } \ No newline at end of file