调整版本库

dev_new_shixunsrepository
杨树明 5 years ago
parent 4b2f232332
commit d71932c93a

@ -30,7 +30,7 @@ const env = getClientEnvironment(publicUrl);
module.exports = {
// You may want 'eval' instead if you prefer to see the compiled output in DevTools.
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
//devtool: "cheap-module-eval-source-map",
devtool: "cheap-module-eval-source-map",
// 开启调试
//devtool: "source-map", // 开启调试
// These are the "entry points" to our application.

@ -93,8 +93,9 @@ class TPMRepositoryComponent extends Component {
fileContent: response.data.content,
repositoryLoading: false
});
this.props.history
.replace(`${this.props.match.url}/master/shixun_show/${newPathArray.join('/')}`)
if(response.data.content){
this.props.history.replace(`${this.props.match.url}/master/shixun_show/${newPathArray.join('/')}`)
}
}
}).catch((error)=>{
@ -171,9 +172,11 @@ class TPMRepositoryComponent extends Component {
...response.data,
repositoryLoading: false
});
this.props.history
.replace(`${this.props.match.url}` +
(newPathArray.length ? `/master/shixun_show/${newPathArray.join('/')}` : ''))
// console.log(response)
// console.log(newPathArray.length)
// this.props.history
// .replace(`${this.props.match.url}` +
// (newPathArray.length ? `/master/shixun_show/${newPathArray.join('/')}` : ''))
}
// 初始化时repo接口完毕后需要看是否需要fetchCode

@ -47,6 +47,9 @@ class Repository extends Component {
})
}
onSelectDirectoryTree=(selectedKeys, info)=>{
this.onRepoFileClick(info.node.props.item)
}
render() {
let { match, author, git_url, lastest_commit,repositoryLoading, commits,trees,pathArray , TPMRightSectionData } = this.props;
let matchpath =this.props.match.path;
@ -222,33 +225,34 @@ class Repository extends Component {
</div>}
<div className="padding20" style={{minHeight: '372px'}}>
<div className="bor-grey-e">
<div>
{/* 当前目录位置 */}
<RepositoryDirectories {...this.props}></RepositoryDirectories>
<div className="versionFileList">
{/*<div className="versionFileList">*/}
{/* { trees === undefined ?"": trees === null || trees.length===0?"":trees.map((item, index) => {*/}
{/* return (*/}
{/* <li id={`file${index}`} key={index} className=" file padding5-10">*/}
{/* <span style={{marginLeft: '0px'}} className="task-hide">*/}
{/* <i className={`${item.type === 'tree' ? 'icon-wenjianjia' : 'icon-zuoye'}*/}
{/* iconfont color-blue`}></i>*/}
{/* <a*/}
{/* onClick={() => this.onRepoFileClick(item)}>*/}
{/* &nbsp;{item.name}*/}
{/* </a>*/}
{/* </span>*/}
{/* </li>*/}
{/* )*/}
{/* })}*/}
{/*</div>*/}
<DirectoryTree multiple defaultExpandAll onSelect={this.onSelectDirectoryTree}>
{ trees === undefined ?"": trees === null || trees.length===0?"":trees.map((item, index) => {
return (
<li id={`file${index}`} key={index} className=" file padding5-10">
<span style={{marginLeft: '0px'}} className="task-hide">
<i className={`${item.type === 'tree' ? 'icon-wenjianjia' : 'icon-zuoye'}
iconfont color-blue`}></i>
<a
onClick={() => this.onRepoFileClick(item)}>
&nbsp;{item.name}
</a>
</span>
</li>
)
})}
</div>
{/*<DirectoryTree multiple defaultExpandAll onSelect={this.onSelect} onExpand={this.onExpand}>*/}
{/* <TreeNode title="parent 0" key="0-0" icon={<i className="iconfont icon-xingzhuangjiehebeifen color-blue font-12" />}>*/}
{/* <TreeNode title="leaf 0-0" key="0-0-0" isLeaf icon={<i className="iconfont icon-xingzhuangjiehe color-blue font-12" />} />*/}
{/* <TreeNode title="leaf 0-1" key="0-0-1" isLeaf icon={<i className="iconfont icon-xingzhuangjiehe color-blue font-12" />}/>*/}
{/* </TreeNode>*/}
{/*</DirectoryTree>*/}
<TreeNode item={item} title={`${item.name}`} key={item.type==='tree'?"0-0":`0-0-${index}`} icon={item.type==='tree'?<i className="iconfont icon-xingzhuangjiehebeifen color-blue font-12" />:<i className="iconfont icon-xingzhuangjiehe color-blue font-12"/>} id={`file${index}`} key={index}>
</TreeNode>
)})}
</DirectoryTree>
</div>
</div>

Loading…
Cancel
Save