From c09054de5e7ff5efc030aca953f943adb44f8133 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Sun, 29 Sep 2019 13:46:00 +0800
Subject: [PATCH] map
---
public/react/src/modules/tpm/TPMRepositoryComponent.js | 6 ++++--
.../tpm/shixunchild/Repository/RepositoryDirectories.js | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/public/react/src/modules/tpm/TPMRepositoryComponent.js b/public/react/src/modules/tpm/TPMRepositoryComponent.js
index 50d163f51..a24fab844 100644
--- a/public/react/src/modules/tpm/TPMRepositoryComponent.js
+++ b/public/react/src/modules/tpm/TPMRepositoryComponent.js
@@ -38,6 +38,7 @@ class TPMRepositoryComponent extends Component {
componentDidMount = () => {
+ this.nameTypeMap = {}
this.fetchRepo()
}
setContentWidth100 = (flag) => {
@@ -117,7 +118,7 @@ class TPMRepositoryComponent extends Component {
if (listItem === 0 || listItem) {
this.setContentWidth100(false)
-
+ this.nameTypeMap[listItem.name] = listItem.type
if (typeof listItem == 'number') { // 参数是数字的话,做截取
// if (this._isFileName(newPathArray[listItem])) { // 面包屑中的文件不让点击了
// listItem--;
@@ -195,6 +196,7 @@ class TPMRepositoryComponent extends Component {
{ !isContentWidth100 ?
@@ -208,7 +210,7 @@ class TPMRepositoryComponent extends Component {
{...this.props}
fetchRepo={this.fetchRepo}
saveCode={this.saveCode}
-
+ nameTypeMap={this.nameTypeMap}
>
diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryDirectories.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryDirectories.js
index 999d42dd3..7c6eca37a 100644
--- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryDirectories.js
+++ b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryDirectories.js
@@ -42,7 +42,7 @@ class RepositoryDirectories extends Component {
// /shixuns/3ozvy5f8/repository/3ozvy5f8/master/shixun_show/src
return (
- { item.indexOf('.') === -1
+ { this.props.nameTypeMap[item] === 'tree' || item.indexOf('.') === -1
? fetchRepo(index + 1)}
className="color-blue">