版本库优化

dev_aliyun2
杨树明 5 years ago committed by harry
parent 147e450d77
commit 585de82ec7

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

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

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

Loading…
Cancel
Save