|
|
@ -28,31 +28,13 @@ class RepositoryAddFileupload_files extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
handleSubmit = () =>{
|
|
|
|
|
|
|
|
this.props.form.validateFieldsAndScroll((err, values) => {
|
|
|
|
|
|
|
|
if(!err){
|
|
|
|
|
|
|
|
// let shixunId = this.props.match.params.shixunId;
|
|
|
|
|
|
|
|
// let url = `/shixuns/${shixunId}/add_file.json`
|
|
|
|
|
|
|
|
// axios.post(url,{
|
|
|
|
|
|
|
|
// path:values.path,
|
|
|
|
|
|
|
|
// message:values.message,
|
|
|
|
|
|
|
|
// content:this.extend_editor.getValue()
|
|
|
|
|
|
|
|
// }).then((result)=>{
|
|
|
|
|
|
|
|
// if(result){
|
|
|
|
|
|
|
|
// this.props.history.push(`${result.data.url}`)
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }).catch((error)=>{
|
|
|
|
|
|
|
|
// console.log(error);
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
handleChange = (info) => {
|
|
|
|
handleChange = (info) => {
|
|
|
|
console.log(info)
|
|
|
|
|
|
|
|
console.log(info.file)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (info.file.status === 'done') {
|
|
|
|
if (info.file.status === 'uploading' || info.file.status === 'done') {
|
|
|
|
let fileList = [...info.fileList];
|
|
|
|
let fileList = [...info.fileList];
|
|
|
|
|
|
|
|
console.log(info)
|
|
|
|
|
|
|
|
console.log(info.file)
|
|
|
|
|
|
|
|
console.log(fileList)
|
|
|
|
fileList = fileList.slice(-2);
|
|
|
|
fileList = fileList.slice(-2);
|
|
|
|
fileList = fileList.map(file => {
|
|
|
|
fileList = fileList.map(file => {
|
|
|
|
if (file.response) {
|
|
|
|
if (file.response) {
|
|
|
@ -231,7 +213,7 @@ class RepositoryAddFileupload_files extends Component {
|
|
|
|
{/* <Breadcrumb.Item>添加新文件</Breadcrumb.Item>*/}
|
|
|
|
{/* <Breadcrumb.Item>添加新文件</Breadcrumb.Item>*/}
|
|
|
|
{/* </Breadcrumb>*/}
|
|
|
|
{/* </Breadcrumb>*/}
|
|
|
|
{/*</p>*/}
|
|
|
|
{/*</p>*/}
|
|
|
|
<Form onSubmit={this.handleSubmit} className="formStyle">
|
|
|
|
<Form className="formStyle">
|
|
|
|
<div className="edu-back-white padding20-30 mb10">
|
|
|
|
<div className="edu-back-white padding20-30 mb10">
|
|
|
|
|
|
|
|
|
|
|
|
<p className="ant-form-item-label">
|
|
|
|
<p className="ant-form-item-label">
|
|
|
@ -284,7 +266,7 @@ class RepositoryAddFileupload_files extends Component {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Form>
|
|
|
|
</Form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<Bottomsubmit {...this.props} {...this.state} url={`/shixuns/${shixunId}/${Repositoryflag}`} onSubmits={() => this.handleSubmit()}/>
|
|
|
|
<Bottomsubmit {...this.props} {...this.state} url={`/shixuns/${shixunId}/${Repositoryflag}`}/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|