From 1402029bfead18d3d693ee5e33aa2f810ad28e39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Mon, 27 Sep 2021 10:08:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BC=98=E5=8C=96-=E5=8F=91?= =?UTF-8?q?=E8=A1=8C=E7=89=88=E6=94=B9=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/css/edu-purge.css | 8 +++++ src/forge/Component/User.jsx | 5 +-- src/forge/Main/CoderRootCommit.js | 42 ++++++++++++----------- src/forge/Main/Diff.jsx | 35 +++++++++---------- src/forge/Main/version/Empty.jsx | 6 ++-- src/forge/Main/version/New.jsx | 14 ++++---- src/forge/Main/version/version.scss | 7 ++-- src/forge/Merge/Files.jsx | 31 +++++++++-------- src/forge/Merge/Index.scss | 53 ++++++++++++++++------------- src/forge/Upload/Index.js | 2 +- src/forge/css/index.scss | 8 ++++- 11 files changed, 115 insertions(+), 96 deletions(-) diff --git a/public/css/edu-purge.css b/public/css/edu-purge.css index de4566eb..1ec10446 100644 --- a/public/css/edu-purge.css +++ b/public/css/edu-purge.css @@ -1760,6 +1760,14 @@ a.decoration { margin-bottom: 10px; } +.mb12 { + margin-bottom: 12px; +} + +.mb13 { + margin-bottom: 13px; +} + .mb14 { margin-bottom: 14px; } diff --git a/src/forge/Component/User.jsx b/src/forge/Component/User.jsx index 8cdd3e54..0d970173 100644 --- a/src/forge/Component/User.jsx +++ b/src/forge/Component/User.jsx @@ -3,11 +3,9 @@ import styled from 'styled-components'; import { Link } from 'react-router-dom'; export default ({ url , name , column , id , login })=>{ - console.log(url); - console.log(name); - console.log(id); const Img = styled.span` display:flex; + font-weight: bold; ${column && "flex-direction: column;text-align:center;"} align-items: center; & img{ @@ -18,7 +16,6 @@ export default ({ url , name , column , id , login })=>{ ${!column && ` & span{ margin-left:8px; - font-weight: bold; }` } `; diff --git a/src/forge/Main/CoderRootCommit.js b/src/forge/Main/CoderRootCommit.js index f4492bb1..50f2fb6a 100644 --- a/src/forge/Main/CoderRootCommit.js +++ b/src/forge/Main/CoderRootCommit.js @@ -20,6 +20,12 @@ function returnbar(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{ constructor(props){ @@ -37,8 +43,12 @@ class CoderRootCommit extends Component{ componentDidMount=()=>{ this.Init(); this.getBranchs(); + // goBack + // addEventListener } + // componentde + // 获取分支列表 getBranchs=()=>{ const { projectsId , owner } = this.props.match.params; @@ -91,7 +101,8 @@ class CoderRootCommit extends Component{ image_url:item.author && item.author.image_url, sha:item.sha, time_from_now:item.time_from_now, - message:item.message + message:item.message, + timestamp:item.timestamp }) }) this.setState({ @@ -117,6 +128,7 @@ class CoderRootCommit extends Component{ }) this.getCommitList(branchName , page , limit); } + render(){ const { commitDatas , dataCount , limit , page , isSpining , branchList } = this.state; const { projectDetail, commit_class , defaultBranch } = this.props; @@ -145,35 +157,25 @@ class CoderRootCommit extends Component{
- {item.message} +
{item.message}

- {item.time_from_now &&

  • 提交于{item.time_from_now}
  • } - {/* { - item.id ? - - {item.image_url?:""} - - : - - {item.image_url?:""} - - - } */} + {item.timestamp && }

    -
    - +
    + sha - {truncateCommitId(`${item.sha}`)} - + {truncateCommitId(`${item.sha}`)} +
    diff --git a/src/forge/Main/Diff.jsx b/src/forge/Main/Diff.jsx index f1b696bc..b066aaac 100644 --- a/src/forge/Main/Diff.jsx +++ b/src/forge/Main/Diff.jsx @@ -4,11 +4,10 @@ import { Button ,Spin } from "antd"; import { truncateCommitId } from '../common/util'; import { getImageUrl } from 'educoder'; import Files from '../Merge/Files'; - import Tree from "./img/tree.png"; import User from "../Component/User"; - import axios from "axios"; +import { Link } from "react-router-dom"; const Infos = styled.div` border: 1px solid #FAFCFF; @@ -17,7 +16,7 @@ const Infos = styled.div` background-color: #f1f8ff; border: 1px solid rgba(42, 97, 255, 0.23); border-radius: 3px 3px 0px 0px; - padding: 10px 8px 10px 16px; + padding: 10px 20px 10px 16px; & .f-wrap-between{ align-items: center; } @@ -32,11 +31,14 @@ const Infos = styled.div` } } & > .f-wrap-between { - padding: 14px 8px 14px 16px; + padding: 14px 20px 14px 16px; border-radius: 3px 3px 0px 0px; border: 1px solid #D0D0D0; .df{ align-items: center; + & .underline:hover{ + text-decoration: underline; + } } } `; @@ -47,7 +49,7 @@ export default ({ match , history }) => { const [parents, setParents] = useState(undefined); const [committer, setCommitter] = useState(undefined); const [isSpin, setIsSpin] = useState(true); - + console.log(match); const { sha , projectsId, owner, branchName } = match.params; useEffect(() => { if (projectsId && owner && sha) { @@ -68,6 +70,11 @@ export default ({ match , history }) => { }); } }, [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 (
    @@ -79,7 +86,7 @@ export default ({ match , history }) => { {commit && commit.message &&
    {commit.message}
    } - {branchName} + {branchName}
    @@ -90,19 +97,9 @@ export default ({ match , history }) => { 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"} name={committer && committer.name} + login={committer && committer.login} /> - {commit && commit.time_from_now &&
  • 提交于{commit.time_from_now}
  • } - {/* { - item.id ? - - {item.image_url?:""} - - : - - {item.image_url?:""} - - - } */} + {commit && commit.timestamp &&
  • 提交于{timeFormat(commit.timestamp)}
  • }
  • { @@ -111,7 +108,7 @@ export default ({ match , history }) => {
    sha - {truncateCommitId(item.sha)} + {truncateCommitId(item.sha)}
    ) }) diff --git a/src/forge/Main/version/Empty.jsx b/src/forge/Main/version/Empty.jsx index 5dac793e..3200d3e8 100644 --- a/src/forge/Main/version/Empty.jsx +++ b/src/forge/Main/version/Empty.jsx @@ -5,15 +5,15 @@ import './version.scss'; function Empty({operation,addFunc}) { return(
    - - 这里暂未发布过任何版本 + + 这里暂未发布过任何版本 发行版功能基于仓库中的历史标记
    建议使用类似 V1.0 的版本标记作为发布点
    { operation ? : - 该项目暂时没有发布版本 + 该项目暂时没有发布版本 }
    diff --git a/src/forge/Main/version/New.jsx b/src/forge/Main/version/New.jsx index 6b1dc248..b8b179b8 100644 --- a/src/forge/Main/version/New.jsx +++ b/src/forge/Main/version/New.jsx @@ -130,7 +130,7 @@ export default Form.create()( setBranch(params); } return ( -
    +
    @@ -211,19 +211,19 @@ export default Form.create()( )}

    -

    -

    标签命名建议

    -

    +

    标签命名建议

    +

    通常的做法是在版本名称前加上字母 v 前缀, v1.0 或者 v2.3.4。

    @@ -232,13 +232,13 @@ export default Form.create()(

    -

    语义化版本

    +

    语义化版本

    如果你是第一次发布版本,我们强烈建议你阅读语义化版本

    -

    附件大小说明

    +

    附件大小说明

    单个附件不能超过 100M(GVP 项目200M),每个仓库总附件不可超过 1G(推荐项目不可超过 5G;GVP 项目不可超过 diff --git a/src/forge/Main/version/version.scss b/src/forge/Main/version/version.scss index 6f04e060..4ebfad7a 100644 --- a/src/forge/Main/version/version.scss +++ b/src/forge/Main/version/version.scss @@ -42,7 +42,7 @@ content: ''; width: 8px; height: 8px; - background-color: #5091FF; + background-color: #466AFF; border-radius: 50%; } .sendAuthorImg{ @@ -242,6 +242,9 @@ flex:1; padding-right: 40px; 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{ width:268px; @@ -298,7 +301,7 @@ position: relative; &>p{ position: absolute; - bottom: 0px; + bottom: -5px; } } .itemInline .ant-row{ diff --git a/src/forge/Merge/Files.jsx b/src/forge/Merge/Files.jsx index 7287943c..19d0502c 100644 --- a/src/forge/Merge/Files.jsx +++ b/src/forge/Merge/Files.jsx @@ -11,7 +11,6 @@ function Files({data,history,owner,projectsId}){ const [ files , setFiles ] = useState(data && data.files); const [ copyfileTipTitle, setCopyfileTipTitle] = useState("复制文件路径"); const [ isOpen, setIsOpen] = useState(false); - console.log(isOpen); useEffect(()=>{ if(data){ @@ -40,12 +39,12 @@ function Files({data,history,owner,projectsId}){ } const folderOpen = ( - -

    - {files && files.length>1 && files.map((item, key) => { +
    +
    + {files && files.map((item, key) => { return ( - {item.flag && showDown(item.flag, key, item.isBin);setIsOpen(true);console.log("bbb")}}> + + {item.flag && showDown(item.flag, key, item.isBin);setIsOpen(false);}}> {item.name} @@ -57,26 +56,27 @@ function Files({data,history,owner,projectsId}){ {item.deletion >0 && -{item.deletion}}
    - } - /> + + ) })}
    - +
    ) return(
    - - - {isOpen && setIsOpen(false);console.log("aaa")}}> - + +
    {setIsOpen(!isOpen)}}> + + 共有 {data && data.files_count} 个文件 被更改,包括 { data && data.total_addition ? {data && data.total_addition} 次插入:"" } { data && data.total_addition && data.total_deletion ? " 和 ":""} { data && data.total_deletion ? {data && data.total_deletion} 次删除:""} - +
    + {isOpen && folderOpen}
    { files && files.length>0 && @@ -84,7 +84,8 @@ function Files({data,history,owner,projectsId}){ { files.map((item,key)=>{ return( -
    +
    + {!item.isBin ? showDown(item.flag,key,item.isBin)}>:""} diff --git a/src/forge/Merge/Index.scss b/src/forge/Merge/Index.scss index 19f24c61..9f790e7a 100644 --- a/src/forge/Merge/Index.scss +++ b/src/forge/Merge/Index.scss @@ -19,28 +19,33 @@ border:1px solid #FA6400; color: #FA6400; } - -.color-grey-3{ - font-weight: bold; -} -.invisable{ - display: none; +.update-file-count{ + cursor: pointer; + & .color-grey-3{ + font-weight: bold; + } } .fileList{ .sc-bxivhb{ width: 55rem; } .see-file{ - width: 15rem; + width: 14rem; .ml10{ display: inline-block; - width: 5rem; + width: 4.5rem; cursor: default; } span{ width: 7%; } } + .anchorPoint{ + position: relative; + top: -5rem; + display: block; + height: 0; + } } .filesInfo{ background: #FAFCFF; @@ -52,28 +57,28 @@ background-color: #D14A4A; } } -.ant-popover-arrow,.ant-anchor-ink-ball { - 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{ +.folders,.ant-anchor{ margin-left: 0; padding-left: 0; } -.ant-anchor-link-active > .ant-anchor-link-title { - color: #466AFF; -} -.ant-popover-inner-content{ +.folders{ + position: absolute; + z-index: 2; + left: 0px; + top: 37px; color: #333333; 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{ - max-height: 280px; + max-height: 275px; overflow:auto; .files{ border: 0px; diff --git a/src/forge/Upload/Index.js b/src/forge/Upload/Index.js index 1858e5fd..713803aa 100644 --- a/src/forge/Upload/Index.js +++ b/src/forge/Upload/Index.js @@ -109,7 +109,7 @@ class Index extends Component { : {icon || } -

    拖动文件或点击此处上传

    +

    拖动文件或点击此处上传

    ) } diff --git a/src/forge/css/index.scss b/src/forge/css/index.scss index 9c2c60b4..a4ac383a 100644 --- a/src/forge/css/index.scss +++ b/src/forge/css/index.scss @@ -88,12 +88,18 @@ ul,ol,dl{ display: flex; flex-wrap: wrap; align-items: center; + &>span, & a:link, a:visited{ + color: #333; + } + &>span{ + cursor: default; + } } .commitDesc{ flex:1; line-height:20px; word-break: break-all; - width: 48rem; + width: 49rem; overflow: hidden; white-space: normal; &:hover{