From abc04a28a75e67b6f1827aa646d543dbdf856766 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Thu, 23 Sep 2021 08:54:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/CoderDepot.jsx | 6 -- src/forge/Main/CoderRootCommit.js | 91 +++++++++++++++++++------------ src/forge/Main/Index.scss | 4 +- src/forge/Main/list.scss | 62 +++++++++++++++++++-- src/forge/Main/tree/Index.scss | 78 +++++++++++++------------- src/forge/css/index.scss | 11 ++-- 6 files changed, 157 insertions(+), 95 deletions(-) diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 185f96e7..69cd7a2e 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -146,12 +146,9 @@ function CoderDepot(props){ setLastCommitAuthor(c && c.committer); setMainFlag(true); setReadOnly(true); -<<<<<<< HEAD -======= setReadme(result.data.readme); setEditReadme(false); setHide(true); ->>>>>>> 465ae57b071299c682f2c8d57d3380aa647c7d23 } setTimeout(function(){setIsSpin(false);},500); }).catch(error=>{setIsSpin(false);}) @@ -193,12 +190,9 @@ function CoderDepot(props){ setLastCommit(c && c.commit); setLastCommitAuthor(c && c.committer); setMainFlag(false); -<<<<<<< HEAD setReadOnly(true); -======= setReadOnly(!editReadme); setHide(true); ->>>>>>> 465ae57b071299c682f2c8d57d3380aa647c7d23 } setTimeout(function(){setIsSpin(false);},500) }).catch(error=>{setIsSpin(false);}) diff --git a/src/forge/Main/CoderRootCommit.js b/src/forge/Main/CoderRootCommit.js index a715fe74..047af571 100644 --- a/src/forge/Main/CoderRootCommit.js +++ b/src/forge/Main/CoderRootCommit.js @@ -1,13 +1,17 @@ import React , { Component } from 'react'; -import { Spin , Pagination } from 'antd'; +import { Spin , Pagination, Timeline } from 'antd'; import { getImageUrl } from 'educoder'; import { truncateCommitId } from '../common/util'; import { AlignTop } from '../Component/layout'; import SelectBranch from '../Branch/Select'; import Nodata from '../Nodata'; +import Tree from './img/tree.png'; import axios from 'axios'; import {Link} from "react-router-dom"; +import CopyTool from '../Component/CopyTool'; + +import './tree/Index.scss' function returnbar(str){ if(str && str.length>0 && str.indexOf("%2F")>-1){ @@ -15,13 +19,14 @@ function returnbar(str){ } return str; } +//代码库--提交页面 class CoderRootCommit extends Component{ constructor(props){ super(props) this.state={ commitDatas:undefined, dataCount:undefined, - limit:20, + limit:10, page:1, isSpining:false, branchList:undefined @@ -129,42 +134,56 @@ class CoderRootCommit extends Component{ > -
-
-
- {dataCount}次提交代码({branch}) -
+ {/*
+
+ {dataCount}次提交代码({branch})
-
- { - commitDatas && commitDatas.length > 0 && commitDatas.map((item,k)=>{ - return( -
- - {truncateCommitId(`${item.sha}`)} - {item.message} - -

- { - item.id ? - - {item.image_url?:""} - - : - - {item.image_url?:""} - - - } - -

+
*/} + + { + commitDatas && commitDatas.length > 0 && commitDatas.map((item,k)=>{ + return( + }> +
+
+ + {/* {truncateCommitId(`${item.sha}`)} */} + {item.message} + +

+ { + item.id ? + + {item.image_url?:""} + + : + + {item.image_url?:""} + + + } +

+
+
+
+
+ + sha + {truncateCommitId(`${item.sha}`)} + + + +
+ +
+
- ) - }) - } - {commitDatas && commitDatas.length === 0 && } -
-
+ + ) + }) + } + {commitDatas && commitDatas.length === 0 && } + { dataCount > limit ?
diff --git a/src/forge/Main/Index.scss b/src/forge/Main/Index.scss index 1e2e5574..6e0c300c 100644 --- a/src/forge/Main/Index.scss +++ b/src/forge/Main/Index.scss @@ -402,7 +402,6 @@ cursor: pointer; background: #FAFBFC; border-radius: 4px; -<<<<<<< HEAD .ant-dropdown-menu-item{ border-radius: 8px; text-align: left!important; @@ -412,7 +411,7 @@ white-space: nowrap; text-overflow: ellipsis; } -======= + } border: 1px solid #D0D0D0; font-size: 15px; font-weight: normal; @@ -425,7 +424,6 @@ align-items: center; &:hover{ background-color: #F3F4F6; ->>>>>>> 465ae57b071299c682f2c8d57d3380aa647c7d23 } span{ margin-top: 1px; diff --git a/src/forge/Main/list.scss b/src/forge/Main/list.scss index 72c3437e..9eff14ca 100644 --- a/src/forge/Main/list.scss +++ b/src/forge/Main/list.scss @@ -718,12 +718,62 @@ a.color-grey-ccc:hover{ padding:0px 30px; min-height: 400px; } -.commitList > div{ - border-bottom: 1px solid #EEEEEE; - padding:16px 0px; -} -.commitList > div:last-child{ - border-bottom: none; + +.main{ + margin: 30px auto; + .ant-timeline{ + margin-top: 28px; + .commitList-item{ + position: relative; + padding: 20px 20px; + background: #FAFCFF; + border: 1px solid rgba(42, 97, 255, 0.23); + border-radius: 4px; + margin-left: 16px; + align-items: center; + &:after,&:before{ + content: ""; + position: absolute; + left: -10px; + top: 10px; + border-top: 6px solid transparent; + border-bottom: 6px solid transparent; + border-right: 10px solid rgba(42, 97, 255, 0.23); + } + &:after{ + left: -8px; + border-right: 10px solid #FAFCFF; + &:hover{ + border-right: 10px solid #EEF6FF; + } + } + &:hover{ + background: #EEF6FF; + border: 1px solid rgba(42, 97, 255, 0.58); + &:after{ + border-right: 10px solid #EEF6FF; + } + &:before{ + border-right: 10px solid rgba(42, 97, 255, 0.58); + } + } + .treecopy-cont{ + padding: 4px 15px; + } + .btn-83{ + margin-left: 20px; + } + } + .ant-timeline-item{ + padding: 8px 0 20px; + } + .ant-timeline-item-tail{ + height: calc(100% - 20px); + } + .ant-timeline-item-head-custom{ + top:20px; + } + } } diff --git a/src/forge/Main/tree/Index.scss b/src/forge/Main/tree/Index.scss index 964fee19..a4aff5df 100644 --- a/src/forge/Main/tree/Index.scss +++ b/src/forge/Main/tree/Index.scss @@ -34,48 +34,48 @@ margin-right: 5px; } } - .treecopy{ - flex:1; - display: flex; - justify-content: center; - &>div{ - height: 32px; - background: #FAFBFC; - border-radius: 4px; - border: 1px solid #D0D0D0; - position: relative; - z-index: 1; - display: flex; - align-items: center; - &>span{ - padding:0px 15px; - border-right: 1px solid rgba(153, 153, 153, 0.4); - height: 100%; - img{ - margin-right: 4px; - } - a{ - color: #466AFF; - &:hover{ - text-decoration: underline; - } - } - } - &>i{ - margin:0px 12px; - color: #333!important; - } - input{ - position: absolute; - z-index: 0; - opacity: 0; - top: 32px; - } - } - } .treeabout{ flex:1; text-align: right; } } +} +.treecopy{ + flex:1; + display: flex; + justify-content: center; + &>div{ + height: 32px; + background: #FAFBFC; + border-radius: 4px; + border: 1px solid #D0D0D0; + position: relative; + z-index: 1; + display: flex; + align-items: center; + &>span{ + padding:0px 15px; + border-right: 1px solid rgba(153, 153, 153, 0.4); + height: 100%; + img{ + margin-right: 4px; + } + a{ + color: #466AFF; + &:hover{ + text-decoration: underline; + } + } + } + &>i{ + margin:0px 12px; + color: #333!important; + } + input{ + position: absolute; + z-index: 0; + opacity: 0; + top: 32px; + } + } } \ No newline at end of file diff --git a/src/forge/css/index.scss b/src/forge/css/index.scss index 03bbbc42..52c16632 100644 --- a/src/forge/css/index.scss +++ b/src/forge/css/index.scss @@ -91,10 +91,7 @@ ul,ol,dl{ } .commitDesc{ flex:1; - margin-left:20px; - font-size:16px; - color:#333; - line-height:26px; + line-height:20px; word-break: break-all; } @@ -297,10 +294,14 @@ form{ border-radius: 5px; font-weight: 500; color: #333333!important; - &:hover,&:active{ + &:hover{ background: #F3F4F6; color: #333333!important; } + &:active{ + background: #D0D0D0; + color: #333333!important; + } } a.hover:hover{ text-decoration: underline;