Commit 6c0178da authored by GuanHua's avatar GuanHua
parents 798857bd 7a07d622
......@@ -54,6 +54,7 @@ const ImgUpload = forwardRef((props: IProps, ref: any) => {
useImperativeHandle(ref, () => ({
setData(imgs: string[]) {
if (imgs) {
const newFileList = imgs.map((item, index) => {
return {
uid: `uid${index}`,
......@@ -65,6 +66,7 @@ const ImgUpload = forwardRef((props: IProps, ref: any) => {
// 直接走一次回调,使值可以set进表单
handleChange({ file: { status: 'success' }, fileList: newFileList})
// setFileList(newFileList)
}
},
}))
......
......@@ -156,8 +156,8 @@ const OwnMallAboutUs = () => {
const { albumName, albumUrl, honorPics, workshopPics, ...rest } = data
const newAlbumUrls = albumName && albumUrl ? [{ name: albumName, url: albumUrl }] : []
workshopImgRef.current?.setData(workshopPics)
honorImgRef.current?.setData(honorPics)
workshopPics && workshopImgRef.current?.setData(workshopPics)
honorPics && honorImgRef.current?.setData(honorPics)
form.setFieldsValue({
...rest,
albumUrls: newAlbumUrls
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment