// 样表设备管理api
import request from "@/utils/request";

// 获取设备列表
export const getDeviceList = (data) => {
  return request({
    url: `/sampleform/device/list`,
    method: "post",
    data,
  });
};

// 设备事项列表
export const getDeviceMatterList = (data) => {
  return request({
    url: `/sampleform/device/matter/datum/list`,
    method: "post",
    data,
  });
};

// 批量保存设备事项
export const batchSaveDeviceMatter = (data) => {
  return request({
    url: `/sampleform/device/matter/datum/batchSave`,
    method: "post",
    data,
  });
};

// 保存设备事项
export const saveDeviceMatter = (data) => {
  return request({
    url: `/sampleform/device/matter/datum/save`,
    method: "post",
    data,
  });
};

// 删除设备事项
export const delDeviceMatter = (params) => {
  return request({
    url: `/sampleform/device/matter/datum/delete`,
    method: "get",
    params,
  });
};

// 修改保存设备信息
export const saveDevice = (data) => {
  return request({
    url: `/sampleform/device/save`,
    method: "post",
    data,
  });
};

// 设备激活
export const saveDeviceActive = (data) => {
  return request({
    url: `/sampleform/device/active`,
    method: "post",
    data,
  });
};

// 设备启停用
export const saveDeviceEnable = (data) => {
  return request({
    url: `/sampleform/device/enable`,
    method: "post",
    data,
  });
};

// 删除设备
export const delDevice = (params) => {
  return request({
    url: `/sampleform/device/delete`,
    method: "get",
    params,
  });
};
