import request from "@/utils/request";

/**
 * 设备维护
 *
 * @param ids
 */
export function maintenanceUpdate(params: any) {
  return request({
    url: "/api/v1/device/maintenance/maintenance",
    method: "post",
    data: params,
  });
}

/**
 * 设备维修
 * @param params
 */
export function repair(params: any) {
  return request({
    url: "/api/v1/device/repair/repair",
    method: "post",
    data: params,
  });
}
export function audit(params: any) {
  return request({
    url: "/api/v1/device/repair/audit",
    method: "post",
    data: params,
  });
}

export function allocateAudit(params: any) {
  return request({
    url: "/api/v1/device/allocate/audit",
    method: "post",
    data: params,
  });
}

export function allocateExport(deviceNo: String) {
  return request({
    url: "/api/v1/device/allocate/export/" + deviceNo,
    method: "get",
    responseType: "arraybuffer",
  });
}

export function queryTypeDataList() {
  return request({
    url: "/api/v1/device/fieldAlias/deviceTypeList",
    method: "get",
  });
}

export function treeList() {
  return request({
    url: "/api/v1/device/tree",
    method: "get",
  });
}

export function configList(params: any) {
  return request({
    url: "/api/v1/device/config/list",
    method: "post",
    data: params,
  });
}

export function configSave(params: any) {
  return request({
    url: "/api/v1/device/config/addBatch",
    method: "post",
    data: params,
  });
}
export function deviceUpdate(params: any) {
  return request({
    url: "/api/v1/device/update",
    method: "post",
    data: params,
  });
}
export function queryDeviceList(params: any) {
  return request({
    url: "/api/v1/device/list",
    method: "post",
    data: params,
  });
}

export function queryTypeAliasList(params: any) {
  return request({
    url: "/api/v1/device/fieldAlias/list",
    method: "post",
    data: params,
  });
}
export function deviceUpdateCollect(params: any) {
  return request({
    url: "/api/v1/device/updateCollect",
    method: "post",
    data: params,
  });
}

export function updateProtocol(params: any) {
  return request({
    url: "/api/v1/device/updateProtocol",
    method: "post",
    data: params,
  });
}

export function meteringUpdate(params: any) {
  return request({
    url: "/api/v1/device/metering/meteringUpdate",
    method: "post",
    data: params,
  });
}


