| | |
| | | |
| | | class FileUpload extends Component { |
| | | static propTpyes = { |
| | | config: PropTypes.object, // 表单信息 |
| | | onChange: PropTypes.func, // 表单变化 |
| | | data: PropTypes.any, |
| | | config: PropTypes.object, |
| | | onChange: PropTypes.func, |
| | | } |
| | | |
| | | state = { |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config } = this.props |
| | | const { config, data } = this.props |
| | | |
| | | let filelist = [] |
| | | if (config.initval) { |
| | |
| | | }) |
| | | } catch (e) { |
| | | filelist = [] |
| | | } |
| | | |
| | | if (data && config.subFields && config.subFields.length === 1 && filelist.length === 1) { |
| | | if (data[config.subFields[0].field]) { |
| | | filelist[0].name = data[config.subFields[0].field] |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | percent: 0 |
| | | }) |
| | | |
| | | let file_name = file.name.replace(/\.{1}[^.]*$/ig, '') |
| | | let file_name = file.name |
| | | |
| | | if (compress === 'true' || compress === 'base64') { |
| | | let reader = new FileReader() |