import request from "../request";
//获取登录
export function loginJoggle(data) {
  return request({
    url: "/xymanager/login",
    method: "post",
    data,
  });
}

//获取用户装置信息
export function getTerminalJoggle(data) {
  return request({
    url: "/xymanager/terminal/listForMaintain",
    method: "get",
    params: data,
  });
}
export function exportTerminalApi(data) {
  return request({
    url: "/xymanager/terminal/exportForMaintain",
    method: "get",
    params: data,
    responseType: 'blob' 
  });
}


//获取规约
export function getProtocolList(data) {
  return request({
    url: "/xymanager/getProtocolList",
    method: "get",
    params: data,
  });
}
//获取 电压  线路  杆塔  
export function getSearchInfo(data) {
  return request({
    url: "/xymanager/getLineAndGt",
    method: "post",
    data,
  });
}

//获取活动列表
export function getActivityApi(data) {
  return request({
    url: "/xymanager/activity/listAll",
    method: "get",
    params: data,
  });
}
//新增活动列表
export function addActiveApi(data) {
  return request({
    url: "/xymanager/activity/add",
    method: "post",
    data,
  });
}
//修改活动列表
export function updActiveApi(data) {
  return request({
    url: "/xymanager/activity/update",
    method: "post",
    data,
  });
}

//删除活动列表
export function delActiveApi(data) {
  return request({
    url: "/xymanager/activity/delete",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
  });
}
////运维，快心跳
export function cmdSendApi(data) {
  return request({
    url: "/xymanager/cmd/send",
    method: "post",
    data,
  });
}

//获取命令列表
export function getCmdActionApi(data) {
  return request({
    url: "/xymanager/cmd/listAction",
    method: "get",
    params: data,
  });
}

//查询正在下发的命令
export function cmdActlistApi(data) {
  return request({
    url: "/xymanager/cmd/list",
    method: "get",
    params: data,
  });
}


//查询已经下发的命令
export function cmdActHislistApi(data) {
  return request({
    url: "/xymanager/cmd/listHistory",
    method: "get",
    params: data,
  });
}

//查询历史心跳信息

export function heartListApi(data) {
  return request({
    url: "/xymanager/terminal/listReport",
    method: "get",
    params: data,
  });
}

//修改备注
export function updCommentApi(data) {
  return request({
    url: "/xymanager/terminal/updateComment",
    method: "post",
    data,
  });
}

//日志列表相关接口
export function logListApi(data) {
  return request({
    url: "/xymanager/upload/listAll",
    method: "get",
    params: data,
  });
}
//日志删除
export function logDeleteApi(data) {
  return request({
    url: "/xymanager/upload/delete",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
  });
}


//获取升级列表
export function upgradeListApi(data) {
  return request({
    url: "/xymanager/upgrade/listAll",
    method: "get",
    params: data,
  });
}
//修改备注
export function upgradeTitleApi(data) {
  return request({
    url: "/xymanager/upgrade/updateTitle",
    method: "post",
    data,
  });
}

//上传升级文件
export function upgradeUpLoadApi(data, onUploadProgress) {
  return request({
    url: "/xymanager/upgrade/upload",
    method: "post",
    data,
    headers: {
      "Content-Type": "multipart/form-data", // set the content type to multipart/form-data
    },
    onUploadProgress: onUploadProgress, // 允许外部传递进度回调函数
  });
}
//删除升级的文件
export function upgradeDeleteApi(data) {
  return request({
    url: "/xymanager/upgrade/delete",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
  });
}



















