dev_new_shixunsrepository
杨树明 5 years ago
parent cfbb8acfed
commit 0f09dae408

@ -40,7 +40,7 @@ class Bottomsubmit extends Component {
<button type="button" className="ant-btn mr20 newshixunmode backgroundFFF" onClick={() => this.cannelfun()}>
<span> </span></button>
<Button type="button" className="ant-btn newshixunmode mr40 ant-btn-primary" type="primary"
htmlType="submit" onClick={() => this.props.onSubmits()}
htmlType="submit" onClick={this.props.onSubmits?() => this.props.onSubmits():() => this.cannelfun()}
loading={this.props.loadings}><span>{this.props.bottomvalue===undefined?"保存":this.props.bottomvalue}</span></Button>
</div>
</div>

@ -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) => {
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];
console.log(info)
console.log(info.file)
console.log(fileList)
fileList = fileList.slice(-2);
fileList = fileList.map(file => {
if (file.response) {
@ -231,7 +213,7 @@ class RepositoryAddFileupload_files extends Component {
{/* <Breadcrumb.Item>添加新文件</Breadcrumb.Item>*/}
{/* </Breadcrumb>*/}
{/*</p>*/}
<Form onSubmit={this.handleSubmit} className="formStyle">
<Form className="formStyle">
<div className="edu-back-white padding20-30 mb10">
<p className="ant-form-item-label">
@ -284,7 +266,7 @@ class RepositoryAddFileupload_files extends Component {
</div>
</Form>
</div>
<Bottomsubmit {...this.props} {...this.state} url={`/shixuns/${shixunId}/${Repositoryflag}`} onSubmits={() => this.handleSubmit()}/>
<Bottomsubmit {...this.props} {...this.state} url={`/shixuns/${shixunId}/${Repositoryflag}`}/>
</div>
)
}

Loading…
Cancel
Save