From a840bdcd902f22bf46232228e961a5937b405c4f Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Fri, 29 Jul 2022 16:05:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A3=E4=BC=A0=E8=A7=86=E9=A2=91=E7=BC=96?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/client/src/components/Upload/index.js | 36 +++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) 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); } }