Commit a7528ad100a98c87a9fa9d1dda2399c6bd700b35
1 parent
da41b249
1.五彩:subBill子从表使用虚拟表格滚动
2.处理预览PFD,使用iframe方式
Showing
1 changed file
with
6 additions
and
2 deletions
src/components/Common/OfficePreview/index.js
| @@ -15,7 +15,7 @@ const OfficePreview = props => { | @@ -15,7 +15,7 @@ const OfficePreview = props => { | ||
| 15 | .pop() | 15 | .pop() |
| 16 | .split("_") | 16 | .split("_") |
| 17 | .pop(); | 17 | .pop(); |
| 18 | - const fileUrl = `${commonConfig.file_host}file/download?savePathStr=${encodeURIComponent(officeFileUrl)}&sModelsId=100&token=${app.token}`; | 18 | + const fileUrl = `${commonConfig.file_host}file/downloadView?savePathStr=${encodeURIComponent(officeFileUrl)}&sModelsId=100&token=${app.token}`; |
| 19 | const fileType = title | 19 | const fileType = title |
| 20 | .split(".") | 20 | .split(".") |
| 21 | .pop() | 21 | .pop() |
| @@ -40,7 +40,11 @@ const OfficePreview = props => { | @@ -40,7 +40,11 @@ const OfficePreview = props => { | ||
| 40 | }} | 40 | }} |
| 41 | > | 41 | > |
| 42 | <div style={{ width: "100%", height: "100%" }} ref={officeRef}> | 42 | <div style={{ width: "100%", height: "100%" }} ref={officeRef}> |
| 43 | - {fileType === "PDF" && <PrintPdf style={{ height: "100%" }} previewUrl={fileUrl} />} | 43 | + {fileType === 'PDF' && ( |
| 44 | + <div className="pdfContainer" style={{ width: '100%', height: '100%' }}> | ||
| 45 | + <iframe src={fileUrl} style={{ width: '100%', height: '100%' }} frameborder="0"></iframe> | ||
| 46 | + </div> | ||
| 47 | + )} | ||
| 44 | {['MP4', 'WEBM', 'OGG'].includes(fileType) && ( | 48 | {['MP4', 'WEBM', 'OGG'].includes(fileType) && ( |
| 45 | <div style={{ width: "100%", height: "100%", display: "flex", alignItems: "center", justifyContent: "center", overflow: "hidden" }}> | 49 | <div style={{ width: "100%", height: "100%", display: "flex", alignItems: "center", justifyContent: "center", overflow: "hidden" }}> |
| 46 | <video src={fileUrl} controls style={{ height: "100%" }} /> | 50 | <video src={fileUrl} controls style={{ height: "100%" }} /> |