From 585de82ec76e68705a5bed0b9e3c4da7c3d5e7ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 28 Feb 2020 23:50:41 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMRepositoryComponent.js | 6 +++--- .../tpm/shixunchild/Repository/RepositoryAddFile.js | 10 ++++++---- .../tpm/shixunchild/Repository/RepositoryCodeEditor.js | 2 ++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/public/react/src/modules/tpm/TPMRepositoryComponent.js b/public/react/src/modules/tpm/TPMRepositoryComponent.js index 51ff6369b..574d51925 100644 --- a/public/react/src/modules/tpm/TPMRepositoryComponent.js +++ b/public/react/src/modules/tpm/TPMRepositoryComponent.js @@ -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; diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js index 74869120e..5bf2cd820 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js @@ -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 { - this.handleSubmit()}/> + this.handleSubmit()}/> {/* this.handleSubmit()}/>*/} diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCodeEditor.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCodeEditor.js index 4685d86ce..9c7223433 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCodeEditor.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCodeEditor.js @@ -126,6 +126,8 @@ class RepositoryCodeEditor extends Component { }) } setCohetepaperbool=(sum)=>{ + console.log(sum) + console.log(this.props.pathArray) this.props.oncodechanner(sum) } render() {