版本库优化

dev_new_shixunsrepository
杨树明 5 years ago
parent 0ae972209b
commit b6bcf904e8

@ -137,7 +137,7 @@ class TPMRepositoryComponent extends Component {
return this.nameTypeMap[array[array.length - 1]] !== 'tree' && this._isFileName( array[array.length - 1] )
}
// listItem 如果是num则是通过面包屑点击过来的取pathArray的子集
fetchRepo = (listItem) => {
fetchRepo = (listItem,type) => {
// if(listItem === "main"||listItem){
// this.props.history.replace(`/shixuns/${this.props.match.params.shixunId}/repository`)
// return;
@ -180,7 +180,7 @@ class TPMRepositoryComponent extends Component {
this.props.setpathArray(newPathArray)
let urlNewPathArray = newPathArray;
let fileInPathArray = false;
if (newPathArray.length) {
if (newPathArray.length&&!type) {
fileInPathArray = this.nameTypeMap[newPathArray[newPathArray.length - 1]] ? this.nameTypeMap[newPathArray[newPathArray.length - 1]] !== 'tree'
: (listItem ? listItem.type !== 'tree' : this._isFileName( newPathArray[newPathArray.length - 1] ))
@ -237,7 +237,7 @@ class TPMRepositoryComponent extends Component {
}
oncodechanner=(sum)=>{
this.fetchRepo(sum)
this.fetchRepo(sum,true)
}
render() {
const { listItemtypes } = this.state;

@ -74,7 +74,8 @@ class RepositoryAddFile extends Component {
constructor(props) {
super(props);
this.state = {
path:""
path:"",
gotppath:""
}
}
@ -92,7 +93,8 @@ class RepositoryAddFile extends Component {
}
})
this.setState({
path:newfilspath
path:newfilspath,
gotppath:newfilspath
})
this.props.form.setFieldsValue({
@ -145,7 +147,7 @@ class RepositoryAddFile extends Component {
secret_repository:Repositoryflag===false?undefined:Repositoryflag
}).then((result)=>{
if(result){
this.props.history.push(Repositoryflag===true?`/shixuns/${shixunId}/secret_repository`:`/shixuns/${shixunId}/repository`)
this.props.history.replace(`${Repositoryflag===true?`/shixuns/${shixunId}/secret_repository`:`/shixuns/${shixunId}/repository`}${this.state.gotppath===""?"":"/master/shixun_show/"+this.state.gotppath}`)
}
}).catch((error)=>{
console.log(error);
@ -289,7 +291,7 @@ class RepositoryAddFile extends Component {
</div>
</Form>
</div>
<Bottomsubmit {...this.props} {...this.state} url={`/shixuns/${shixunId}/${Repositoryflag}${this.state.path===""?"":"/master/shixun_show/"+this.state.path}`} onSubmits={() => this.handleSubmit()}/>
<Bottomsubmit {...this.props} {...this.state} url={`/shixuns/${shixunId}/${Repositoryflag}${this.state.gotppath===""?"":"/master/shixun_show/"+this.state.gotppath}`} onSubmits={() => this.handleSubmit()}/>
{/*<Bottomsubmit {...this.props} {...this.state} url={`/shixuns/${shixunId}/${Repositoryflag}`} onSubmits={() => this.handleSubmit()}/>*/}
</div>

@ -137,6 +137,8 @@ class RepositoryCodeEditor extends Component {
})
}
setCohetepaperbool=(sum)=>{
console.log(sum)
console.log(this.props.pathArray)
this.props.oncodechanner(sum)
}
render() {

Loading…
Cancel
Save