forked from Gitlink/forgeplus-react
提交优化-发行版改版
This commit is contained in:
parent
5d83c85b2d
commit
1402029bfe
|
@ -1760,6 +1760,14 @@ a.decoration {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mb12 {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mb13 {
|
||||||
|
margin-bottom: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
.mb14 {
|
.mb14 {
|
||||||
margin-bottom: 14px;
|
margin-bottom: 14px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,9 @@ import styled from 'styled-components';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
export default ({ url , name , column , id , login })=>{
|
export default ({ url , name , column , id , login })=>{
|
||||||
console.log(url);
|
|
||||||
console.log(name);
|
|
||||||
console.log(id);
|
|
||||||
const Img = styled.span`
|
const Img = styled.span`
|
||||||
display:flex;
|
display:flex;
|
||||||
|
font-weight: bold;
|
||||||
${column && "flex-direction: column;text-align:center;"}
|
${column && "flex-direction: column;text-align:center;"}
|
||||||
align-items: center;
|
align-items: center;
|
||||||
& img{
|
& img{
|
||||||
|
@ -18,7 +16,6 @@ export default ({ url , name , column , id , login })=>{
|
||||||
${!column && `
|
${!column && `
|
||||||
& span{
|
& span{
|
||||||
margin-left:8px;
|
margin-left:8px;
|
||||||
font-weight: bold;
|
|
||||||
}`
|
}`
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -20,6 +20,12 @@ function returnbar(str){
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function timeFormat(seconds) {
|
||||||
|
const time = new Date(seconds*1000);
|
||||||
|
return time.getFullYear()+"-"+(time.getMonth()+1)+"-"+time.getDate()+" "+(time.getHours()+1)+":"+time.getMinutes();
|
||||||
|
}
|
||||||
|
|
||||||
//代码库--提交页面
|
//代码库--提交页面
|
||||||
class CoderRootCommit extends Component{
|
class CoderRootCommit extends Component{
|
||||||
constructor(props){
|
constructor(props){
|
||||||
|
@ -37,8 +43,12 @@ class CoderRootCommit extends Component{
|
||||||
componentDidMount=()=>{
|
componentDidMount=()=>{
|
||||||
this.Init();
|
this.Init();
|
||||||
this.getBranchs();
|
this.getBranchs();
|
||||||
|
// goBack
|
||||||
|
// addEventListener
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// componentde
|
||||||
|
|
||||||
// 获取分支列表
|
// 获取分支列表
|
||||||
getBranchs=()=>{
|
getBranchs=()=>{
|
||||||
const { projectsId , owner } = this.props.match.params;
|
const { projectsId , owner } = this.props.match.params;
|
||||||
|
@ -91,7 +101,8 @@ class CoderRootCommit extends Component{
|
||||||
image_url:item.author && item.author.image_url,
|
image_url:item.author && item.author.image_url,
|
||||||
sha:item.sha,
|
sha:item.sha,
|
||||||
time_from_now:item.time_from_now,
|
time_from_now:item.time_from_now,
|
||||||
message:item.message
|
message:item.message,
|
||||||
|
timestamp:item.timestamp
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@ -117,6 +128,7 @@ class CoderRootCommit extends Component{
|
||||||
})
|
})
|
||||||
this.getCommitList(branchName , page , limit);
|
this.getCommitList(branchName , page , limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
render(){
|
render(){
|
||||||
const { commitDatas , dataCount , limit , page , isSpining , branchList } = this.state;
|
const { commitDatas , dataCount , limit , page , isSpining , branchList } = this.state;
|
||||||
const { projectDetail, commit_class , defaultBranch } = this.props;
|
const { projectDetail, commit_class , defaultBranch } = this.props;
|
||||||
|
@ -145,35 +157,25 @@ class CoderRootCommit extends Component{
|
||||||
<div className="commitList-item f-wrap-between">
|
<div className="commitList-item f-wrap-between">
|
||||||
<div>
|
<div>
|
||||||
<AlignTop>
|
<AlignTop>
|
||||||
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}`} className="commitDesc font-14 color-grey-3 font-bd">{item.message}</Link>
|
<div className="commitDesc"><Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}?commitpage=${page}`} className="font-14 color-grey-3 font-bd">{item.message}</Link></div>
|
||||||
</AlignTop>
|
</AlignTop>
|
||||||
<p className="f-wrap-alignCenter mt15">
|
<p className="f-wrap-alignCenter mt15">
|
||||||
<User
|
<User
|
||||||
id = {item.id}
|
id={item.id}
|
||||||
url={(item.image_url && getImageUrl(`/${item.image_url}`))|| "https://dss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3025493530,1989042357&fm=26&gp=0.jpg"}
|
url={(item.image_url && getImageUrl(`/${item.image_url}`)) || "https://dss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3025493530,1989042357&fm=26&gp=0.jpg"}
|
||||||
name={item.name}
|
name={item.name}
|
||||||
|
login={item.login}
|
||||||
/>
|
/>
|
||||||
{item.time_from_now && <li className="ml4">提交于{item.time_from_now}</li>}
|
{item.timestamp && <label className="font-14 color-grey-3 ml3">提交于 {timeFormat(item.timestamp)}</label>}
|
||||||
{/* {
|
|
||||||
item.id ?
|
|
||||||
<Link to={`/${item.login}`} className="show-user-link">
|
|
||||||
{item.image_url?<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr8 radius"/>:""}
|
|
||||||
<label className="font-14 color-grey-3" style={{verticalAlign:'middle'}}><label className="font-bd" style={{cursor:"pointer"}}>{item.name ?`${item.name} `:""}</label>提交于 {item.time_from_now}</label>
|
|
||||||
</Link>:
|
|
||||||
<span className="show-user-link">
|
|
||||||
{item.image_url?<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr8 radius"/>:""}
|
|
||||||
<label className="font-14 color-grey-3" style={{verticalAlign:'middle'}}><label className="font-bd">{item.name ?`${item.name} `:""}</label>提交于 {item.time_from_now}</label>
|
|
||||||
</span>
|
|
||||||
} */}
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div className="treecopy">
|
<div className="treecopy">
|
||||||
<div className="shadow">
|
<div>
|
||||||
<span className="treecopy-cont">
|
<span className="treecopy-cont shadow">
|
||||||
<img src={Tree} alt="sha" width={"16px"}/>
|
<img src={Tree} alt="sha" width={"16px"}/>
|
||||||
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}`}>{truncateCommitId(`${item.sha}`)}</Link>
|
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}?commitpage=${page}`}>{truncateCommitId(`${item.sha}`)}</Link>
|
||||||
<input type="text" id={`value${k}`} value={`${truncateCommitId(`${item.sha}`)}`}/>
|
<input type="text" id={`value${k}`} value={`${truncateCommitId(`${item.sha}`)}`} disabled/>
|
||||||
</span>
|
</span>
|
||||||
<CopyTool beforeText="复制commit id" afterText="复制成功" inputId={`value${k}`}/>
|
<CopyTool beforeText="复制commit id" afterText="复制成功" inputId={`value${k}`}/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,11 +4,10 @@ import { Button ,Spin } from "antd";
|
||||||
import { truncateCommitId } from '../common/util';
|
import { truncateCommitId } from '../common/util';
|
||||||
import { getImageUrl } from 'educoder';
|
import { getImageUrl } from 'educoder';
|
||||||
import Files from '../Merge/Files';
|
import Files from '../Merge/Files';
|
||||||
|
|
||||||
import Tree from "./img/tree.png";
|
import Tree from "./img/tree.png";
|
||||||
import User from "../Component/User";
|
import User from "../Component/User";
|
||||||
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
|
|
||||||
const Infos = styled.div`
|
const Infos = styled.div`
|
||||||
border: 1px solid #FAFCFF;
|
border: 1px solid #FAFCFF;
|
||||||
|
@ -17,7 +16,7 @@ const Infos = styled.div`
|
||||||
background-color: #f1f8ff;
|
background-color: #f1f8ff;
|
||||||
border: 1px solid rgba(42, 97, 255, 0.23);
|
border: 1px solid rgba(42, 97, 255, 0.23);
|
||||||
border-radius: 3px 3px 0px 0px;
|
border-radius: 3px 3px 0px 0px;
|
||||||
padding: 10px 8px 10px 16px;
|
padding: 10px 20px 10px 16px;
|
||||||
& .f-wrap-between{
|
& .f-wrap-between{
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
@ -32,11 +31,14 @@ const Infos = styled.div`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
& > .f-wrap-between {
|
& > .f-wrap-between {
|
||||||
padding: 14px 8px 14px 16px;
|
padding: 14px 20px 14px 16px;
|
||||||
border-radius: 3px 3px 0px 0px;
|
border-radius: 3px 3px 0px 0px;
|
||||||
border: 1px solid #D0D0D0;
|
border: 1px solid #D0D0D0;
|
||||||
.df{
|
.df{
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
& .underline:hover{
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
@ -47,7 +49,7 @@ export default ({ match , history }) => {
|
||||||
const [parents, setParents] = useState(undefined);
|
const [parents, setParents] = useState(undefined);
|
||||||
const [committer, setCommitter] = useState(undefined);
|
const [committer, setCommitter] = useState(undefined);
|
||||||
const [isSpin, setIsSpin] = useState(true);
|
const [isSpin, setIsSpin] = useState(true);
|
||||||
|
console.log(match);
|
||||||
const { sha , projectsId, owner, branchName } = match.params;
|
const { sha , projectsId, owner, branchName } = match.params;
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (projectsId && owner && sha) {
|
if (projectsId && owner && sha) {
|
||||||
|
@ -68,6 +70,11 @@ export default ({ match , history }) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [projectsId , owner, sha]);
|
}, [projectsId , owner, sha]);
|
||||||
|
|
||||||
|
function timeFormat(seconds) {
|
||||||
|
const time = new Date(seconds*1000);
|
||||||
|
return time.getFullYear()+"-"+(time.getMonth()+1)+"-"+time.getDate()+" "+(time.getHours()+1)+":"+time.getMinutes();
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="main" style={{padding:"0px",border:"none"}}>
|
<div className="main" style={{padding:"0px",border:"none"}}>
|
||||||
|
@ -79,7 +86,7 @@ export default ({ match , history }) => {
|
||||||
{commit && commit.message &&
|
{commit && commit.message &&
|
||||||
<pre className="task-hide">{commit.message}</pre>
|
<pre className="task-hide">{commit.message}</pre>
|
||||||
}
|
}
|
||||||
<i className="iconfont icon-fenzhi2 font-18"></i>{branchName}
|
<Link to={`/${owner}/${projectsId}/tree/${branchName}`}><i className="iconfont icon-fenzhi2 font-18"></i>{branchName}</Link>
|
||||||
</div>
|
</div>
|
||||||
<Button type="primary" onClick={()=>{history.push(`/${owner}/${projectsId}/tree/${truncateCommitId(sha)}`)}} className="btnblue" style={{height:"36px"}}>浏览文件</Button>
|
<Button type="primary" onClick={()=>{history.push(`/${owner}/${projectsId}/tree/${truncateCommitId(sha)}`)}} className="btnblue" style={{height:"36px"}}>浏览文件</Button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -90,19 +97,9 @@ export default ({ match , history }) => {
|
||||||
id = {committer && committer.id}
|
id = {committer && committer.id}
|
||||||
url={(committer && getImageUrl(`/${committer.image_url}`))|| "https://dss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3025493530,1989042357&fm=26&gp=0.jpg"}
|
url={(committer && getImageUrl(`/${committer.image_url}`))|| "https://dss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3025493530,1989042357&fm=26&gp=0.jpg"}
|
||||||
name={committer && committer.name}
|
name={committer && committer.name}
|
||||||
|
login={committer && committer.login}
|
||||||
/>
|
/>
|
||||||
{commit && commit.time_from_now && <li className="ml4">提交于{commit.time_from_now}</li>}
|
{commit && commit.timestamp && <li className="ml4">提交于{timeFormat(commit.timestamp)}</li>}
|
||||||
{/* {
|
|
||||||
item.id ?
|
|
||||||
<Link to={`/${item.login}`} className="show-user-link">
|
|
||||||
{item.image_url?<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr8 radius"/>:""}
|
|
||||||
<label className="font-14 color-grey-3" style={{verticalAlign:'middle'}}><label className="font-bd" style={{cursor:"pointer"}}>{item.name ?`${item.name} `:""}</label>提交于 {item.time_from_now}</label>
|
|
||||||
</Link>:
|
|
||||||
<span className="show-user-link">
|
|
||||||
{item.image_url?<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr8 radius"/>:""}
|
|
||||||
<label className="font-14 color-grey-3" style={{verticalAlign:'middle'}}><label className="font-bd">{item.name ?`${item.name} `:""}</label>提交于 {item.time_from_now}</label>
|
|
||||||
</span>
|
|
||||||
} */}
|
|
||||||
</ul>
|
</ul>
|
||||||
<li className="df">
|
<li className="df">
|
||||||
{
|
{
|
||||||
|
@ -111,7 +108,7 @@ export default ({ match , history }) => {
|
||||||
<div className="ml40 f-wrap-alignCenter">
|
<div className="ml40 f-wrap-alignCenter">
|
||||||
<label className="mr8">父节点</label>
|
<label className="mr8">父节点</label>
|
||||||
<img src={Tree} alt="sha" width={"16px"} className="mr4"/>
|
<img src={Tree} alt="sha" width={"16px"} className="mr4"/>
|
||||||
<span>{truncateCommitId(item.sha)}</span>
|
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branchName}`} className="underline">{truncateCommitId(item.sha)}</Link>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
@ -5,15 +5,15 @@ import './version.scss';
|
||||||
function Empty({operation,addFunc}) {
|
function Empty({operation,addFunc}) {
|
||||||
return(
|
return(
|
||||||
<div className="emptyPanel color-grey-3">
|
<div className="emptyPanel color-grey-3">
|
||||||
<i className="iconfont icon-banbenicon font-50 color-grey-6" style={{height:"50px",lineHeight:"50px",marginBottom:"13px"}}></i>
|
<i className="iconfont icon-banbenicon font-50 color-grey-3" style={{height:"50px",lineHeight:"50px",marginBottom:"13px"}}></i>
|
||||||
<span className="weight500 font-26 mb15">这里暂未发布过任何版本</span>
|
<span className="weight font-26 mb15">这里暂未发布过任何版本</span>
|
||||||
<span className="weight400" style={{textAlign:"center",lineHeight:"20px"}}>发行版功能基于仓库中的历史标记<br/>建议使用类似 V1.0 的版本标记作为发布点</span>
|
<span className="weight400" style={{textAlign:"center",lineHeight:"20px"}}>发行版功能基于仓库中的历史标记<br/>建议使用类似 V1.0 的版本标记作为发布点</span>
|
||||||
<div className="operation">
|
<div className="operation">
|
||||||
{
|
{
|
||||||
operation ?
|
operation ?
|
||||||
<Button type={"primary"} onClick={addFunc} className="btnblue" style={{width:"118px",height:"36px"}}>发布新版本</Button>
|
<Button type={"primary"} onClick={addFunc} className="btnblue" style={{width:"118px",height:"36px"}}>发布新版本</Button>
|
||||||
:
|
:
|
||||||
<span className="color-grey-3 weight500 font-16">该项目暂时没有发布版本</span>
|
<span className="color-grey-3 weight font-16">该项目暂时没有发布版本</span>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -130,7 +130,7 @@ export default Form.create()(
|
||||||
setBranch(params);
|
setBranch(params);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className="df pt20">
|
<div className="df pt15">
|
||||||
<Form className="versionForm">
|
<Form className="versionForm">
|
||||||
<div className="itemInline">
|
<div className="itemInline">
|
||||||
<Form.Item>
|
<Form.Item>
|
||||||
|
@ -211,19 +211,19 @@ export default Form.create()(
|
||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<p className="pt20" style={{borderTop:"1px solid #eee"}}>
|
<p className="pt20" style={{borderTop:"1px solid #eee"}}>
|
||||||
<Button onClick={submit} type="primary" className="mr30">
|
<Button onClick={submit} type="primary" className="mr30 btnblue">
|
||||||
{versionId ? "保存" : "创建"}发行版
|
{versionId ? "保存" : "创建"}发行版
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={() =>history.push(`/${owner}/${projectsId}/releases`)}
|
onClick={() =>history.push(`/${owner}/${projectsId}/releases`)}
|
||||||
style={{backgroundColor: "rgba(187,187,187,1)",color: "#fff"}}
|
// style={{backgroundColor: "rgba(187,187,187,1)",color: "#fff"}}
|
||||||
>取消</Button>
|
>取消</Button>
|
||||||
</p>
|
</p>
|
||||||
</Form>
|
</Form>
|
||||||
<div className="versionTips">
|
<div className="versionTips">
|
||||||
<div className="infosTip">
|
<div className="infosTip">
|
||||||
<p className="font-16 mb15 weight500">标签命名建议</p>
|
<p className="font-16 mb14 weight">标签命名建议</p>
|
||||||
<p className="mb15">
|
<p className="mb20">
|
||||||
通常的做法是在版本名称前加上字母 v 前缀, v1.0 或者 v2.3.4。
|
通常的做法是在版本名称前加上字母 v 前缀, v1.0 或者 v2.3.4。
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
|
@ -232,13 +232,13 @@ export default Form.create()(
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="infosTip">
|
<div className="infosTip">
|
||||||
<p className="font-16 mb15 weight500">语义化版本</p>
|
<p className="font-16 mb14 weight">语义化版本</p>
|
||||||
<p>
|
<p>
|
||||||
如果你是第一次发布版本,我们强烈建议你阅读<a className="color-blue">语义化版本</a>。
|
如果你是第一次发布版本,我们强烈建议你阅读<a className="color-blue">语义化版本</a>。
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="infosTip">
|
<div className="infosTip">
|
||||||
<p className="font-16 mb15 weight500">附件大小说明</p>
|
<p className="font-16 mb14 weight">附件大小说明</p>
|
||||||
<p>
|
<p>
|
||||||
单个附件不能超过 100M(GVP 项目200M),每个仓库总附件不可超过
|
单个附件不能超过 100M(GVP 项目200M),每个仓库总附件不可超过
|
||||||
1G(推荐项目不可超过 5G;GVP 项目不可超过
|
1G(推荐项目不可超过 5G;GVP 项目不可超过
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
content: '';
|
content: '';
|
||||||
width: 8px;
|
width: 8px;
|
||||||
height: 8px;
|
height: 8px;
|
||||||
background-color: #5091FF;
|
background-color: #466AFF;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
.sendAuthorImg{
|
.sendAuthorImg{
|
||||||
|
@ -242,6 +242,9 @@
|
||||||
flex:1;
|
flex:1;
|
||||||
padding-right: 40px;
|
padding-right: 40px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
.ant-select-auto-complete.ant-select .ant-input:hover,.ant-input:hover {
|
||||||
|
border-color: rgba(153, 153, 153, 0.5);;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.versionTips{
|
.versionTips{
|
||||||
width:268px;
|
width:268px;
|
||||||
|
@ -298,7 +301,7 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
&>p{
|
&>p{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0px;
|
bottom: -5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.itemInline .ant-row{
|
.itemInline .ant-row{
|
||||||
|
|
|
@ -11,7 +11,6 @@ function Files({data,history,owner,projectsId}){
|
||||||
const [ files , setFiles ] = useState(data && data.files);
|
const [ files , setFiles ] = useState(data && data.files);
|
||||||
const [ copyfileTipTitle, setCopyfileTipTitle] = useState("复制文件路径");
|
const [ copyfileTipTitle, setCopyfileTipTitle] = useState("复制文件路径");
|
||||||
const [ isOpen, setIsOpen] = useState(false);
|
const [ isOpen, setIsOpen] = useState(false);
|
||||||
console.log(isOpen);
|
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(data){
|
if(data){
|
||||||
|
@ -40,12 +39,12 @@ function Files({data,history,owner,projectsId}){
|
||||||
}
|
}
|
||||||
|
|
||||||
const folderOpen = (
|
const folderOpen = (
|
||||||
<Anchor showInkInFixed={false}>
|
<div className="folders">
|
||||||
<div className={`folderList ${isOpen && "invisable"}`}>
|
<div className="folderList">
|
||||||
{files && files.length>1 && files.map((item, key) => {
|
{files && files.map((item, key) => {
|
||||||
return (
|
return (
|
||||||
<Link href={`#value${key}`} title=
|
<a href={`#value${key}`}>
|
||||||
{<FlexAJ className="filesInfo" key={key} onClick={() => {item.flag && showDown(item.flag, key, item.isBin);setIsOpen(true);console.log("bbb")}}>
|
<FlexAJ className="filesInfo" key={key} onClick={() => {item.flag && showDown(item.flag, key, item.isBin);setIsOpen(false);}}>
|
||||||
<AlignCenter>
|
<AlignCenter>
|
||||||
<i className="iconfont icon-wenjianicon mr4"></i>
|
<i className="iconfont icon-wenjianicon mr4"></i>
|
||||||
<span className="cursor-pointer" data-clipboard-text={item.name}>{item.name}</span>
|
<span className="cursor-pointer" data-clipboard-text={item.name}>{item.name}</span>
|
||||||
|
@ -57,26 +56,27 @@ function Files({data,history,owner,projectsId}){
|
||||||
{item.deletion >0 && <span className="color-red ml10">-{item.deletion}</span>}
|
{item.deletion >0 && <span className="color-red ml10">-{item.deletion}</span>}
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
</FlexAJ>}
|
</FlexAJ>
|
||||||
/>
|
</a>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</Anchor>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<div>
|
<div>
|
||||||
<AlignCenter className="color-grey-9 pb10">
|
<AlignCenter className="color-grey-9" style={{position:'relative'}}>
|
||||||
<i className="iconfont icon-triangle mr5 font-16"></i>
|
<div onClick={()=>{setIsOpen(!isOpen)}}>
|
||||||
<Popover content={folderOpen} placement="bottomLeft" trigger="click" onClick={()=>{isOpen && setIsOpen(false);console.log("aaa")}}>
|
<i className={`iconfont mr5 ${isOpen? "font-18 icon-sanjiaoxing-down":"font-16 icon-triangle"}`}></i>
|
||||||
<span className="color-grey-6" style={{cursor:"pointer"}}>
|
<span className="color-grey-6 update-file-count">
|
||||||
共有<span className="color-grey-3"> {data && data.files_count} 个文件 </span>被更改,包括
|
共有<span className="color-grey-3"> {data && data.files_count} 个文件 </span>被更改,包括
|
||||||
{ data && data.total_addition ? <span className="color-green"> {data && data.total_addition} 次插入</span>:"" }
|
{ data && data.total_addition ? <span className="color-green"> {data && data.total_addition} 次插入</span>:"" }
|
||||||
{ data && data.total_addition && data.total_deletion ? " 和 ":""}
|
{ data && data.total_addition && data.total_deletion ? " 和 ":""}
|
||||||
{ data && data.total_deletion ? <span className="color-red"> {data && data.total_deletion} 次删除</span>:""}
|
{ data && data.total_deletion ? <span className="color-red"> {data && data.total_deletion} 次删除</span>:""}
|
||||||
</span>
|
</span>
|
||||||
</Popover>
|
</div>
|
||||||
|
{isOpen && folderOpen}
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
{
|
{
|
||||||
files && files.length>0 &&
|
files && files.length>0 &&
|
||||||
|
@ -84,7 +84,8 @@ function Files({data,history,owner,projectsId}){
|
||||||
{
|
{
|
||||||
files.map((item,key)=>{
|
files.map((item,key)=>{
|
||||||
return(
|
return(
|
||||||
<div className="files" key={key} id= {`value${key}`}>
|
<div className="files" key={key}>
|
||||||
|
<a id= {`value${key}`} className="anchorPoint"></a>
|
||||||
<FlexAJ className="filesInfo">
|
<FlexAJ className="filesInfo">
|
||||||
<AlignCenter>
|
<AlignCenter>
|
||||||
{!item.isBin ? <i className={!item.flag?"iconfont icon-sanjiaoxing-down color-grey-9 mt4":"iconfont icon-triangle font-15 color-grey-9 mt4"} onClick={()=>showDown(item.flag,key,item.isBin)}></i>:""}
|
{!item.isBin ? <i className={!item.flag?"iconfont icon-sanjiaoxing-down color-grey-9 mt4":"iconfont icon-triangle font-15 color-grey-9 mt4"} onClick={()=>showDown(item.flag,key,item.isBin)}></i>:""}
|
||||||
|
|
|
@ -19,28 +19,33 @@
|
||||||
border:1px solid #FA6400;
|
border:1px solid #FA6400;
|
||||||
color: #FA6400;
|
color: #FA6400;
|
||||||
}
|
}
|
||||||
|
.update-file-count{
|
||||||
.color-grey-3{
|
cursor: pointer;
|
||||||
font-weight: bold;
|
& .color-grey-3{
|
||||||
}
|
font-weight: bold;
|
||||||
.invisable{
|
}
|
||||||
display: none;
|
|
||||||
}
|
}
|
||||||
.fileList{
|
.fileList{
|
||||||
.sc-bxivhb{
|
.sc-bxivhb{
|
||||||
width: 55rem;
|
width: 55rem;
|
||||||
}
|
}
|
||||||
.see-file{
|
.see-file{
|
||||||
width: 15rem;
|
width: 14rem;
|
||||||
.ml10{
|
.ml10{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 5rem;
|
width: 4.5rem;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
span{
|
span{
|
||||||
width: 7%;
|
width: 7%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.anchorPoint{
|
||||||
|
position: relative;
|
||||||
|
top: -5rem;
|
||||||
|
display: block;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.filesInfo{
|
.filesInfo{
|
||||||
background: #FAFCFF;
|
background: #FAFCFF;
|
||||||
|
@ -52,28 +57,28 @@
|
||||||
background-color: #D14A4A;
|
background-color: #D14A4A;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.ant-popover-arrow,.ant-anchor-ink-ball {
|
.folders,.ant-anchor{
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.ant-popover-inner {
|
|
||||||
margin-left: -21px;
|
|
||||||
background: #FFF;
|
|
||||||
}
|
|
||||||
.ant-anchor-link,.ant-popover-inner-content{
|
|
||||||
padding: 0 0;
|
|
||||||
}
|
|
||||||
.ant-anchor-wrapper,.ant-anchor{
|
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
}
|
}
|
||||||
.ant-anchor-link-active > .ant-anchor-link-title {
|
.folders{
|
||||||
color: #466AFF;
|
position: absolute;
|
||||||
}
|
z-index: 2;
|
||||||
.ant-popover-inner-content{
|
left: 0px;
|
||||||
|
top: 37px;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
width: 75rem;
|
width: 75rem;
|
||||||
|
box-shadow: 0px 4px 8px 2px rgba(212, 212, 212, 0.5);
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px solid rgba(153, 153, 153, 0.32);
|
||||||
|
.ant-anchor-link-active > .ant-anchor-link-title {
|
||||||
|
color: #466AFF;
|
||||||
|
}
|
||||||
|
.ant-anchor-link {
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
.folderList{
|
.folderList{
|
||||||
max-height: 280px;
|
max-height: 275px;
|
||||||
overflow:auto;
|
overflow:auto;
|
||||||
.files{
|
.files{
|
||||||
border: 0px;
|
border: 0px;
|
||||||
|
|
|
@ -109,7 +109,7 @@ class Index extends Component {
|
||||||
:
|
:
|
||||||
<Dragger {...upload} className={className}>
|
<Dragger {...upload} className={className}>
|
||||||
{icon || <Icon type="inbox" />}
|
{icon || <Icon type="inbox" />}
|
||||||
<p className="ant-upload-text font-14">拖动文件或点击此处上传</p>
|
<p className="ant-upload-text font-16 color-grey-3">拖动文件或点击此处上传</p>
|
||||||
</Dragger>
|
</Dragger>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,12 +88,18 @@ ul,ol,dl{
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
&>span, & a:link, a:visited{
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
&>span{
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.commitDesc{
|
.commitDesc{
|
||||||
flex:1;
|
flex:1;
|
||||||
line-height:20px;
|
line-height:20px;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
width: 48rem;
|
width: 49rem;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
&:hover{
|
&:hover{
|
||||||
|
|
Loading…
Reference in New Issue