From 8d24b2559c9929814b31c0615bdcf915669350af Mon Sep 17 00:00:00 2001 From: Mr Ke <kelq@hugeinfo.com.cn> Date: Sat, 16 May 2020 13:49:11 +0800 Subject: [PATCH] 加入下载链接 --- src/components/page/DocumentDetailPage/index.jsx | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/page/DocumentDetailPage/index.jsx b/src/components/page/DocumentDetailPage/index.jsx index 24bc71a..834e778 100644 --- a/src/components/page/DocumentDetailPage/index.jsx +++ b/src/components/page/DocumentDetailPage/index.jsx @@ -58,7 +58,7 @@ documentType: res.documentType || 'DT00002' }, loading: false, - fileList: res.attachmentList && res.attachmentList.map((a) => ({ ...a, key: a.id, uid: a.id, name: a.fileName + '.' + a.suffix, })) || [] + fileList: res.attachmentList && res.attachmentList.map((a) => ({ ...a, key: a.id, uid: a.id, name: a.fileName + '.' + a.suffix, status: 'done' })) || [] }); }); } @@ -136,6 +136,16 @@ header: { Authorization: window.localStorage.getItem('token') }, + showUploadList: { + showDownloadIcon: true, + showRemoveIcon: false, + showPreviewIcon: true + }, + onDownload: (file) => { + // console.log('file', file) + window.open(file.downloadUrl); + + }, onChange: ({ file, fileList }) => { fileList = fileList.slice(-2); fileList = fileList.map(file => { @@ -151,7 +161,6 @@ onPreview: (file) => { window.open(file.url); }, - showUploadList: { showPreviewIcon: true, showDownloadIcon: true, showRemoveIcon: false } }; return ( -- Gitblit v1.8.0