| | |
| | | if (!row.link) { |
| | | ElMessage.warning('文件链接不存在') |
| | | } else if (allSupportedExtensions.includes(fileType)){ |
| | | let url = `${VITE_APP_PREVIEW_URL}/onlinePreview?url=` + encodeURIComponent(Base64.encode(row.link)) |
| | | // word/pdf 以可编辑的 html 模式打开(与 excel 一致) |
| | | if (editableOfficeTypes.includes(fileType)) { |
| | | url += '&officePreviewType=html' |
| | | } |
| | | window.open(url) |
| | | // let url = `${VITE_APP_PREVIEW_URL}/onlinePreview?url=` + encodeURIComponent(Base64.encode(row.link)) |
| | | // // word/pdf 以可编辑的 html 模式打开(与 excel 一致) |
| | | // if (editableOfficeTypes.includes(fileType)) { |
| | | // url += '&officePreviewType=html' |
| | | // } |
| | | // window.open(url) |
| | | const route = router.resolve({ |
| | | path: '/documentPreview/officeEdit', |
| | | query: { |
| | | attachId: row.id, |
| | | mode: 'view', |
| | | }, |
| | | }) |
| | | window.open(route.href, '_blank') |
| | | } else { |
| | | ElMessage.warning(`${fileType}文件格式,可以下载再查看`) |
| | | } |
| | |
| | | path: '/documentPreview/officeEdit', |
| | | query: { |
| | | attachId: row.id, |
| | | mode: 'edit', |
| | | }, |
| | | }) |
| | | window.open(route.href, '_blank') |