Merge branch 'feature_news' of https://gitlink.org.cn/durian/forgeplus-react into feature_websiteBuild

This commit is contained in:
谢思 2023-09-07 09:08:05 +08:00
commit 2fc5ae9667
4 changed files with 46 additions and 21 deletions

View File

@ -1,5 +1,5 @@
import React , { useEffect , useState } from 'react'; import React , { useEffect , useState } from 'react';
import { Input , Pagination, Spin } from 'antd'; import { Input , Pagination, Spin, Tag } from 'antd';
import SourceIcon from '../img/sourceIcon.png'; import SourceIcon from '../img/sourceIcon.png';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import axios from 'axios'; import axios from 'axios';
@ -7,6 +7,7 @@ import { getSourceTypeList , getSourceList , getSourceZoneList } from '../api';
import Nodata from '../../Nodata'; import Nodata from '../../Nodata';
import ImgGreen from '../img/green_nodata.png'; import ImgGreen from '../img/green_nodata.png';
import '../indexZone1.scss'; import '../indexZone1.scss';
import { FlexAJ } from '../../Component/layout';
const { Search } = Input; const { Search } = Input;
@ -53,7 +54,7 @@ function Source(props){
function getLists(){ function getLists(){
setIsSpin(true); setIsSpin(true);
getSourceList({ getSourceList({
id,pageSize:limit,pageNum:page,typeId:chooseTypeId,domainId:chooseZoneId,name:search id,pageSize:limit,pageNum:page,searchTypeId:chooseTypeId,domainId:chooseZoneId,name:search
}).then(response=>{ }).then(response=>{
if(response){ if(response){
setSourceList(response.data.rows); setSourceList(response.data.rows);
@ -98,7 +99,7 @@ function Source(props){
{ {
zoneList.map((i,k)=>{ zoneList.map((i,k)=>{
return( return(
<li key={k} onClick={()=>{setChooseZoneId(i.id);window.scrollTo(0,450)}} className={chooseZoneId && chooseZoneId === i.id ? "active":"" }>{i.name}</li> <li key={k} onClick={()=>{setChooseZoneId(i.id);window.scrollTo(0,450)}} className={`${chooseZoneId && chooseZoneId === i.id ? "active":""} task-hide`}>{i.name}</li>
) )
}) })
} }
@ -138,12 +139,19 @@ function Source(props){
{i.summary} {i.summary}
</p> </p>
<div className="s_infos"> <div className="s_infos">
<p className="load_count"> <FlexAJ>
<img src={SourceIcon} alt="" width="18px" className="mr5"/><span style={{color:"#5e6685"}}>{i.downloadCount}</span> {temp === "zone" && <span className='domainNameBox task-hide'>{i.domainName}</span>}
</p> <p className="load_count">
<img src={SourceIcon} alt="" width="18px" className="mr5" style={{marginTop: '-4px'}}/><span style={{color:"#5e6685"}}>{i.downloadCount}</span>
</p>
</FlexAJ>
{temp === "zone1" && <p className="load_source"> {temp === "zone1" && <p className="load_source">
<span>{i.domainName}</span> <span>{i.domainName}</span>
<span>{i.typeName}</span> {i.zoneResourceTypeList && <span>
{i.zoneResourceTypeList.reduce((pre, cur)=>{
return pre ? `${pre}, ${cur.name}` : cur.name
}, '')}
</span>}
</p> </p>
} }
</div> </div>

View File

@ -7,6 +7,8 @@ import { Link } from 'react-router-dom';
import axios from 'axios'; import axios from 'axios';
import { Base64 } from 'js-base64'; import { Base64 } from 'js-base64';
import { httpUrl } from '../fetch'; import { httpUrl } from '../fetch';
import { AlignCenter, FlexAJ } from '../../Component/layout';
import SourceIcon from '../img/sourceIcon.png';
function SourceDetail(props){ function SourceDetail(props){
@ -36,7 +38,16 @@ function SourceDetail(props){
{ {
detail && detail &&
<div className="source_detail_box"> <div className="source_detail_box">
<div className="s_d_title">{detail.name}</div> <FlexAJ className="s_d_title">
<AlignCenter>
<span className='domainNameBoxD font-13 mr15'>{detail.domainName}</span>
<span className='font-22'>{detail.name}</span>
</AlignCenter>
<p className="load_count">
<img src={SourceIcon} alt="" width="18px" className="mr5" style={{marginTop: '-4px'}}/><span style={{color:"#5e6685"}}>{detail.downloadCount}</span>
</p>
</FlexAJ>
<div className='pb20'>{detail.summary}</div>
{ {
detail.fileList && detail.fileList.length > 0 && detail.fileList && detail.fileList.length > 0 &&
<ul className="files_box"> <ul className="files_box">
@ -46,6 +57,7 @@ function SourceDetail(props){
<li> <li>
<img src={SourceFile} alt="" width="20px" className="mr12"/> <img src={SourceFile} alt="" width="20px" className="mr12"/>
<span className="task-hide">{i.fileOriginName}</span> <span className="task-hide">{i.fileOriginName}</span>
<span>{i.zoneResourceType.name}</span>
<span>{i.fileSizeInfo}</span> <span>{i.fileSizeInfo}</span>
<a href={`${httpUrl}/file/open/download/${i.fileId}`} download className="f_b_load primaryColor">下载</a> <a href={`${httpUrl}/file/open/download/${i.fileId}`} download className="f_b_load primaryColor">下载</a>
</li> </li>
@ -54,16 +66,6 @@ function SourceDetail(props){
} }
</ul> </ul>
} }
{ detail.introduction &&
<div style={{padding:"20px 0px"}}>
<RenderHtml
className="source_detail imageLayerParent"
value={detail.introduction ? Base64.decode(detail.introduction):""}
url={props.history.location}
/>
</div>
}
</div> </div>
} }
</div> </div>

View File

@ -1380,17 +1380,24 @@
margin-bottom: 14px!important; margin-bottom: 14px!important;
} }
} }
.domainNameBox{
border:1px solid var(--primary-color);
border-radius:2px;
height: 28px;
padding: 0px 12px;
color: var(--primary-color);
max-width: 70%;
}
} }
} }
} }
.source_detail_box{ .source_detail_box{
background-color: #fff; background-color: #fff;
padding:10px 35px 30px; padding:10px 35px 70px 30px;
.s_d_title{ .s_d_title{
padding:25px 0px; padding:25px 0px;
border-bottom: 1px dashed rgba(141, 149, 172, 0.27); border-bottom: 1px dashed rgba(141, 149, 172, 0.27);
color:#1f2329; color:#1f2329;
font-size:22px;
margin-bottom: 20px!important; margin-bottom: 20px!important;
} }
.files_box{ .files_box{
@ -1411,6 +1418,14 @@
} }
} }
} }
.domainNameBoxD{
display: inline-block;
border:1px solid var(--primary-color);
border-radius:2px;
height: 28px;
padding: 0px 12px;
color: var(--primary-color);
}
} }
// 帮助中心 // 帮助中心
.zoneHelpBox{ .zoneHelpBox{

View File

@ -721,7 +721,7 @@
align-items: center; align-items: center;
margin-top: 10px; margin-top: 10px;
.load_count{ .load_count{
margin-right: 10px; margin-right: 100px;
min-width: 68px; min-width: 68px;
} }
} }