From 2d83f0c2b6348366f1e7a234012142e755b16e98 Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Wed, 08 Jul 2026 12:35:06 +0800
Subject: [PATCH] feat:更新ws地址和字段
---
applications/task-work-order/src/views/orderView/orderManage/inspectionReport/index.vue | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/applications/task-work-order/src/views/orderView/orderManage/inspectionReport/index.vue b/applications/task-work-order/src/views/orderView/orderManage/inspectionReport/index.vue
index 1b1d54a..f19d914 100644
--- a/applications/task-work-order/src/views/orderView/orderManage/inspectionReport/index.vue
+++ b/applications/task-work-order/src/views/orderView/orderManage/inspectionReport/index.vue
@@ -269,14 +269,23 @@
];
const { VITE_APP_PREVIEW_URL } = import.meta.env
+// kkfileView 中,word/pdf 默认转成只读 pdf 预览,excel 才是可编辑的 html 模式。
+// 对这些类型追加 officePreviewType=html,让其以可编辑的 html 方式打开
+const editableOfficeTypes = ['doc', 'docx', 'pdf']
+
// 在线查看文档
function seeOnlineWord(row) {
// 获取点之后的文件格式名
- const fileType = row?.link?.split('.').pop() || ''
+ const fileType = (row?.link?.split('.').pop() || '').toLowerCase()
if (!row.link) {
ElMessage.warning('文件链接不存在')
} else if (allSupportedExtensions.includes(fileType)){
- window.open(`${VITE_APP_PREVIEW_URL}/onlinePreview?url=`+encodeURIComponent(Base64.encode(row.link)));
+ 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)
} else {
ElMessage.warning(`${fileType}文件格式,可以下载再查看`)
}
--
Gitblit v1.9.3