import request from '@/utils/request'
export function getList(data) {
  return request({
    url: '/api/v1/fkj/device/page',
    method: 'post',
    data
  })
}

export function add(data) {
  return request({
    url: '/api/v1/fkj/device/add',
    method: 'post',
    // headers: { 'content-type': 'application/json' },
    data
  })
}

export function deleteById(id) {
  return request({
    url: `/api/v1/fkj/device/del/${id}`,
    method: 'post'
  })
}

export function autoById(id) {
  return request({
    url: `/api/v1/fkj/device/enable`,
    method: 'get',
    params:{id}
  })
}

export function autoCancelById(id) {
  return request({
    url: `/api/v1/fkj/device/disable`,
    method: 'get',
    params:{id}
  })
}

// 设备模版-新增-编辑
export function templateEdit(data) {
  return request({
    url: '/api/v1/fkj/device/template/edit',
    method: 'post',
    data
  })
}
// 设备模版列表
export function templateList(data) {
  return request({
    url: '/api/v1/fkj/device/template/list',
    method: 'get',
    params:{}
  })
}
// 设备模版列表(分页)
export function templatePage(data) {
  return request({
    url: '/api/v1/fkj/device/template/page',
    method: 'post',
    data
  })
}
// 设备模版-删除
export function templateDel(id) {
  return request({
    url: `/api/v1/fkj/device/template/${id}`,
    method: "DELETE",
  });
}
// 设备模版列表
export function templateDetail(id) {
  return request({
    url: '/api/v1/fkj/device/template/detail',
    method: 'get',
    params:{id}
  })
}
