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)