Merge pull request '0707里程碑issue' (#559) from Eeeros/forgeplus-react:cs_news into cs_news

This commit is contained in:
caishi 2023-07-07 16:02:45 +08:00
commit 506fa76c5f
17 changed files with 48 additions and 20 deletions

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,7 @@ import 'code-prettify';
import dompurify from 'dompurify';
import { getEmoji } from '../forge/Main/emoji';
import axios from 'axios';
import imgError from '../images/img-error.png'
import { renderToString } from 'katex'
@ -80,9 +81,10 @@ export default ({
const { type, expression } = math_expressions[capture];
return renderToString(_unescape(expression) || '', { displayMode: type === 'block', throwOnError: false, output: 'html' })
})
rs = rs.replace(/▁/g, "▁▁▁")
rs = dompurify.sanitize(rs.replace(/▁/g, "▁▁▁"))
rs = rs.replaceAll('<img ', `<img onerror="javascript:this.src='${ imgError }';"`)
resetMathExpressions()
return dompurify.sanitize(rs)
return rs
}, [str,issues]);
// #id

View File

@ -14,7 +14,7 @@ function DefaultImg({name,title}){
<img src={require(`../img/color${randomNumberInRange(1,4)}.png`).default} alt="" className="color" />
<span className="d_name">
<span>{name}</span>
<span>{title}</span>
{/* <span>{title}</span> */}
</span>
</div>
)

View File

