Merge pull request '0908上线' (#575) from durian/forgeplus-react:feature_news into pre_gitlink_server

This commit is contained in:
durian 2023-09-08 14:41:17 +08:00
commit bcfdfdc1dc
10 changed files with 98 additions and 48 deletions

View File

@ -18,6 +18,10 @@ const Name = styled.div`{
height:22px;
line-height:22px;
margin-bottom:7px;
width: 170px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}`
const Time = styled.div`{
color:#888;

View File

@ -198,7 +198,7 @@ function ProjectSource(props) {
<span>{item.titleStr}</span>
);
return (
<TreeNode title={title} key={item.key + ""} dataRef={item} className='menuHcNode font-15'>
<TreeNode title={title} key={item.key + ""} isLeaf={item.isFile} dataRef={item} className='menuHcNode font-15'>
{renderTreeNodes(item.children)}
</TreeNode>
);
@ -214,16 +214,18 @@ function ProjectSource(props) {
{
wikiList && (wikiList.length > 0 ? <Box className='zoneHelpBox'>
{/* wiki目录导航 */}
<div className='leftMenuHC mr20'>
<Search
allowClear
placeholder="输入关键字搜索文件"
className="searchHC mb10"
onSearch={changeSearchValue}
/>
<DirectoryTree onSelect={selectTree} expandedKeys={expandedKeys} onExpand={onExpand} autoExpandParent={autoExpandParent} showIcon={false}>
{renderTreeNodes(initMenuList)}
</DirectoryTree>
<div className='leftMenuBox mr20'>
<div className='leftMenuHC'>
<Search
allowClear
placeholder="输入关键字搜索文件"
className="searchHC mb10"
onSearch={changeSearchValue}
/>
<DirectoryTree onSelect={selectTree} expandedKeys={expandedKeys} onExpand={onExpand} autoExpandParent={autoExpandParent} showIcon={false}>
{renderTreeNodes(initMenuList)}
</DirectoryTree>
</div>
</div>
{/* 内容区 */}
{wikiDetail && <LongWidth className='wikiContentBox'>

View File

@ -1,5 +1,5 @@
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 { Link } from 'react-router-dom';
import axios from 'axios';
@ -7,6 +7,7 @@ import { getSourceTypeList , getSourceList , getSourceZoneList } from '../api';
import Nodata from '../../Nodata';
import ImgGreen from '../img/green_nodata.png';
import '../indexZone1.scss';
import { FlexAJ } from '../../Component/layout';
const { Search } = Input;
@ -53,7 +54,7 @@ function Source(props){
function getLists(){
setIsSpin(true);
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=>{
if(response){
setSourceList(response.data.rows);
@ -98,7 +99,7 @@ function Source(props){
{
zoneList.map((i,k)=>{
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>
)
})
}
@ -114,7 +115,7 @@ function Source(props){
{
typeList.map((i,k)=>{
return(
<li key={k} onClick={()=>{setChooseTypeId(i.id);window.scrollTo(0,450)}} className={chooseTypeId && chooseTypeId === i.id ? "active":"" }>{i.name}</li>
<li key={k} onClick={()=>{setChooseTypeId(i.id);window.scrollTo(0,450)}} className={`${chooseTypeId && chooseTypeId === i.id ? "active":""} task-hide`}>{i.name}</li>
)
})
}
@ -138,12 +139,19 @@ function Source(props){
{i.summary}
</p>
<div className="s_infos">
<p className="load_count">
<img src={SourceIcon} alt="" width="18px" className="mr5"/><span style={{color:"#5e6685"}}>{i.downloadCount}</span>
</p>
<FlexAJ>
{temp === "zone" && <span className='domainNameBox task-hide'>{i.domainName}</span>}
<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">
<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>
}
</div>

View File

@ -7,6 +7,8 @@ import { Link } from 'react-router-dom';
import axios from 'axios';
import { Base64 } from 'js-base64';
import { httpUrl } from '../fetch';
import { AlignCenter, FlexAJ } from '../../Component/layout';
import SourceIcon from '../img/sourceIcon.png';
function SourceDetail(props){
@ -36,7 +38,21 @@ function SourceDetail(props){
{
detail &&
<div className="source_detail_box">
<div className="s_d_title">{detail.name}</div>
<div className="s_d_title">
<FlexAJ>
<AlignCenter style={{flex: 1}}>
<span className='domainNameBoxD font-13 mr15'>{detail.domainName}</span>
<span className='font-22' style={{flex: 1}}>{detail.name}</span>
</AlignCenter>
<div className="load_count">
<img src={SourceIcon} alt="" width="18px" className="mr5" style={{marginTop: '-4px'}}/><span style={{color:"#5e6685"}}>{detail.downloadCount}</span>
</div>
</FlexAJ>
{detail.createUser && detail.createUser.avatar && <Link to={`/${detail.createUser.userName}`}><img alt='' src={detail.createUser.avatar} className='publicUserAvatar mr10'/></Link>}
{detail.createUser && <Link className='mr20' to={`/${detail.createUser.userName}`}>{detail.createUser.nickName}</Link>}
<span>发布于{detail.updateTime || detail.createTime}</span>
</div>
<div className='pb20'>{detail.summary}</div>
{
detail.fileList && detail.fileList.length > 0 &&
<ul className="files_box">
@ -46,6 +62,7 @@ function SourceDetail(props){
<li>
<img src={SourceFile} alt="" width="20px" className="mr12"/>
<span className="task-hide">{i.fileOriginName}</span>
<span style={{width: '340px'}}>{i.zoneResourceType.name}</span>
<span>{i.fileSizeInfo}</span>
<a href={`${httpUrl}/file/open/download/${i.fileId}`} download className="f_b_load primaryColor">下载</a>
</li>
@ -54,16 +71,6 @@ function SourceDetail(props){
}
</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>

View File

@ -1380,18 +1380,33 @@
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{
background-color: #fff;
padding:10px 35px 30px;
padding:10px 35px 70px 30px;
.s_d_title{
padding:25px 0px;
padding:20px 0px 10px;
border-bottom: 1px dashed rgba(141, 149, 172, 0.27);
color:#1f2329;
font-size:22px;
margin-bottom: 20px!important;
&>span{
color: #4c5876;
}
.publicUserAvatar{
width: 24px;
border-radius: 50%;
margin-top: -3px;
}
}
.files_box{
padding:11px 30px;
@ -1405,24 +1420,34 @@
font-size:15px;
min-width: 190px;
&.task-hide{
width: 500px;
width: 450px;
margin-right: 20px;
}
}
}
}
.domainNameBoxD{
display: inline-block;
border:1px solid var(--primary-color);
border-radius:2px;
height: 28px;
padding: 0px 12px;
color: var(--primary-color);
}
}
// 帮助中心
.zoneHelpBox{
.leftMenuBox{
background: #ffffff;
padding: 25px 18px 25px 15px;
}
.leftMenuHC{
width: 290px;
min-height: 500px;
overflow-x: auto;
&::-webkit-scrollbar{
display: none;
}
background: #ffffff;
padding: 25px 15px;
// &::-webkit-scrollbar{
// display: none;
// }
.ant-tree.ant-tree-directory > .menuHcNode span.ant-tree-node-content-wrapper.ant-tree-node-selected, .ant-tree.ant-tree-directory .ant-tree-child-tree > .menuHcNode span.ant-tree-node-content-wrapper.ant-tree-node-selected{
color: var(--primary-color);
}
@ -1445,6 +1470,9 @@
.searchHC .ant-input-search-icon:hover{
color: var(--primary-color);
}
.ant-tree li span.ant-tree-switcher{
width: 10px;
}
}
.wikiTitleHC{
font-weight: 700;

View File

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

View File

@ -112,7 +112,7 @@ class MergeItem extends Component {
<Tag className="pr-branch-tag">
<Link
to={`/${item.is_original ? item.fork_project_user : owner}/${ item.is_original ? item.fork_project_identifier : projectsId }/tree/${turnbar(item.pull_request_head)}`}
className="maxW200px task-hide ver-middle" style={{maxWidth:"200px"}}
className="maxW200px task-hide ver-middle" style={{maxWidth:"300px"}}
>
{item.is_original
? item.fork_project_user_name
@ -136,7 +136,7 @@ class MergeItem extends Component {
<Tag className="pr-branch-tag">
<Link
to={`/${owner}/${projectsId}/tree/${turnbar(item.pull_request_base)}`}
className="maxW200px task-hide ver-middle" style={{maxWidth:"200px"}}
className="maxW200px task-hide ver-middle" style={{maxWidth:"300px"}}
>
{project_author_name}: {item.pull_request_base}
</Link>

View File

@ -406,7 +406,7 @@ class MessageCount extends Component {
<Tag className="pr-branch-tag">
<Link
to={`/${data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author}/${data.pull_request.is_original?data.project_identifier:projectsId}/tree/${turnbar(data.pull_request && data.pull_request.head)}`}
className="ver-middle task-hide" style={{maxWidth:"200px"}} title={`${data.pull_request.fork_project_user}: ${data.pull_request && data.pull_request.head}`}
className="ver-middle task-hide" style={{maxWidth:"300px"}} title={`${data.pull_request.fork_project_user}: ${data.pull_request && data.pull_request.head}`}
>
{data.pull_request && data.pull_request.fork_project_user}: {data.pull_request && data.pull_request.head}
</Link>
@ -421,7 +421,7 @@ class MessageCount extends Component {
<Tag className="pr-branch-tag">
<Link
to={`/${owner}/${projectsId}/tree/${data.pull_request.base}`}
className="ver-middle task-hide" style={{maxWidth:"200px"}} title={`${data.issue.project_author_name}:${data.pull_request.base}`}
className="ver-middle task-hide" style={{maxWidth:"300px"}} title={`${data.issue.project_author_name}:${data.pull_request.base}`}
>
{data.issue.project_author}: {data.pull_request.base}
</Link>

View File

@ -242,12 +242,12 @@ function EditRepoApplyInfo(props) {
{ pattern: emailreg, message: "请输入正确的邮箱地址"},],
<Input placeholder="输入项目联系人邮箱" onBlur={()=>{verify("name")}}/>
)}
<div className='introArea'>{helper('社区简介',
<div className='introArea'>{helper('项目简介',
'',
'projectIntro',
[{ required: true, message: "请输入社区简介" },
[{ required: true, message: "请输入项目简介" },
{ max: 200, message: '超出限制长度200位字符请重新编辑' }],
<TextArea placeholder="请输入社区简介" onBlur={()=>{verify("intro")}} rows={4}/>
<TextArea placeholder="请输入项目简介" onBlur={()=>{verify("intro")}} rows={4}/>
)}</div>
<div className='introArea'>{helper('项目logo',
'限制上传格式为png、jpg、jpeg限制20M。建议上传大小为382*228',

View File

@ -103,7 +103,8 @@ function Register(props){
callback();
}else{
setGetCaptchaBut(false);
callback(response.data.status === -2 ? `${registerType ? '邮箱' : '手机号'}已被注册` : response.data.message);
// callback(response.data.status === -2 ? `${registerType ? '' : ''}` : response.data.message);
callback(response.data.message);
}
}):callback();setEmailStr(undefined);
}else{