| | |
| | | import Utils from '@/utils/utils.js' |
| | | import './index.scss' |
| | | |
| | | // let Url = '/Upload' |
| | | // if (process.env.NODE_ENV === 'production') { |
| | | // Url = document.location.origin + '/' + window.GLOB.service + 'zh-CN/Home/Upload' |
| | | // } |
| | | |
| | | let service = '' |
| | | if (process.env.NODE_ENV === 'production') { |
| | | service = document.location.origin + '/' + window.GLOB.service |
| | |
| | | |
| | | class FileUpload extends Component { |
| | | static propTpyes = { |
| | | value: PropTypes.array, // 按钮信息、表单列表 |
| | | value: PropTypes.array, // 文件数组 |
| | | maxFile: PropTypes.any, // 最大文件数 |
| | | fileType: PropTypes.string // 文件显示类型 |
| | | } |
| | |
| | | duration: 5 |
| | | }) |
| | | } |
| | | |
| | | // getExtraData = () => { |
| | | // return { |
| | | // RootPath: 'Content/images/upload/' |
| | | // } |
| | | // } |
| | | |
| | | shardupload = (params) => { |
| | | let param = params.chunks.shift() |
| | |
| | | chunkFileReader.readAsArrayBuffer(blobSlice.call(file, start, end)) |
| | | } |
| | | |
| | | // loadNext() |
| | | return false |
| | | } |
| | | |
| | |
| | | multiple: false, |
| | | onChange: this.onChange, |
| | | onRemove: this.onRemove, |
| | | // data: this.getExtraData, |
| | | beforeUpload: this.beforeUpload, |
| | | className: uploadable |
| | | } |
| | | |
| | | return ( |
| | | <Upload {...props}> |
| | | <Button> |
| | | {fileType !== 'picture-card' ? <Button> |
| | | <Icon type="upload" /> 点击上传 |
| | | </Button> |
| | | </Button> : null} |
| | | {fileType === 'picture-card' ? <span style={{whiteSpace: 'nowrap'}}> |
| | | <Icon type="upload" /> 点击上传 |
| | | </span> : null} |
| | | {showprogress ? <Progress percent={percent} size="small" /> : null} |
| | | </Upload> |
| | | ) |