报告生成
This commit is contained in:
@@ -260,6 +260,8 @@ import {CheckData} from '@/api/check/interface'
|
||||
import socketClient from '@/utils/webSocketClient';
|
||||
import auth from "@/directives/modules/auth";
|
||||
import { useAuthStore } from "@/stores/modules/auth";
|
||||
import { useDownload } from '@/hooks/useDownload'
|
||||
import {downloadDevData} from '@/api/plan/plan.ts'
|
||||
|
||||
const dictStore = useDictStore()
|
||||
const checkStore = useCheckStore()
|
||||
@@ -1000,7 +1002,8 @@ const openDrawer = (title: string, row: any) => {
|
||||
|
||||
if(title === '生成')
|
||||
{
|
||||
reportDialogVisible.value = true;
|
||||
//reportDialogVisible.value = true;
|
||||
useDownload(downloadDevData,'调试报告'+formatDate(new Date()), {planId:checkStore.planId,devId:row.id}, false,'.docx')
|
||||
}
|
||||
|
||||
if(title === '检测数据查询')
|
||||
@@ -1027,6 +1030,17 @@ const openDrawer = (title: string, row: any) => {
|
||||
}
|
||||
}
|
||||
|
||||
function formatDate(date : Date) {
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要加1
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
const hours = String(date.getHours()).padStart(2, '0');
|
||||
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||
const seconds = String(date.getSeconds()).padStart(2, '0');
|
||||
|
||||
return `${year}年${month}月${day}日${hours}时${minutes}分${seconds}秒`;
|
||||
}
|
||||
|
||||
// 监听 props.id 的变化
|
||||
watch(
|
||||
() => props.id,
|
||||
|
||||
Reference in New Issue
Block a user