调整版本库

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

@ -30,7 +30,7 @@ const env = getClientEnvironment(publicUrl);
module.exports = { module.exports = {
// You may want 'eval' instead if you prefer to see the compiled output in DevTools. // 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 // 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", // 开启调试 //devtool: "source-map", // 开启调试
// These are the "entry points" to our application. // These are the "entry points" to our application.

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

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

Loading…
Cancel
Save