From 6cf8a80157e20dd1a979cf2500924bb618b0bf60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 29 Feb 2020 00:43:19 +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/common/LogUtil.js | 10 +++++----- public/react/src/modules/tpm/TPMIndex.js | 8 ++++---- .../src/modules/tpm/TPMRepositoryComponent.js | 15 +++++++++++---- .../shixunchild/Repository/RepositoryAddFile.js | 2 +- .../Repository/RepositoryCodeEditor.js | 4 ++-- 5 files changed, 23 insertions(+), 16 deletions(-) diff --git a/public/react/src/common/LogUtil.js b/public/react/src/common/LogUtil.js index da5cbc75e..222206e23 100644 --- a/public/react/src/common/LogUtil.js +++ b/public/react/src/common/LogUtil.js @@ -17,14 +17,14 @@ const timeStamp = () => { /* 带trace的、默认折叠起来的控制台输出 第一个参数最好传入string类型的标识,接着可以跟任意类型任意个数的参数,各个参数都会打印到控制台 -*/ +*/ export function trace_collapse(content) { if (console.groupCollapsed) { - console.groupCollapsed(typeof content == 'string' ? content : 'trace_collapse'); - log.trace(arguments); - console.groupEnd(); + // console.groupCollapsed(typeof content == 'string' ? content : 'trace_collapse'); + // log.trace(arguments); + // console.groupEnd(); } else { - trace(content) + // trace(content) } } diff --git a/public/react/src/modules/tpm/TPMIndex.js b/public/react/src/modules/tpm/TPMIndex.js index c40bf0a85..4c34c6e97 100644 --- a/public/react/src/modules/tpm/TPMIndex.js +++ b/public/react/src/modules/tpm/TPMIndex.js @@ -364,11 +364,11 @@ class TPMIndex extends Component { } else if (e.key === "2") { this.props.history.replace(`/shixuns/${id}/propaedeutics`); }else if(e.key==="3"){ - window.location.href=`/shixuns/${id}/repository`; - // this.props.history.replace(`/shixuns/${id}/repository`); + // window.location.href=`/shixuns/${id}/repository`; + this.props.history.push(`/shixuns/${id}/repository`); }else if(e.key==="4"){ - window.location.href=`/shixuns/${id}/secret_repository`; - // this.props.history.replace(`/shixuns/${id}/secret_repository`); + // window.location.href=`/shixuns/${id}/secret_repository`; + this.props.history.push(`/shixuns/${id}/secret_repository`); }else if(e.key==="5"){ this.props.history.replace(`/shixuns/${id}/collaborators`); } else if (e.key === "6") { diff --git a/public/react/src/modules/tpm/TPMRepositoryComponent.js b/public/react/src/modules/tpm/TPMRepositoryComponent.js index 574d51925..4cb5bd3c6 100644 --- a/public/react/src/modules/tpm/TPMRepositoryComponent.js +++ b/public/react/src/modules/tpm/TPMRepositoryComponent.js @@ -27,7 +27,7 @@ class TPMRepositoryComponent extends Component { } } this.state = { - listItemtype:false, + listItemtypes:false, repositoryLoading: true, pathArray: pathArray, isContentWidth100: this._isFileInPathArray(pathArray) @@ -37,9 +37,11 @@ class TPMRepositoryComponent extends Component { componentDidUpdate(prevProps, prevState) { if (this.props.secret_repository_tab != prevProps.secret_repository_tab) { this.setState({ - listItemtype:false, + listItemtypes:false, }) - this.fetchRepo() + console.log(this.props) + console.log(this.state) + this.fetchRepo(0) } } @@ -180,7 +182,11 @@ class TPMRepositoryComponent extends Component { this.props.setpathArray(newPathArray) let urlNewPathArray = newPathArray; let fileInPathArray = false; - if (newPathArray.length&&!type) { + + + if (newPathArray.length&&!type&&typeof listItem != 'number') { + + fileInPathArray = this.nameTypeMap[newPathArray[newPathArray.length - 1]] ? this.nameTypeMap[newPathArray[newPathArray.length - 1]] !== 'tree' : (listItem ? listItem.type !== 'tree' : this._isFileName( newPathArray[newPathArray.length - 1] )) @@ -224,6 +230,7 @@ class TPMRepositoryComponent extends Component { } // 初始化时,repo接口完毕后需要看是否需要fetchCode + if (fileInPathArray&&!type) { // this.fetchCode(newPathArray) diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js index 5b62b353a..9b466c2c6 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js @@ -255,7 +255,7 @@ class RepositoryAddFile extends Component { })( this.setinput(e)}/> - 提示:1.输入 /文件名可以创建一个新文件;2.输入 /新文件夹名/新文件名 可以创建新文件夹和新文件 + 提示:1.输入 文件名 可以创建一个新文件;2.输入 新文件夹名/新文件名 可以创建新文件夹和新文件; )} diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCodeEditor.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCodeEditor.js index 9c7223433..adb85aff9 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCodeEditor.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCodeEditor.js @@ -126,8 +126,8 @@ class RepositoryCodeEditor extends Component { }) } setCohetepaperbool=(sum)=>{ - console.log(sum) - console.log(this.props.pathArray) + // console.log(sum) + // console.log(this.props.pathArray) this.props.oncodechanner(sum) } render() {