版本库调整

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

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

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

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

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

@ -2,6 +2,7 @@ import React, { Component } from 'react';
import { Form , Upload , Input , notification, message } from 'antd'; import { Form , Upload , Input , notification, message } from 'antd';
import axios from 'axios'; import axios from 'axios';
import { getupload_git_file } from 'educoder'; import { getupload_git_file } from 'educoder';
import Repositoryfile from './Repositoryfile';
import Bottomsubmit from "../../../modals/Bottomsubmit"; import Bottomsubmit from "../../../modals/Bottomsubmit";
import "./Repository.css" import "./Repository.css"
const { Dragger } = Upload; const { Dragger } = Upload;
@ -10,6 +11,7 @@ class RepositoryAddFileupload_files extends Component {
super(props); super(props);
this.state={ this.state={
filspath:"", filspath:"",
visibles:false,
message:undefined, message:undefined,
fileList: [ fileList: [
// { // {
@ -49,11 +51,7 @@ class RepositoryAddFileupload_files extends Component {
console.log(info) console.log(info)
console.log(info.file) console.log(info.file)
// if (info.file.status === 'done') {
// notification.open({
// message: '提示',
// description: result.data.messages,
// });
let fileList = [...info.fileList]; let fileList = [...info.fileList];
fileList = fileList.slice(-2); fileList = fileList.slice(-2);
fileList = fileList.map(file => { fileList = fileList.map(file => {
@ -62,10 +60,8 @@ class RepositoryAddFileupload_files extends Component {
} }
return file; return file;
}); });
this.setState({ fileList }); this.setState({ fileList });
}
}; };
onAttachmentRemove=(info)=>{ onAttachmentRemove=(info)=>{
@ -110,6 +106,24 @@ class RepositoryAddFileupload_files extends Component {
message:e.target.value message:e.target.value
}) })
} }
Selectfiledirectory=()=>{
this.setState({
visibles:true
})
}
hideNewFolder=()=>{
this.setState({
visibles:false
})
}
selectupfilspath=(value)=>{
this.setState({
filspath:value
})
}
render(){ render(){
const {getFieldDecorator} = this.props.form; const {getFieldDecorator} = this.props.form;
let { shixunId } = this.props.match.params; let { shixunId } = this.props.match.params;
@ -151,7 +165,7 @@ class RepositoryAddFileupload_files extends Component {
message:this.state.message, message:this.state.message,
secret_repository:Repositoryflagtype secret_repository:Repositoryflagtype
}, },
// fileList:this.state.fileList, fileList:this.state.fileList,
// showUploadList:false, // showUploadList:false,
action: `${getupload_git_file(shixunId)}`, action: `${getupload_git_file(shixunId)}`,
onChange: this.handleChange, onChange: this.handleChange,
@ -170,6 +184,15 @@ class RepositoryAddFileupload_files extends Component {
return( return(
<div> <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"> <div className="educontent mt30">
<style> <style>
{` {`
@ -230,7 +253,7 @@ class RepositoryAddFileupload_files extends Component {
<p className="ant-form-item-label"> <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> </p>
{/*<div className="mt10 mb25 repoCMWrapper filecode">*/} {/*<div className="mt10 mb25 repoCMWrapper filecode">*/}

@ -30,10 +30,12 @@ class Repositoryfile extends Component{
let {main} =this.state; let {main} =this.state;
let matchpath =this.props.match.path; let matchpath =this.props.match.path;
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let url =""; let url ="";
if(matchpath==="/shixuns/:shixunId/repository"){ if( matchpath.indexOf("repository")>-1){
url ="/shixuns/"+id+"/repository.json"; url ="/shixuns/"+id+"/repository.json";
}else if(matchpath==="/shixuns/:shixunId/secret_repository"){ }
if(matchpath.indexOf("secret_repository")>-1){
url ="/shixuns/"+id+"/secret_repository.json"; url ="/shixuns/"+id+"/secret_repository.json";
} }
let newmain=[] let newmain=[]
@ -68,12 +70,13 @@ class Repositoryfile extends Component{
let matchpath =this.props.match.path; let matchpath =this.props.match.path;
let url =""; let url ="";
if(matchpath==="/shixuns/:shixunId/repository"){
if( matchpath.indexOf("repository")>-1){
url ="/shixuns/"+id+"/repository.json"; url ="/shixuns/"+id+"/repository.json";
}else if(matchpath==="/shixuns/:shixunId/secret_repository"){ }
if(matchpath.indexOf("secret_repository")>-1){
url ="/shixuns/"+id+"/secret_repository.json"; url ="/shixuns/"+id+"/secret_repository.json";
} }
let ary=main; let ary=main;
let paths=path; let paths=path;
@ -118,12 +121,19 @@ class Repositoryfile extends Component{
let {path}=this.state; let {path}=this.state;
let matchpath =this.props.match.path; let matchpath =this.props.match.path;
let flag =false; let flag =false;
if(matchpath==="/shixuns/:shixunId/repository"){
if( matchpath.indexOf("repository")>-1){
flag =false; flag =false;
}else if(matchpath==="/shixuns/:shixunId/secret_repository"){ }
if(matchpath.indexOf("secret_repository")>-1){
flag =true; 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`; let url=`/shixuns/${this.props.match.params.shixunId}/upload_git_folder.json`;
this.props.form.validateFieldsAndScroll((err, values) => { this.props.form.validateFieldsAndScroll((err, values) => {
if (!err) { if (!err) {
@ -136,6 +146,7 @@ class Repositoryfile extends Component{
if(result){ if(result){
if(result.data.status===0){ if(result.data.status===0){
this.props.showNotification("新建成功") this.props.showNotification("新建成功")
this.props.hideNewFolder();
} }
} }
}).catch((error)=>{ }).catch((error)=>{
@ -143,6 +154,8 @@ class Repositoryfile extends Component{
}) })
} }
}); });
}
}; };
render(){ render(){
@ -154,7 +167,7 @@ class Repositoryfile extends Component{
return( return(
evaluationvisible===true?<Modal evaluationvisible===true?<Modal
keyboard={false} keyboard={false}
title="新建文件夹" title={this.props.titles?this.props.titles:"新建文件夹"}
visible={evaluationvisible} visible={evaluationvisible}
closable={false} closable={false}
footer={false} footer={false}
@ -202,7 +215,7 @@ class Repositoryfile extends Component{
<div className="clearfix mt5"> <div className="clearfix mt5">
<label className=" mt5">选中的新建文件夹目录</label> <label className=" mt5">选中的新建文件夹目录</label>
<div className={"mt5 mb5"} >{path}</div> <div className={"mt5 mb5"} >{path}</div>
<Form> {this.props.selectupfils===true?"": <Form>
<Form.Item <Form.Item
className="mt15" className="mt15"
> >
@ -218,9 +231,10 @@ class Repositoryfile extends Component{
/> />
)} )}
</Form.Item> </Form.Item>
</Form> </Form>}
</div> </div>
<div className={"clearfix edu-txt-center mt20"}>
<a className="task-btn task-btn-orange fr" <a className="task-btn task-btn-orange fr"
style={{marginTop: '20px',marginLeft:'20px'}} id="add_path" style={{marginTop: '20px',marginLeft:'20px'}} id="add_path"
// onClick={()=>this.evaluationenter()} // onClick={()=>this.evaluationenter()}
@ -228,6 +242,8 @@ class Repositoryfile extends Component{
<a className="pop_close task-btn mb10 fr" <a className="pop_close task-btn mb10 fr"
style={{marginTop: '20px'}} id="back_page" onClick={()=>this.evaluationhideModal()}>取消</a> style={{marginTop: '20px'}} id="back_page" onClick={()=>this.evaluationhideModal()}>取消</a>
</div> </div>
</div>
</div> </div>
</Modal>:"" </Modal>:""
) )

Loading…
Cancel
Save