import type { TestScript } from '@/api/device/interface/testScript'
import http from '@/api'

/**
 * @name 检测脚本管理模块
 */
// 新增脚本
export const pqScriptAdd = (params: TestScript.ResTestScript) => {
    return http.post(`/pqScript/add`, params)
}
// 修改脚本
export const pqScriptUpdate = (params: TestScript.ResTestScript) => {
    return http.post(`/pqScript/update`, params)
}
// 获取检测脚本列表
export const getPqScriptList = (params: TestScript.ReqTestScriptParams) => {
    return http.post(`/pqScript/list`, params)
}

//升级为模版
export const updatePqScript = (params: TestScript.ResTestScript) => {
    return http.get(`/pqScript/upgradeToTemplate?id=${params.id}`)
}

//删除检测脚本
export const deletePqScript = (params: string[]) => {
    return http.post(`/pqScript/delete`, params)
}
//添加检测脚本
export const addScriptDtls = (params: any) => {
    return http.post(`/pqScript/addScriptDtls`, params)
}
//根据脚本id查询检测脚本详情
export const dlsDetails = (params: any) => {
    return http.post(`/pqScript/dlsDetails`, params)
}
// 删除脚本
export const deleteDtls = (params: any) => {
    return http.post(`/pqScript/deleteDtls`, params)
}
// 启用关闭脚本
export const updateDtls = (params: any) => {
    return http.post(`/pqScript/updateDtls`, params)
}
// 根据通讯参数生成装置下发原始数据公式
export const scriptDtlsCheckDataList = (params: any) => {
    return http.post(`/pqScript/scriptDtlsCheckDataList`, params)
}
// 通讯脚本回显
export const checkDataList = (params: any) => {
    return http.post(`/pqScript/checkDataList`, params)
}
