diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index c3a2599a9..bcbcd348f 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -455,8 +455,8 @@ function CoderDepot(props){ lastCommit &&
-
props.history.push(`/${owner}/${projectsId}/commits/${truncateCommitId(lastCommit.sha)}`)} className={hideBtn && hide ? "ellipsistxt hidetxt" :"ellipsistxt"}> -
{lastCommit.message}
+
+
{lastCommit.message}
{ hideBtn && changeHide(hide)}> } diff --git a/src/forge/Main/CoderRootCommit.js b/src/forge/Main/CoderRootCommit.js index cdd8d59d9..604917ba0 100644 --- a/src/forge/Main/CoderRootCommit.js +++ b/src/forge/Main/CoderRootCommit.js @@ -25,10 +25,6 @@ function returnbar(str){ class CoderRootCommit extends Component{ constructor(props){ super(props); - // const params = new URLSearchParams(location && location.search); - // const [commitPage] = [params.get('commitPage')]; - // console.log('111',commitPage); - // commitPage && this.setState({page:commitPage}); this.state={ commitDatas:undefined, dataCount:undefined, @@ -61,13 +57,28 @@ class CoderRootCommit extends Component{ this.Init(); } } + + UrlParamHash(url){ + const params = {}; + let h; + let hash = url.slice(url.indexOf('?')+1).split('&'); + for(let i = 0; i{ const { branchName } = this.props.match.params; - const { page , limit } = this.state; + const { limit } = this.state; + const {search} = this.props.location; + const realPage = (search && this.UrlParamHash(search).page) ? parseInt(this.UrlParamHash(search).page) : 1; this.setState({ - isSpining:true + isSpining:true, + page:realPage }) - this.getCommitList( branchName , page , limit ); + this.getCommitList( branchName , realPage , limit ); } getCommitList=(branch , page , limit)=>{ @@ -116,19 +127,13 @@ class CoderRootCommit extends Component{ } ChangePage=(page)=>{ - const { branchName } = this.props.match.params; - const { limit } = this.state; - this.setState({ - page: page - }) - this.getCommitList(branchName , page , limit); + this.props.history.push({pathname: this.props.history.location.pathname,search: `page=${page}`}) } render(){ const { commitDatas , dataCount , limit , page , isSpining , branchList } = this.state; const { projectDetail, commit_class , defaultBranch } = this.props; const { projectsId , owner , branchName } = this.props.match.params; - console.log(branchName); let branch = returnbar(branchName || defaultBranch); return( @@ -153,7 +158,7 @@ class CoderRootCommit extends Component{
-
{item.message}
+
{item.message}

sha - {truncateCommitId(`${item.sha}`)} + {truncateCommitId(`${item.sha}`)} @@ -188,7 +193,7 @@ class CoderRootCommit extends Component{ { dataCount > limit ?

- +
:"" } diff --git a/src/forge/Main/Diff.jsx b/src/forge/Main/Diff.jsx index 457426eaa..86cf9384c 100644 --- a/src/forge/Main/Diff.jsx +++ b/src/forge/Main/Diff.jsx @@ -90,7 +90,7 @@ export default (props) => {
    diff --git a/src/forge/Main/Index.scss b/src/forge/Main/Index.scss index 9a0bf5391..8c0e18488 100644 --- a/src/forge/Main/Index.scss +++ b/src/forge/Main/Index.scss @@ -253,7 +253,7 @@ background-color: #FAFCFF; .ellipsistxt{ margin-top: 6px; - cursor: pointer; + // cursor: pointer; #ptxt{ margin-bottom: 0px; word-break: break-all; diff --git a/src/forge/Main/version/New.jsx b/src/forge/Main/version/New.jsx index ca9057caa..a235f31d9 100644 --- a/src/forge/Main/version/New.jsx +++ b/src/forge/Main/version/New.jsx @@ -247,7 +247,7 @@ export default Form.create()(

    语义化版本

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

    diff --git a/src/forge/Merge/Files.jsx b/src/forge/Merge/Files.jsx index 2e5cd7cce..a3015fcec 100644 --- a/src/forge/Merge/Files.jsx +++ b/src/forge/Merge/Files.jsx @@ -9,22 +9,7 @@ function Files({ data,history,owner,projectsId , parentsSha }){ 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.commitPage; - // console.log('222',commitPage); - // const nextHref = useRef(null); - - // useEffect(()=>{ - // const unlisten = history.listen((location)=>{ - // if(nextHref.current !== location.pathname){ - // nextHref.current = location.pathname; - // history.replace({pathname:location.pathname,search:`commitPage=${commitPage}`}); - // // history.replace({pathname:location.pathname, query:{page:commitPage}}); - // } else{ - // unlisten; - // } - // }) - // }) - + useEffect(()=>{ if(data){ setFiles(data.files); @@ -63,7 +48,7 @@ function Files({ data,history,owner,projectsId , parentsSha }){ {item.name}
    - 0?item.addition+"处添加":""}${item.addition>0 && item.deletion>0 ?"和":""}${item.deletion>0?item.deletion+"处删除":""}`}> + 0 && ":"}${item.addition>0?item.addition+"处添加":""}${item.addition>0 && item.deletion>0 ?"和":""}${item.deletion>0?item.deletion+"处删除":""}`}> {item.addition >0 && +{item.addition}} {item.deletion >0 && -{item.deletion}} @@ -111,7 +96,7 @@ function Files({ data,history,owner,projectsId , parentsSha }){
    - 0?item.addition+"处添加":""}${item.addition>0 && item.deletion>0 ?"和":""}${item.deletion>0?item.deletion+"处删除":""}`}> + 0 && ":"} ${item.addition > 0 ? item.addition + "处添加" : ""}${item.addition > 0 && item.deletion > 0 ? "和" : ""}${item.deletion > 0 ? item.deletion + "处删除" : ""}`}> {item.addition+item.deletion}处