app-base-web
Version:
web development common base package.
47 lines (43 loc) • 1.56 kB
JavaScript
// import React from 'react';
// import { Upload, Button } from 'antd';
// export default class File extends React.Component {
// constructor(props) {
// super(props);
// this.state = {
// fileList:"[]"
// };
// }
// componentDidMount() {
// this.props.onRef&&this.props.onRef(this);
// }
// onChange(info){
// console.log("info:%o",info)
// let fileList = [...info.fileList];
// fileList = fileList.map(file => {
// if (file.response) {
// console.log("rep:%o",file.response)
// file.url = (this.props.serverPath||"")+file.response.data.file[0];
// file.thumbUrl=file.url;
// console.log("callback:%s",this.props.callback)
// if(this.props.callback)this.props.callback(file.response);
// delete file.lastModifiedDate;
// delete file.originFileObj;
// delete file.response;
// }
// return file;
// });
// if(fileList)fileList=JSON.stringify(fileList);
// if(this.props.onChange)this.props.onChange(fileList);
// else this.setState({fileList});
// };
// render() {
// let _fileList=JSON.parse(this.props.fileList||this.state.fileList);
// return (
// <Upload className="app-upload" action={this.props.action} multiple={true} onChange={this.onChange.bind(this)} fileList={_fileList} listType="picture">
// <Button style={{display:this.props.hide=="true"?"none":""}}>
// <UploadOutlined />{this.props.buttonText||"上传"}
// </Button>
// </Upload>
// );
// }
// }