From c1dd1318eb3a3f00ca8f436fadf908aafcdda4f4 Mon Sep 17 00:00:00 2001 From: jjLv <1981429112@qq.com> Date: Tue, 20 Aug 2024 15:13:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=AE=A1=E7=90=86=E8=AF=81?= =?UTF-8?q?=E4=B9=A6bug=E4=BF=AE=E5=A4=8D=EF=BC=8C=E6=B7=BB=E5=8A=A0pdf?= =?UTF-8?q?=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/download.js | 13 + src/views/base/bracelet/index.vue | 35 +- src/views/base/device/index.vue | 23 +- src/views/base/project/index.vue | 10 +- src/views/base/staff/index.vue | 302 ++++++++++++++---- src/views/components/uploadFile.vue | 22 +- .../constructionRecord/index.vue | 40 +-- .../comprehensive/deviceLyRecord/index.vue | 14 +- src/views/comprehensive/warnHistory/index.vue | 8 +- src/views/construction/sideband/index.vue | 12 +- 10 files changed, 337 insertions(+), 142 deletions(-) diff --git a/src/utils/download.js b/src/utils/download.js index aba2d53..05324f4 100644 --- a/src/utils/download.js +++ b/src/utils/download.js @@ -24,3 +24,16 @@ export const downloadFileByUrl = (url) => { URL.revokeObjectURL(link.href) document.body.removeChild(link) } + +// pdf、doc、docx等文件下载 +export const downloadFileData = ({ fileName, fileUrl }) => { + const link = document.createElement('a') + link.setAttribute('download', '') + link.style.display = 'none' + link.href = fileUrl + link.download = fileName + document.body.appendChild(link) + link.click(); + // URL.revokeObjectURL(link.href) + document.body.removeChild(link) +} \ No newline at end of file diff --git a/src/views/base/bracelet/index.vue b/src/views/base/bracelet/index.vue index aa8f30e..2ea0072 100644 --- a/src/views/base/bracelet/index.vue +++ b/src/views/base/bracelet/index.vue @@ -87,8 +87,8 @@ - - + + {{ scope.row.shboxName }} @@ -114,13 +114,13 @@ - + {{ stateList[Number(scope.row.shStatus)] }} {{ stateList[Number(scope.row.shStatus)] }} - + + + + {{ (queryDeviceAttribute.pageNum - 1) * queryDeviceAttribute.pageSize + scope.$index + 1 }} + + - - - - - - + + + + + + - - - + + + @@ -540,13 +545,13 @@ >查看 - + {{ stateList[Number(scope.row.shboxStatus)] }} {{ stateList[Number(scope.row.shboxStatus)] }} - + - + - + - +