2024-12-11 19:39:09 +08:00
|
|
|
import type { Plan } from './interface'
|
2024-11-07 13:22:51 +08:00
|
|
|
import http from '@/api'
|
2024-12-11 19:39:09 +08:00
|
|
|
import type { ErrorSystem } from '../device/interface/error'
|
|
|
|
|
import type { Device } from '../device/interface/device'
|
2025-01-15 18:01:12 +08:00
|
|
|
import { ReqDevReportParams } from '@/api/device/interface/device'
|
2024-11-07 13:22:51 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @name 检测计划管理模块
|
|
|
|
|
*/
|
|
|
|
|
// 获取检测计划列表
|
|
|
|
|
export const getPlanList = (params: Plan.ReqPlanParams) => {
|
2025-01-15 18:01:12 +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) => {
|
2024-12-11 19:39:09 +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) => {
|
2024-12-11 19:39:09 +08:00
|
|
|
return http.post(`/adPlan/update`, params)
|
2024-11-07 13:22:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 删除检测计划
|
|
|
|
|
export const deletePlan = (params: { id: string[] }) => {
|
2024-12-11 19:39:09 +08:00
|
|
|
return http.post(`/adPlan/delete`, params)
|
2024-11-07 13:22:51 +08:00
|
|
|
}
|
2024-12-11 19:39:09 +08:00
|
|
|
|
|
|
|
|
// 获取指定模式下所有检测源
|
|
|
|
|
export const getTestSourceList = (params: Plan.ReqPlan) => {
|
|
|
|
|
return http.get(`/pqSource/getAll?patternId=${params.pattern}`)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取指定模式下所有检测脚本
|
|
|
|
|
export const getPqScriptList = (params: Plan.ReqPlan) => {
|
|
|
|
|
return http.get(`/pqScript/getAll?patternId=${params.pattern}`)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取所有误差体系
|
|
|
|
|
export const getPqErrSysList = () => {
|
|
|
|
|
return http.get<ErrorSystem.ErrorSystemList>(`/pqErrSys/getAll`)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取指定模式下所有未绑定的设备
|
|
|
|
|
export const getUnboundPqDevList = (params: Plan.ReqPlan) => {
|
|
|
|
|
return http.get(`/pqDev/listUnbound?pattern=${params.pattern}`)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据检测计划id查询出所有已绑定的设备
|
|
|
|
|
export const getBoundPqDevList = (params: any) => {
|
2025-01-15 18:01:12 +08:00
|
|
|
return http.post(`/pqDev/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) => {
|
2024-12-13 16:35:27 +08:00
|
|
|
return http.get(`/adPlan/listByPattern?pattern=${params.pattern}`)
|
2024-12-17 11:12:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 导出检测计划
|
2025-01-15 18:01:12 +08:00
|
|
|
export const exportPlan = (params: Device.ReqPqDevParams) => {
|
2024-12-17 11:12:21 +08:00
|
|
|
return http.download(`/adPlan/export`, params)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 下载模板
|
|
|
|
|
export const downloadTemplate = () => {
|
|
|
|
|
return http.download(`/adPlan/downloadTemplate`)
|
|
|
|
|
}
|
|
|
|
|
// 导入检测计划
|
2025-01-15 18:01:12 +08:00
|
|
|
export const importPlan = (params: Device.ReqPqDevParams) => {
|
2024-12-17 11:12:21 +08:00
|
|
|
return http.upload(`/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) => {
|
|
|
|
|
return http.post(`/report/generateReport`, params)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 装置检测报告下载
|
|
|
|
|
export const downloadDevData = (params: Device.ReqDevReportParams) => {
|
|
|
|
|
return http.download(`/report/downloadReport`, params)
|
2024-12-11 19:39:09 +08:00
|
|
|
}
|