From a13510faf5440693c1a86659ceaf1cd72eff9fb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=AE=8F=E6=96=8C?= <2164406372@qq.com> Date: Mon, 29 Dec 2025 16:32:19 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=A7=A3=E5=86=B3=E6=96=87=E4=BB=B6=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E4=B9=B1=E7=A0=81=E9=97=AE=E9=A2=98=202.=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=96=87=E4=BB=B6=E5=90=8E=EF=BC=8C=E5=AE=9E=E6=97=B6?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=95=B0=E6=8D=AE=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/qc/IQCFileTable.vue | 28 +++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/views/modules/qc/IQCFileTable.vue b/src/views/modules/qc/IQCFileTable.vue index c0ec993..25fcbd8 100644 --- a/src/views/modules/qc/IQCFileTable.vue +++ b/src/views/modules/qc/IQCFileTable.vue @@ -48,11 +48,22 @@ export default { return; } downLoadObjectFile(row).then(({data}) => { - const blob = new Blob([data], { type: type }); - // 创建URL来生成预览 - const fileURL = URL.createObjectURL(blob); - // 在新标签页中打开文件预览 - const newTab = window.open(fileURL, '_blank') + // const blob = new Blob([data], { type: type }); + // // 创建URL来生成预览 + // const fileURL = URL.createObjectURL(blob); + // // 在新标签页中打开文件预览 + // const newTab = window.open(fileURL, '_blank') + + const type = 'text/plain;charset=utf-8'; // 指定编码 + const blob = new Blob([data], { type }); + const reader = new FileReader(); + reader.onload = function(e) { + const content = e.target.result; + // 新窗口展示内容 + const newTab = window.open(); + newTab.document.write('
' + content + ''); + }; + reader.readAsText(blob, 'utf-8'); }) }, @@ -156,7 +167,8 @@ export default { }).then(() => { deleteObjectFile(row).then(({data}) => { if (data && data.code == 0) { - this.getFileContentData(tempData) + // this.getFileContentData(tempData) + this.$emit('refresh') this.$message({ message: '操作成功', type: 'success', @@ -210,8 +222,8 @@ export default {