diff --git a/web/client/src/components/Upload/index.js b/web/client/src/components/Upload/index.js index 0bd3af10..29555be7 100644 --- a/web/client/src/components/Upload/index.js +++ b/web/client/src/components/Upload/index.js @@ -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 - // }; - // }); - // onChange(defaultFileList) - // this.setState({ - // fileList: defaultFileList - // }); - // }; + 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 + }); + }; componentDidMount() { const { value } = this.props; if (value) { - this.setState(value); + this.setFileList(value); } }