From 3833e72ecd4c15fe87bb0d4f8369984be2bda315 Mon Sep 17 00:00:00 2001 From: GGJ <357021191@qq.com> Date: Tue, 2 Jul 2024 16:12:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=94=E8=B0=83=E7=9B=91=E6=B5=8B=E7=82=B9?= =?UTF-8?q?=E8=AF=95=E8=BF=90=E8=A1=8C=20=E4=B8=8B=E8=BD=BD=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/pqs/supervise/testRun/index.vue | 29 ++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/views/pqs/supervise/testRun/index.vue b/src/views/pqs/supervise/testRun/index.vue index 377cf8f7..e3057233 100644 --- a/src/views/pqs/supervise/testRun/index.vue +++ b/src/views/pqs/supervise/testRun/index.vue @@ -57,6 +57,7 @@ import { addRunTest } from '@/api/supervision-boot/lineRunTest' import { formatDate } from '@/utils/formatTime' import { VxeTablePropTypes } from 'vxe-table' import { useAdminInfo } from '@/stores/adminInfo' +import { getFileNameAndFilePath } from '@/api/system-boot/file' const dictData = useDictData() const statusSelect = dictData.statusSelect() const { push } = useRouter() @@ -71,7 +72,7 @@ const tableStore = new TableStore({ { title: '', type: 'checkbox', width: 40 }, { field: 'lineName', title: '监测点名称', minWidth: 160 }, { field: 'connectedBus', title: '接入母线', minWidth: 160 }, - { field: 'monitoringTerminalCode', title: '终端编号', minWidth: 140 }, + // { field: 'monitoringTerminalCode', title: '终端编号', minWidth: 140 }, { field: 'monitoringTerminalName', title: '终端名称', minWidth: 140 }, { field: 'powerSubstationName', title: '变电站', minWidth: 160 }, { field: 'reason', title: '调试原因', minWidth: 160 }, @@ -151,6 +152,19 @@ const tableStore = new TableStore({ return row.testRunState != 2 || !row.processInstanceId } }, + { + name: 'productSetting', + title: '下载报告', + type: 'primary', + icon: 'el-icon-EditPen', + render: 'basicButton', + click: row => { + downloadTheReport(row.testRunReport) + }, + disabled: row => { + return row.testRunReport == null || row.testRunReport.length == 0 + } + }, { name: 'productSetting', title: '重新试运行', @@ -239,6 +253,19 @@ const startRunTest = () => { .catch(() => console.info('操作取消')) } +// 下载报告 +const downloadTheReport = (url: string) => { + getFileNameAndFilePath({ filePath: url }).then((res: any) => { + + const link = document.createElement('a') + link.href = res.data.url + link.download = res.data.name + document.body.appendChild(link) + link.click() + document.body.removeChild(link) + }) +} + const runTestSubmit = (type: number) => { const start = new Date() start.setDate(start.getDate() + 1)