|
|
@ -27,28 +27,28 @@ class Uploads extends Component { |
|
|
|
return showName |
|
|
|
} |
|
|
|
|
|
|
|
// setFileList = (value) => {
|
|
|
|
// let defaultFileList = [];
|
|
|
|
// defaultFileList = value.map((u, index) => {
|
|
|
|
// let fileUrl = `${this.ApiRoot}/${u.url}`;
|
|
|
|
// return {
|
|
|
|
// uid: -index - 1,
|
|
|
|
// name: this.dealName(u.url),
|
|
|
|
// status: 'done',
|
|
|
|
// storageUrl: u.url,
|
|
|
|
// url: fileUrl
|
|
|
|
// };
|
|
|
|
// });
|
|
|
|
setFileList = (value) => { |
|
|
|
let defaultFileList = []; |
|
|
|
defaultFileList = value.map((u, index) => { |
|
|
|
let fileUrl = `${this.ApiRoot}/${u.url}`; |
|
|
|
return { |
|
|
|
uid: -index - 1, |
|
|
|
name: this.dealName(u.url), |
|
|
|
status: 'done', |
|
|
|
storageUrl: u.url, |
|
|
|
url: fileUrl |
|
|
|
}; |
|
|
|
}); |
|
|
|
// onChange(defaultFileList)
|
|
|
|
// this.setState({
|
|
|
|
// fileList: defaultFileList
|
|
|
|
// });
|
|
|
|
// };
|
|
|
|
this.setState({ |
|
|
|
fileList: defaultFileList |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
componentDidMount() { |
|
|
|
const { value } = this.props; |
|
|
|
if (value) { |
|
|
|
this.setState(value); |
|
|
|
this.setFileList(value); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|