diff --git a/frontend/src/api/plan/plan.ts b/frontend/src/api/plan/plan.ts index 623d5c1..b768f6e 100644 --- a/frontend/src/api/plan/plan.ts +++ b/frontend/src/api/plan/plan.ts @@ -1,7 +1,7 @@ -import type { Plan } from './interface' +import type {Plan} from './interface' import http from '@/api' -import type { ErrorSystem } from '../device/interface/error' -import type { Device } from '../device/interface/device' +import type {ErrorSystem} from '../device/interface/error' +import type {Device} from '../device/interface/device' /** * @name 检测计划管理模块 @@ -132,4 +132,10 @@ export const exportSubPlan = (params: Plan.ResPlan) => { // 导入子检测计划 export const importSubPlan = (params: Device.ReqPqDevParams) => { return http.upload(`/adPlan/importSubPlan`, params) +} + + +// 导出计划检测结果数据 +export const exportPlanCheckData = (params: Plan.ResPlan) => { + return http.download(`/adPlan/exportPlanCheckData?planId=${params.id}`) } \ No newline at end of file diff --git a/frontend/src/views/plan/planList/components/childrenPlan.vue b/frontend/src/views/plan/planList/components/childrenPlan.vue index bc861b9..c8df2b6 100644 --- a/frontend/src/views/plan/planList/components/childrenPlan.vue +++ b/frontend/src/views/plan/planList/components/childrenPlan.vue @@ -53,8 +53,18 @@ > 导出子计划元信息 - 导入检测结果 - 数据合并 + + 导出检测结果 + + 导入检测结果 + + 数据合并 + { useDownload(exportSubPlan, `${subPlanFormContent.name}_子计划元信息`, params, false, '.zip') ) } +const exportPlanCheckResultData = async () => { + const params = { + id: planFormContent.value.id + } + ElMessageBox.confirm(`确认导出${planFormContent.value.name}计划检测结果?`, '温馨提示', { type: 'warning' }).then( + () => useDownload(exportPlanCheckData, `${planFormContent.value.name}_计划检测结果`, params, false, '.zip') + ) +} defineExpose({ open, handleTableDataUpdate }) interface ChildrenPlanProps {