@ -24,7 +24,7 @@ function Partner(props) {
function getUnit(array){
const newArray = array
setMoreTypes(array.length > 0)
setMoreTypes(array.length > 1)
while(newArray[1] && newArray[1].length + newArray[0].length <= 5) {
newArray[0] = [...newArray[0], ...newArray.splice(1, 1)[0]]
@ -44,7 +44,12 @@ function Partner(props) {
return(
<div className="zone_part_item" key={ k1 }>
{ j.typeName && moreTypes && <span className="task-hide">{j.typeName}</span>}
<a key={ k1 } href={j.link} target="_blank"><img src={j.logo} alt=""/></a>
{
j.link ? <a key={ k1 } href={ j.link } target="_blank" ><img src={j.logo} alt=""/></a>
:
<div><img src={j.logo} alt=""/></div>
}
</div>
)
})

View File

@ -41,7 +41,7 @@ function PublicBanner(props){
data &&
<div className="zone_content">
<p className="main_t">{data.mainTitle}</p>
<p className="sub_t">{data.subTitle}</p>
<p className="sub_t" dangerouslySetInnerHTML={{ __html: data.subTitle }}></p>
</div>
}
<div className="bannerMenus">

View File

@ -77,7 +77,7 @@ function HeaderPage(props){
<div className="boxmain zone_infos">
<div className="zone_infos_desc">
{data.introductionTitle && <p className="z_name">{data.introductionTitle}</p>}
<p className="z_desc task-hide-2" style={{WebkitLineClamp:data.introductionTitle?"4":"7"}}>{data.introductionContent}</p>
<p className="z_desc task-hide-2" style={{WebkitLineClamp:data.introductionTitle?"4":"7"}} dangerouslySetInnerHTML={{ __html: data.introductionContent }} ></p>
</div>
{
data.introductionImage &&

View File

@ -129,7 +129,7 @@ function HeaderPage(props){
<div className="boxmain zone_infos mb30">
<div className="zone_infos_desc">
<p className="z_name">{data.introductionTitle}</p>
<p className="z_desc task-hide-2">{data.introductionContent}</p>
<p className="z_desc task-hide-2" dangerouslySetInnerHTML={{ __html: data.introductionContent }} ></p>
</div>
{
data.introductionImage &&

View File

@ -32,7 +32,9 @@ function NewsDetail(props){
setContent(Base64.decode(data.content));
setIsSpin(false)
}
}).catch(error=>{})
}).catch(error=>{
setIsSpin(false)
})
}
return(
<div className="detail_news_all">
@ -50,7 +52,7 @@ function NewsDetail(props){
<p className="i_name">{detail.name}</p>
<ul className="i_ul_value">
{ cmsDir && <li><a href={ detail.publishUserUrl } ><img src={ detail.publishUserImage } alt="" className="headimg" /> { detail.publishUserNickname }</a></li> }
{ cmsDir && <li>发布于{detail.publishTime}</li> }
{ cmsDir && <li>{ detail.isFirstPublish ? '创建于' : '更新于' }{detail.publishTime}</li> }
{ detail.visits && <li><img src={liulan} alt="" className="mr5" />{detail.visits}</li> }
</ul>
</div>

View File

@ -101,7 +101,7 @@ function Index(props){
}
return(
<div className="information_main">
{ id && <PublicBanner {...props} data={data} temp={ temp } adminUrl={adminUrl}/> }
{ id ? <PublicBanner {...props} data={data} temp={ temp } adminUrl={adminUrl}/> : <div style={{ width: '100%', height: '450px' }}></div>}
<Switch>
<Route
path="/zone/:deptId/news/:cateId"

View File

@ -50,6 +50,7 @@
line-height:40px;
color:rgba(225,225,225,0.9);
font-size:16px;
white-space: pre-wrap;
}
}
.bannerMenus{
@ -692,6 +693,7 @@
line-height:32px;
word-break: break-all;
-webkit-line-clamp: 4;
white-space: pre-wrap;
}
}
}
@ -1068,7 +1070,7 @@
display: inline-block;
width: 200px;
}
a {
a, div {
display: inline-block;
width: 220px;
height: 88px;
@ -1084,6 +1086,7 @@
box-shadow:0px 0px 15px rgba(28, 48, 175, 0.08);
transition: 0.1s linear;
img{
max-width: 180px;
max-height: 66px;
}
&:hover {
@ -1128,7 +1131,7 @@
&>div{
overflow: hidden;
height: 100%;
width: 100vw;
// width: 100vw;
position: relative;
background-repeat: no-repeat;
background-size: 100% 100%;

View File

@ -29,6 +29,7 @@
line-height:32px;
word-break: break-all;
-webkit-line-clamp: 4;
white-space: pre-wrap;
}
}
}
@ -121,8 +122,11 @@
font-size:14px;
line-height:27px;
word-break: break-all;
margin-top: 18px;
min-height: 56px;
}
.zone_n_value{
margin-top: 20px;
display: flex;
align-items: center;
justify-content: space-between;
@ -170,8 +174,11 @@
.zone_new_three{
width: 1200px;
display: flex;
justify-content: space-between;
justify-content: flex-end;
margin: 0 auto;
& > div:not(:first-child) {
margin-left: 70px;
}
li{
background-color: #fff;
width: 354px;

View File

@ -34,7 +34,7 @@ $primary-color:#466aff;
text-align: center;
}
}
.contentBox{
.contentForm{
padding:20px 20px 0px 20px;
& > div{
margin-bottom: 20px;

View File

@ -76,7 +76,7 @@ function Team(props){
</div>
{
list && list.length > 0 ?
<div className="contentBox">
<div className="contentForm">
{
list.map((item,key)=>{
return(

View File

@ -40,8 +40,8 @@ console.log('FreeProject');
</div>
<div className="head_introduce mt30 mb30">
<h4 className="head_tit">申请说明</h4>
<div className="head_content">1参与GitLink编程夏令营无奖金项目的同学请通过邮件或电话与课题导师直接沟通并根据导师课题要求完成课题无需在GLCC平台报名课题</div>
<div className="head_content">2参与GitLink编程夏令营无奖金项目的同学如完成课题并经导师评定通过获得证书或证明1但无课题奖金</div>
<div className="head_content">1参与GitLink编程夏令营无奖金项目的同学<span className='head_bold'>请通过邮件或电话与课题导师直接沟通并根据导师课题要求完成课题无需在GLCC平台报名课题</span></div>
<div className="head_content">2参与GitLink编程夏令营无奖金项目的同学如完成课题并经导师评定通过会在GLCC官网进行公示无奖金奖励</div>
<div className="head_content">3活动最终解释权归GLCC所有</div>
</div>
<Spin spinning={false}>

BIN
src/images/img-error.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@ -71,4 +71,13 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.editormd-editing{
border: 1px solid #ddd;
padding-bottom: 1px;
}
.editormd-editing .editormd{
border: none;
margin:0px auto;
overflow: unset;
}

View File

@ -120,7 +120,7 @@ export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, cla
// 请求issues接口获取全部可quote的issue列表
function getIssueList(keyword){
axios.get(`/v1/${owner}/${projectsId}/issues`,{params:{
only_name:true,keyword,sort_direction:"desc",sort_by:"issues.created_on"
only_name:true,keyword,sort_direction:"desc",sort_by:"issues.created_on",limit:500,page:1
}}).then(result=>{
if(result){
!keyword && setIssues(result.data.issues);