diff --git a/public/react/src/modules/tpm/TPMIndex.js b/public/react/src/modules/tpm/TPMIndex.js
index 392808197..392242393 100644
--- a/public/react/src/modules/tpm/TPMIndex.js
+++ b/public/react/src/modules/tpm/TPMIndex.js
@@ -160,7 +160,8 @@ class TPMIndex extends Component {
tpmindexjupyterbool:false,
is_jupyter:false,
selectedKeys:"",
- openknows:false
+ openknows:false,
+ newathArray:[]
}
}
@@ -390,6 +391,11 @@ class TPMIndex extends Component {
}else if(e.key==="9"){
this.props.history.replace(`/shixuns/${id}/settings`);
}
+ }
+ setpathArray=(list)=>{
+ this.setState({
+ newathArray:list
+ })
}
render() {
@@ -539,24 +545,24 @@ class TPMIndex extends Component {
( (this.setpathArray(value)}
/>)
}>
( (this.setpathArray(value)}
/>)
}>
( (this.setpathArray(value)}
/>)
}>
( (this.setpathArray(value)}
/>)
}>
@@ -588,7 +594,7 @@ class TPMIndex extends Component {
()
+ (props) => (this.getcomponentdidmount()} />)
}>
{/*实训项目条目塞选*/}
diff --git a/public/react/src/modules/tpm/TPMRepositoryComponent.js b/public/react/src/modules/tpm/TPMRepositoryComponent.js
index e1806f524..aa5a35185 100644
--- a/public/react/src/modules/tpm/TPMRepositoryComponent.js
+++ b/public/react/src/modules/tpm/TPMRepositoryComponent.js
@@ -32,6 +32,7 @@ class TPMRepositoryComponent extends Component {
pathArray: pathArray,
isContentWidth100: this._isFileInPathArray(pathArray)
}
+ this.props.setpathArray(pathArray)
}
componentDidUpdate(prevProps, prevState) {
if (this.props.secret_repository_tab != prevProps.secret_repository_tab) {
@@ -106,6 +107,7 @@ class TPMRepositoryComponent extends Component {
})
this.setState({ repositoryLoading: true, pathArray: newPathArray })
+ this.props.setpathArray(newPathArray)
this.setState({
fileContent: response.data.content,
repositoryLoading: false
@@ -113,7 +115,7 @@ class TPMRepositoryComponent extends Component {
if(response.data.content){
this.props.history
- .replace(`/shixuns/${id}/repository` +
+ .replace(`/shixuns/${id}/${this.props.secret_repository_tab ? 'secret_repository' : 'repository'}` +
(newPathArray.length ? `/master/shixun_show/${newPathArray.join('/')}` : ''))
// this.props.history.replace(`${this.props.match.url}/master/shixun_show/${newPathArray.join('/')}`)
}
@@ -174,6 +176,7 @@ class TPMRepositoryComponent extends Component {
}
// https://testeduplus2.educoder.net/shixuns/3ozvy5f8/repository.json
this.setState({ repositoryLoading: true, pathArray: newPathArray })
+ this.props.setpathArray(newPathArray)
let urlNewPathArray = newPathArray;
let fileInPathArray = false;
if (newPathArray.length) {
@@ -215,7 +218,7 @@ class TPMRepositoryComponent extends Component {
});
this.props.history
- .replace(`/shixuns/${id}/repository` +
+ .replace(`/shixuns/${id}/${this.props.secret_repository_tab ? 'secret_repository' : 'repository'}` +
(newPathArray.length ? `/master/shixun_show/${newPathArray.join('/')}` : ''))
}
@@ -237,16 +240,7 @@ class TPMRepositoryComponent extends Component {
}
render() {
const { listItemtypes } = this.state;
- let matchpath =this.props.match.path;
- let flag =false;
- // if(matchpath==="/shixuns/:shixunId/repository"){
- // flag =true;
- // }else if(matchpath==="/shixuns/:shixunId/secret_repository"){
- // flag =true;
- // }
-
- // 需要重构
return (
{ listItemtypes===false? 4||this.props.identity===undefined ?"":
(this.props.is_jupyter===false?
- 版本库
+ 版本库
:"")
}
- {this.props.identity >4||this.props.identity===undefined ?"": secret_repository && 私密版本库}
+ {this.props.identity >4||this.props.identity===undefined ?"": secret_repository && 私密版本库}
合作者
diff --git a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js
index fc1e0ee70..8233af78a 100644
--- a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js
+++ b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js
@@ -189,6 +189,7 @@ class Repository extends Component {
{this.state.evaluationvisible===true?this.hideNewFolder()}
setfilepath={(path)=>this.setfilepath(path)}
/>:""}
diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js
index 5ac18c2b4..af7fe1275 100644
--- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js
+++ b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js
@@ -88,7 +88,7 @@ class RepositoryAddFile extends Component {
window.editor_tempCodeMirror = extend_editor;
this.extend_editor = extend_editor;
}
-
+
checkPath= (rule, value, callback) =>{
if(!value){
callback('文件名不能为空');
@@ -179,6 +179,19 @@ class RepositoryAddFile extends Component {
{/* */}
{/*
*/}