版本库调整

dev_new_shixunsrepository
杨树明 5 years ago
parent 911b8d6270
commit 113dfe2768

@ -326,8 +326,8 @@ module.exports = {
comments: false
},
compress: {
drop_debugger: true,
drop_console: true
drop_debugger: false,
drop_console: false
}
}
}),

@ -83,7 +83,7 @@ export function initAxiosInterceptors(props) {
//proxy="http://47.96.87.25:48080"
proxy="https://pre-newweb.educoder.net"
proxy="https://test-newweb.educoder.net"
// proxy="https://test-jupyterweb.educoder.net"
proxy="https://test-jupyterweb.educoder.net"
//proxy="http://192.168.2.63:3001"
// 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求

@ -12,7 +12,7 @@ class Bottomsubmit extends Component {
cannelfun = () => {
// window.location.href=
debugger
if(this.props.Cohetepaperbool===true){
this.props.setCohetepaperbool(false);
}else {

@ -54,11 +54,15 @@ class Repository extends Component {
let { match, author, git_url, lastest_commit,repositoryLoading, commits,trees,pathArray , TPMRightSectionData } = this.props;
let matchpath =this.props.match.path;
let Repositoryflag ="";
if(matchpath==="/shixuns/:shixunId/repository"){
if( matchpath.indexOf("repository")>-1){
Repositoryflag ="repository";
}else if(matchpath==="/shixuns/:shixunId/secret_repository"){
}
if(matchpath.indexOf("secret_repository")>-1){
Repositoryflag ="secret_repository";
}
if (!author) {
author = {}
}

@ -2,6 +2,7 @@ import React, { Component } from 'react';
import { Form , Upload , Input , notification, message } from 'antd';
import axios from 'axios';
import { getupload_git_file } from 'educoder';
import Repositoryfile from './Repositoryfile';
import Bottomsubmit from "../../../modals/Bottomsubmit";
import "./Repository.css"
const { Dragger } = Upload;
@ -10,6 +11,7 @@ class RepositoryAddFileupload_files extends Component {
super(props);
this.state={
filspath:"",
visibles:false,
message:undefined,
fileList: [
// {
@ -49,23 +51,17 @@ class RepositoryAddFileupload_files extends Component {
console.log(info)
console.log(info.file)
//
// notification.open({
// message: '提示',
// description: result.data.messages,
// });
let fileList = [...info.fileList];
fileList = fileList.slice(-2);
fileList = fileList.map(file => {
if (file.response) {
file.url = file.response.url;
}
return file;
});
this.setState({ fileList });
if (info.file.status === 'done') {
let fileList = [...info.fileList];
fileList = fileList.slice(-2);
fileList = fileList.map(file => {
if (file.response) {
file.url = file.response.url;
}
return file;
});
this.setState({ fileList });
}
};
onAttachmentRemove=(info)=>{
@ -110,6 +106,24 @@ class RepositoryAddFileupload_files extends Component {
message:e.target.value
})
}
Selectfiledirectory=()=>{
this.setState({
visibles:true
})
}
hideNewFolder=()=>{
this.setState({
visibles:false
})
}
selectupfilspath=(value)=>{
this.setState({
filspath:value
})
}
render(){
const {getFieldDecorator} = this.props.form;
let { shixunId } = this.props.match.params;
@ -151,7 +165,7 @@ class RepositoryAddFileupload_files extends Component {
message:this.state.message,
secret_repository:Repositoryflagtype
},
// fileList:this.state.fileList,
fileList:this.state.fileList,
// showUploadList:false,
action: `${getupload_git_file(shixunId)}`,
onChange: this.handleChange,
@ -170,6 +184,15 @@ class RepositoryAddFileupload_files extends Component {
return(
<div>
{this.state.visibles===true?<Repositoryfile
titles={"选择文件上传目录"}
evaluationvisible={this.state.visibles}
hideNewFolder={this.hideNewFolder}
{...this.state}
{...this.props}
selectupfils={true}
selectupfilspath={(value)=>this.selectupfilspath(value)}
/>:""}
<div className="educontent mt30">
<style>
{`
@ -230,7 +253,7 @@ class RepositoryAddFileupload_files extends Component {
<p className="ant-form-item-label">
<div className={"color888 font-16"}>{this.state.filspath} <span className={"color-blue"}>选择文件目录</span></div>
<div className={"color888 font-16"}>当前目录{this.state.filspath===""?"./":this.state.filspath} <span className={"color-blue"} onClick={this.Selectfiledirectory}>选择文件目录</span></div>
</p>
{/*<div className="mt10 mb25 repoCMWrapper filecode">*/}

@ -30,10 +30,12 @@ class Repositoryfile extends Component{
let {main} =this.state;
let matchpath =this.props.match.path;
let id = this.props.match.params.shixunId;
let url ="";
if(matchpath==="/shixuns/:shixunId/repository"){
if( matchpath.indexOf("repository")>-1){
url ="/shixuns/"+id+"/repository.json";
}else if(matchpath==="/shixuns/:shixunId/secret_repository"){
}
if(matchpath.indexOf("secret_repository")>-1){
url ="/shixuns/"+id+"/secret_repository.json";
}
let newmain=[]
@ -68,12 +70,13 @@ class Repositoryfile extends Component{
let matchpath =this.props.match.path;
let url ="";
if(matchpath==="/shixuns/:shixunId/repository"){
if( matchpath.indexOf("repository")>-1){
url ="/shixuns/"+id+"/repository.json";
}else if(matchpath==="/shixuns/:shixunId/secret_repository"){
}
if(matchpath.indexOf("secret_repository")>-1){
url ="/shixuns/"+id+"/secret_repository.json";
}
let ary=main;
let paths=path;
@ -115,34 +118,44 @@ class Repositoryfile extends Component{
}
handleSubmit = (e) => {
let {path}=this.state;
let matchpath =this.props.match.path;
let flag =false;
if(matchpath==="/shixuns/:shixunId/repository"){
flag =false;
}else if(matchpath==="/shixuns/:shixunId/secret_repository"){
flag =true;
}
let url=`/shixuns/${this.props.match.params.shixunId}/upload_git_folder.json`;
this.props.form.validateFieldsAndScroll((err, values) => {
if (!err) {
console.log('Received values of form: ', values);
let paths=path+values.name;
axios.post(url,{
path: paths,
secret_repository:flag,
}).then((result)=>{
if(result){
if(result.data.status===0){
this.props.showNotification("新建成功")
let {path}=this.state;
let matchpath =this.props.match.path;
let flag =false;
if( matchpath.indexOf("repository")>-1){
flag =false;
}
if(matchpath.indexOf("secret_repository")>-1){
flag =true;
}
if(this.props.selectupfils===true){
console.log(path)
this.props.selectupfilspath(path);
this.props.showNotification("选择文件目录成功")
this.props.hideNewFolder();
}else{
let url=`/shixuns/${this.props.match.params.shixunId}/upload_git_folder.json`;
this.props.form.validateFieldsAndScroll((err, values) => {
if (!err) {
console.log('Received values of form: ', values);
let paths=path+values.name;
axios.post(url,{
path: paths,
secret_repository:flag,
}).then((result)=>{
if(result){
if(result.data.status===0){
this.props.showNotification("新建成功")
this.props.hideNewFolder();
}
}
}
}).catch((error)=>{
console.log(error);
})
}
});
}).catch((error)=>{
console.log(error);
})
}
});
}
};
render(){
@ -154,7 +167,7 @@ class Repositoryfile extends Component{
return(
evaluationvisible===true?<Modal
keyboard={false}
title="新建文件夹"
title={this.props.titles?this.props.titles:"新建文件夹"}
visible={evaluationvisible}
closable={false}
footer={false}
@ -199,10 +212,10 @@ class Repositoryfile extends Component{
<span onClick={()=>this.savegetfilepath(path+item.name,item.type)}>{item.name}</span>
</a>
*/}
<div className="clearfix mt5">
<div className="clearfix mt5">
<label className=" mt5">选中的新建文件夹目录</label>
<div className={"mt5 mb5"} >{path}</div>
<Form>
{this.props.selectupfils===true?"": <Form>
<Form.Item
className="mt15"
>
@ -218,15 +231,18 @@ class Repositoryfile extends Component{
/>
)}
</Form.Item>
</Form>
</Form>}
</div>
<a className="task-btn task-btn-orange fr"
style={{marginTop: '20px',marginLeft:'20px'}} id="add_path"
// onClick={()=>this.evaluationenter()}
onClick={() => this.handleSubmit()}>确定</a>
<a className="pop_close task-btn mb10 fr"
style={{marginTop: '20px'}} id="back_page" onClick={()=>this.evaluationhideModal()}>取消</a>
<div className={"clearfix edu-txt-center mt20"}>
<a className="task-btn task-btn-orange fr"
style={{marginTop: '20px',marginLeft:'20px'}} id="add_path"
// onClick={()=>this.evaluationenter()}
onClick={() => this.handleSubmit()}>确定</a>
<a className="pop_close task-btn mb10 fr"
style={{marginTop: '20px'}} id="back_page" onClick={()=>this.evaluationhideModal()}>取消</a>
</div>
</div>
</div>
</Modal>:""

Loading…
Cancel
Save