Merge pull request '代码库二级页面改版-测试-提交,发行版' (#36) from durian/forgeplus-react:feature_repo_second_page_xiesi into feature_repo_second_page

This commit is contained in:
durian 2021-09-28 15:53:02 +08:00
commit 28bc235b0b
5 changed files with 16 additions and 17 deletions

View File

@ -125,7 +125,7 @@
"scripts": {
"start": "node --max_old_space_size=15360 scripts/start.js",
"build": "cross-env NODE_ENV=production node --max_old_space_size=15360 scripts/build.js",
"test-build": "NODE_ENV=testBuild node --max_old_space_size=15360 scripts/build.js",
"test-build": "cross-env NODE_ENV=testBuild node --max_old_space_size=15360 scripts/build.js",
"pre-build": "NODE_ENV=preBuild node --max_old_space_size=15360 scripts/build.js",
"gen_stats": "NODE_ENV=production webpack --profile --config=./config/webpack.config.prod.js --json > stats.json",
"ana": "webpack-bundle-analyzer ./stats.json",

View File

@ -29,12 +29,12 @@ function timeFormat(seconds) {
//代码库--提交页面
class CoderRootCommit extends Component{
constructor(props){
super(props)
super(props);
this.state={
commitDatas:undefined,
dataCount:undefined,
limit:10,
page:1,
page: 1,
isSpining:false,
branchList:undefined
}
@ -43,12 +43,8 @@ class CoderRootCommit extends Component{
componentDidMount=()=>{
this.Init();
this.getBranchs();
// goBack
// addEventListener
}
// componentde
// 获取分支列表
getBranchs=()=>{
const { projectsId , owner } = this.props.match.params;
@ -157,7 +153,7 @@ class CoderRootCommit extends Component{
<div className="commitList-item f-wrap-between">
<div>
<AlignTop>
<div className="commitDesc"><Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}?page=${page}`} className="font-14 color-grey-3 font-bd">{item.message}</Link></div>
<div className="commitDesc"><Link to={{pathname:`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}`,query:{page:page}}} className="font-14 color-grey-3 font-bd">{item.message}</Link></div>
</AlignTop>
<p className="f-wrap-alignCenter mt15">
<User
@ -174,7 +170,7 @@ class CoderRootCommit extends Component{
<div>
<span className="treecopy-cont shadow">
<img src={Tree} alt="sha" width={"16px"}/>
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}?page=${page}`}>{truncateCommitId(`${item.sha}`)}</Link>
<Link to={{pathname:`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}`,query:{page:page}}}>{truncateCommitId(`${item.sha}`)}</Link>
<input type="text" id={`value${k}`} value={`${truncateCommitId(`${item.sha}`)}`} disabled/>
</span>
<CopyTool beforeText="复制commit id" afterText="复制成功" inputId={`value${k}`}/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

View File

@ -100,9 +100,12 @@ function version(props) {
<a href={item.zipball_url}><i className="iconfont icon-wenjian7 font-14 mr10 color-grey-3"></i>{item.tag_name}.ZIP</a>
</p>
{/* 发行版附件下载 */}
{/* {item.attachments.length !=0 && <p className="versionFile">
<span>附件</span> */}
{item.attachments && item.attachments.map((item)=>{
return(<a href={`/${owner}/${projectsId}${item.url}`}><i className="iconfont icon-wenjian7 font-14 mr10 color-grey-3"></i>{item.title}</a>)
return(<Link to={`${item.url}`}><i className="iconfont icon-wenjian7 font-14 mr10 color-grey-3"></i>{item.title}</Link>)
})}
{/* </p>} */}
</div>
</div>
)

View File

@ -1,22 +1,22 @@
import React ,{useEffect,useState } from 'react';
import React ,{useEffect,useRef,useState } from 'react';
import { truncateCommitId } from '../common/util';
import { AlignCenter , FlexAJ } from '../Component/layout';
import { Button, Tooltip,Progress, Popover, Anchor } from 'antd';
import './merge.css';
import './Index.scss';
const {Link} =Anchor;
function Files({data,history,owner,projectsId}){
function Files(props){
const { data,history,owner,projectsId } = props;
const [ files , setFiles ] = useState(data && data.files);
const [ copyfileTipTitle, setCopyfileTipTitle] = useState("复制文件路径");
const [ isOpen, setIsOpen] = useState(false);
const commitPage = history && history.location && history.location.query && history.location.query.page;
useEffect(()=>{
if(data){
setFiles(data.files);
}
},[data])
},[data]);
function showDown(flag,index,isBin){
if(!isBin){