2025-08-25 11:02:07 +08:00
|
|
|
import type { Plan } from './interface'
|
2024-11-07 13:22:51 +08:00
|
|
|
import http from '@/api'
|
2025-08-25 11:02:07 +08:00
|
|
|
import type { ErrorSystem } from '../device/interface/error'
|
|
|
|
|
import type { Device } from '../device/interface/device'
|
2024-11-07 13:22:51 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @name 检测计划管理模块
|
|
|
|
|
*/
|
|
|
|
|
// 获取检测计划列表
|
|
|
|
|
export const getPlanList = (params: Plan.ReqPlanParams) => {
|
2025-08-13 20:34:08 +08:00
|
|
|
return http.post(`/adPlan/list`, params)
|
2024-11-07 13:22:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 新增检测计划
|
2025-01-15 18:01:12 +08:00
|
|
|
export const addPlan = (params: any) => {
|
2025-08-13 20:34:08 +08:00
|
|
|
return http.post(`/adPlan/add`, params)
|
2024-11-07 13:22:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 编辑检测计划
|
2024-12-13 16:35:27 +08:00
|
|
|
export const updatePlan = (params: any) => {
|
2025-08-13 20:34:08 +08:00
|
|
|
return http.post(`/adPlan/update`, params)
|
2024-11-07 13:22:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 删除检测计划
|
2025-08-13 20:34:08 +08:00
|
|
|
export const deletePlan = (params: { id: string[]; pattern: string }) => {
|
|
|
|
|
return http.post(`/adPlan/delete?pattern=${params.pattern}`, params.id)
|
2024-11-07 13:22:51 +08:00
|
|
|
}
|
2024-12-11 19:39:09 +08:00
|
|
|
|
2025-08-13 20:34:08 +08:00
|
|
|
// 获取指定模式下所有检测源
|
2024-12-11 19:39:09 +08:00
|
|
|
export const getTestSourceList = (params: Plan.ReqPlan) => {
|
2025-08-13 20:34:08 +08:00
|
|
|
return http.get(`/pqSource/getAll?patternId=${params.pattern}`)
|
2024-12-11 19:39:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取指定模式下所有检测脚本
|
|
|
|
|
export const getPqScriptList = (params: Plan.ReqPlan) => {
|
2025-08-13 20:34:08 +08:00
|
|
|
return http.get(`/pqScript/getAll?patternId=${params.pattern}`)
|
2024-12-11 19:39:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取所有误差体系
|
|
|
|
|
export const getPqErrSysList = () => {
|
2025-08-13 20:34:08 +08:00
|
|
|
return http.get<ErrorSystem.ErrorSystemList>(`/pqErrSys/getAll`)
|
2024-12-11 19:39:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取指定模式下所有未绑定的设备
|
|
|
|
|
export const getUnboundPqDevList = (params: Plan.ReqPlan) => {
|
2025-08-13 20:34:08 +08:00
|
|
|
return http.get(`/pqDev/listUnbound?pattern=${params.pattern}`)
|
2024-12-11 19:39:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据检测计划id查询出所有已绑定的设备
|
|
|
|
|
export const getBoundPqDevList = (params: any) => {
|
2025-08-13 20:34:08 +08:00
|
|
|
return http.post(`/adPlan/listByPlanId`, params)
|
2024-12-11 19:39:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//检测计划绑定设备
|
2024-12-17 14:08:13 +08:00
|
|
|
// export const BindPqDevList = (params: any) => {
|
|
|
|
|
// return http.post(`/pqDev/bindDev`,params)
|
|
|
|
|
// }
|
2024-12-13 16:35:27 +08:00
|
|
|
|
|
|
|
|
// 按照模式查询检测计划(用于首页展示)
|
2025-01-15 18:01:12 +08:00
|
|
|
export const getPlanListByPattern = (params: Plan.ReqPlan) => {
|
2025-08-13 20:34:08 +08:00
|
|
|
return http.get(`/adPlan/listByPattern?pattern=${params.pattern}`)
|
2024-12-17 11:12:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 导出检测计划
|
2025-03-25 15:08:25 +08:00
|
|
|
export const exportPlan = (params: Device.ReqPqDevParams) => {
|
2025-08-13 20:34:08 +08:00
|
|
|
return http.download(`/adPlan/export`, params)
|
2024-12-17 11:12:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 下载模板
|
2025-04-08 09:43:12 +08:00
|
|
|
export const downloadTemplate = (params: { patternId: string }) => {
|
2025-08-13 20:34:08 +08:00
|
|
|
return http.download(`/adPlan/downloadTemplate`, params)
|
2024-12-17 11:12:21 +08:00
|
|
|
}
|
|
|
|
|
// 导入检测计划
|
2025-03-25 15:08:25 +08:00
|
|
|
export const importPlan = (params: Device.ReqPqDevParams) => {
|
2025-08-13 20:34:08 +08:00
|
|
|
return http.uploadExcel(`/adPlan/import`, params)
|
2025-01-13 09:35:41 +08:00
|
|
|
}
|
|
|
|
|
|
2025-01-15 18:01:12 +08:00
|
|
|
// 装置检测报告生成
|
|
|
|
|
export const generateDevReport = (params: Device.ReqDevReportParams) => {
|
2025-08-13 20:34:08 +08:00
|
|
|
return http.post(`/report/generateReport`, params)
|
2025-01-15 18:01:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 装置检测报告下载
|
|
|
|
|
export const downloadDevData = (params: Device.ReqDevReportParams) => {
|
2025-08-13 20:34:08 +08:00
|
|
|
return http.download(`/report/downloadReport`, params)
|
2025-02-14 11:44:19 +08:00
|
|
|
}
|
|
|
|
|
|
2025-02-17 16:26:23 +08:00
|
|
|
export const staticsAnalyse = (params: { id: string[] }) => {
|
2025-08-13 20:34:08 +08:00
|
|
|
return http.download('/adPlan/analyse', params)
|
2025-02-14 11:44:19 +08:00
|
|
|
}
|
2025-02-14 13:30:50 +08:00
|
|
|
|
2025-07-21 13:47:56 +08:00
|
|
|
//根据计划id分页查询被检设
|
2025-08-13 20:34:08 +08:00
|
|
|
export const getDevListByPlanId = (params: any) => {
|
|
|
|
|
return http.post(`/adPlan/listDevByPlanId`, params)
|
2025-07-21 13:47:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//修改子计划名称
|
2025-08-13 20:34:08 +08:00
|
|
|
export const updateSubPlanName = (params: Plan.ReqPlan) => {
|
|
|
|
|
return http.get(`/adPlan/updateSubPlanName?planId=${params.id}&name=${params.name}`)
|
2025-07-21 13:47:56 +08:00
|
|
|
}
|
|
|
|
|
|
2025-07-22 14:56:58 +08:00
|
|
|
//子计划绑定/解绑标准设备
|
2025-08-13 20:34:08 +08:00
|
|
|
export const subPlanBindStandardDevList = (params: Plan.ReqPlan) => {
|
|
|
|
|
return http.post(`/adPlan/updateBindStandardDev`, params)
|
2025-07-22 14:56:58 +08:00
|
|
|
}
|
|
|
|
|
|
2025-07-21 13:47:56 +08:00
|
|
|
//子计划绑定/解绑被检设备
|
2025-08-13 20:34:08 +08:00
|
|
|
export const subPlanBindDev = (params: Plan.ReqPlan) => {
|
|
|
|
|
return http.post(`/adPlan/updateBindDev`, params)
|
2025-07-21 13:47:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据父计划ID获取未被子计划绑定的标准设备
|
2025-08-13 20:34:08 +08:00
|
|
|
export const getUnboundStandardDevList = (params: Plan.ResPlan) => {
|
|
|
|
|
return http.get(`/adPlan/getUnBoundStandardDev?fatherPlanId=${params.fatherPlanId}`)
|
2025-07-21 13:47:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据计划ID获取已绑定的标准设备
|
2025-08-13 20:34:08 +08:00
|
|
|
export const getBoundStandardDevList = (params: Plan.ResPlan) => {
|
|
|
|
|
return http.get(`/adPlan/getBoundStandardDev?planId=${params.id}`)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据计划ID获取已绑定的所有标准设备
|
|
|
|
|
export const getBoundStandardDevAllList = (params: Plan.ResPlan) => {
|
|
|
|
|
return http.get(`/adPlan/getBoundStandardDev?planId=${params.id}&all=1`)
|
2025-08-15 16:03:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 导出子计划
|
|
|
|
|
export const exportSubPlan = (params: Plan.ResPlan) => {
|
|
|
|
|
return http.download(`/adPlan/exportSubPlan?planId=${params.id}`)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 导入子检测计划
|
2025-08-25 11:02:07 +08:00
|
|
|
export const importSubPlan = (params: Plan.ResPlan) => {
|
2025-08-15 16:03:42 +08:00
|
|
|
return http.upload(`/adPlan/importSubPlan`, params)
|
2025-08-22 09:04:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 导出计划检测结果数据
|
|
|
|
|
export const exportPlanCheckData = (params: Plan.ResPlan) => {
|
2025-08-29 09:54:19 +08:00
|
|
|
return http.download(`/adPlan/exportPlanCheckData?planId=${params.id}&report=1`)
|
2025-08-25 11:02:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 导入子检测计划检测结果数据
|
|
|
|
|
export const importSubPlanCheckData = (params: Plan.ResPlan) => {
|
|
|
|
|
return http.upload(`/adPlan/importSubPlanCheckData`, params)
|
2025-08-29 09:54:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 合并子检测计划检测结果数据
|
|
|
|
|
export const mergeSubPlanCheckData = (params: Plan.ResPlan) => {
|
|
|
|
|
return http.upload(`/adPlan/mergePlanCheckData?planId=${params.id}`)
|
2025-07-21 13:47:56 +08:00
|
|
|
}
|