diff --git a/src/forge/Main/CoderRootFileDetail.js b/src/forge/Main/CoderRootFileDetail.js index c6c976f4..bdcfc98a 100644 --- a/src/forge/Main/CoderRootFileDetail.js +++ b/src/forge/Main/CoderRootFileDetail.js @@ -27,6 +27,7 @@ class CoderRootFileDetail extends Component { } componentDidMount = () => { + window.scrollTo(0, 0); const { detail , mdFlag } = this.props; this.setState({ value: detail.content, @@ -214,7 +215,7 @@ class CoderRootFileDetail extends Component { const Option = Select.Option; return ( - +
{ md && readOnly && diff --git a/src/forge/Main/CoderRootIndex.js b/src/forge/Main/CoderRootIndex.js index b5d24196..7ff25dae 100644 --- a/src/forge/Main/CoderRootIndex.js +++ b/src/forge/Main/CoderRootIndex.js @@ -3,7 +3,6 @@ import { Route , Switch } from 'react-router-dom'; // import Top from './DetailTop'; import Loadable from 'react-loadable'; import Loading from '../../Loading'; -import axios from 'axios'; import './Index.scss'; const FileNew = Loadable({ @@ -51,37 +50,37 @@ class CoderRootIndex extends Component{ } } - componentDidMount=()=>{ - this.Init(); - } - componentDidUpdate=(prevProps)=>{ - const { location } = this.props; - const prevlocation = prevProps && prevProps.location; - if (location !== prevlocation) { - this.Init(); - } - } + // componentDidMount=()=>{ + // this.Init(); + // } + // componentDidUpdate=(prevProps)=>{ + // const { location } = this.props; + // const prevlocation = prevProps && prevProps.location; + // if (location !== prevlocation) { + // this.Init(); + // } + // } - Init=()=>{ - const { branchName } = this.props.match.params; - const { defaultBranch } = this.props; - this.getTopCount(branchName || defaultBranch); - } + // Init=()=>{ + // const { branchName } = this.props.match.params; + // const { defaultBranch } = this.props; + // this.getTopCount(branchName || defaultBranch); + // } // 获取组件里要显示的数据 - getTopCount=(branch)=>{ - const { projectsId , owner } = this.props.match.params; - const url = `/${owner}/${projectsId}/top_counts.json`; - axios.get(url,{params:{ - ref:branch - }}).then(result=>{ - if(result){ - this.setState({ - coderCount:result.data - }) - } - }).catch(error=>{console.log(error);}) - } + // getTopCount=(branch)=>{ + // const { projectsId , owner } = this.props.match.params; + // const url = `/${owner}/${projectsId}/top_counts.json`; + // axios.get(url,{params:{ + // ref:branch + // }}).then(result=>{ + // if(result){ + // this.setState({ + // coderCount:result.data + // }) + // } + // }).catch(error=>{console.log(error);}) + // } render(){ return(
@@ -100,12 +99,12 @@ class CoderRootIndex extends Component{ > () + (props) => () } > () + () => () } > () + () => () } > {/* span{ padding-left: 15px; diff --git a/src/forge/Main/tag/Index.jsx b/src/forge/Main/tag/Index.jsx index 66e6f24c..48f80ea2 100644 --- a/src/forge/Main/tag/Index.jsx +++ b/src/forge/Main/tag/Index.jsx @@ -1,17 +1,17 @@ import React,{ useEffect , useState } from 'react'; import SubMenu from '../sub/SubMenu'; -import { Table , Tooltip } from 'antd'; +import { Table , Tooltip , Spin } from 'antd'; import axios from 'axios'; import { Link } from 'react-router-dom'; import { truncateCommitId } from '../../common/util'; import './Index.scss'; import Tree from '../img/tree.png' import moment from 'moment'; -import Loading from '../../../Loading'; function Tags(props) { const [ source , setSource ] = useState([]); + const [ isSpin , setIsSpin ] = useState(true); const { projectsId , owner } = props.match.params; @@ -21,6 +21,7 @@ function Tags(props) { axios.get(url).then((result) => { if (result) { setSource(result.data); + setIsSpin(false); } }).catch(error => {}) } @@ -83,7 +84,6 @@ function Tags(props) { render:(txt,item)=>{ return (
- TAR @@ -98,7 +98,17 @@ function Tags(props) { return(
-
+ { + source && source.length > 0 ? + +
+ : +
+ +
+ }
) } diff --git a/src/forge/Main/tag/Index.scss b/src/forge/Main/tag/Index.scss index 5ce43cf2..5d72ab29 100644 --- a/src/forge/Main/tag/Index.scss +++ b/src/forge/Main/tag/Index.scss @@ -32,4 +32,11 @@ } } } +} +.tagSpin{ + min-height: 300px; + text-align: center; + display: flex; + align-items: center; + justify-content: center; } \ No newline at end of file diff --git a/src/forge/Newfile/UserSubmitComponent.js b/src/forge/Newfile/UserSubmitComponent.js index 84ae9b33..aa4bba6e 100644 --- a/src/forge/Newfile/UserSubmitComponent.js +++ b/src/forge/Newfile/UserSubmitComponent.js @@ -83,8 +83,7 @@ class UserSubmitComponent extends Component { if (result.data && result.data.name) { this.props.showNotification("文件新建成功!"); if(submitType === "1"){ - const { getTopCount , getDetail } = this.props; - getTopCount && getTopCount(values.branchname); + const { getDetail } = this.props; getDetail && getDetail(); } let url = `/${owner}/${projectsId}${values.branchname ? `/tree/${turnbar(values.branchname)}`: (branch ? `/tree/${turnbar(branch)}` : "")}`;