|
|
@@ -877,13 +877,13 @@
|
|
|
</svg>
|
|
|
</div>
|
|
|
<iframe
|
|
|
- v-if="docPreviewType === 'pdf'"
|
|
|
- :src="docPreviewUrl"
|
|
|
+ v-if="docPreviewType === 'pdf' || docPreviewType === 'office'"
|
|
|
+ :src="getDocPreviewUrl(docPreviewType, docPreviewUrl)"
|
|
|
class="file-preview-frame"
|
|
|
frameborder="0"
|
|
|
></iframe>
|
|
|
<div v-else class="file-preview-office">
|
|
|
- <div class="file-preview-office-icon">📝</div>
|
|
|
+ <div class="file-preview-office-icon">📎</div>
|
|
|
<div class="file-preview-office-name">{{ docPreviewUrl.split('/').pop() }}</div>
|
|
|
<a :href="docPreviewUrl" target="_blank" class="file-preview-office-link">
|
|
|
{{ lang.ssClickToOpen }}
|
|
|
@@ -1080,7 +1080,7 @@ const processWorkContent = async (content: string, toolType: number): Promise<an
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- if ([45, 15, 78, 79, 831].includes(toolType)) {
|
|
|
+ if ([45, 15, 78, 79, 84, 831].includes(toolType)) {
|
|
|
return JSON.parse(decodeURIComponent(contentToParse))
|
|
|
}
|
|
|
else if (toolType === 72) {
|
|
|
@@ -1211,6 +1211,17 @@ const docPreviewVisible = ref(false)
|
|
|
const docPreviewUrl = ref('')
|
|
|
const docPreviewType = ref('')
|
|
|
|
|
|
+// 文档预览(PDF / Office 均使用 Microsoft Office Online Viewer)
|
|
|
+const getDocPreviewUrl = (type: string, url: string) => {
|
|
|
+ if (type === 'office') {
|
|
|
+ return `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(url)}&time=${new Date().getTime()}`
|
|
|
+ }
|
|
|
+ else if (type === 'pdf') {
|
|
|
+ return `https://cloud.cocorobo.cn/pdf.js/web/viewer.html?file=${encodeURIComponent(url)}&time=${new Date().getTime()}`
|
|
|
+ }
|
|
|
+ return url
|
|
|
+}
|
|
|
+
|
|
|
const lookImage = (file: any) => {
|
|
|
const url = typeof file === 'string' ? file : file?.url
|
|
|
if (!url) return
|
|
|
@@ -3835,6 +3846,7 @@ onUnmounted(() => {
|
|
|
padding: .5rem 0.6rem;
|
|
|
min-width: 65px;
|
|
|
justify-content: center;
|
|
|
+ margin-top: 15px;
|
|
|
}
|
|
|
|
|
|
/* KWL 展示样式 */
|