import request from "../request";
//获取登录
export function loginJoggle(data) {
  return request({
    url: "/xymanager/login",
    method: "post",
    data,
  });
}
//获取装置总数图表
export function getTermStatistics(data) {
  return request({
    url: "/xymanager/getTermStatistics",
    method: "get",
    params: data,
  });
}
//获取一周的装置告警
export function getWeekAlarmStatistics(data) {
  return request({
    url: "/xymanager/getWeekAlarmStatistics",
    method: "get",
    params: data,
  });
}
//获取当天告警分类统计
export function getTodayAlarmStatistics(data) {
  return request({
    url: "/xymanager/getTodayAlarmStatistics",
    method: "get",
    params: data,
  });
}
//首页查看数据
export function getOnlineTerminalList(data) {
  return request({
    url: "/xymanager/getOnlineTerminalList",
    method: "get",
    params: data,
  });
}
//导出数据
export function getOnlineTerminalListExcel() {
  return request({
    url: "/xymanager/getOnlineTerminalListExcel",
    method: "post",
    responseType: "blob",
  });
}

//修改用户
export function updateUserApi(data) {
  return request({
    url: "/xymanager/updateUser",
    method: "post",
    data,
  });
}

//实时监控
//获取线路树状结构
export function getdyTreeListJoggle(data) {
  return request({
    url: "/xymanager/getdyTreeList",
    method: "get",
    params: data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
  });
}
//获取所有杆塔下的图片列表，实时监控

export function getTowerAndPhotoList(data) {
  return request({
    url: "/xymanager/getTowerAndPhotoList",
    method: "post",
    data,
  });
}
//获取通道
export function getChannelByTermidJoggle(data) {
  return request({
    url: "/xymanager/getChannelByTermid",
    method: "post",
    data,
  });
}

//获取图片接口
export function getTerminalPhotoListJoggle(data) {
  return request({
    url: "/xymanager/getTerminalPhotoList",
    method: "post",
    data,
  });
}
//判断装置是否在线
export function getTermStatus(data) {
  return request({
    url: "/xymanager/getTermStatus",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
  });
}
//统一调用接口命令

export function setTermCamera(data) {
  return request({
    url: "/xymanager/setTermCamera",
    method: "post",
    data,
    // headers: {
    //   "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    // },
  });
}
//统一返回数据
export function getTermCameraRequest(data) {
  return request({
    url: "/xymanager/getTermCameraRequest",
    method: "post",
    data,
    // headers: {
    //   "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    // },
  });
}

//手动拍 获取装置状态
export function getTakePicStatusJoggle(data) {
  return request({
    url: "/xymanager/getTakePicStatus",
    method: "get",
    params: data,
  });
}

//手动拍照获取最新图片
export function getTakePicPhotoStatusJoggle(data) {
  return request({
    url: "/xymanager/getTakePicPhotoStatus",
    method: "get",
    params: data,
  });
}
export function getDeviceList(data) {
  return request({
    url: "/xymanager/getTerminalStatus",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
  });
}
//获取最新装置信息aaa
export function getinfoStatus(data) {
  return request({
    url: "/xymanager/getLastTermInfo",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
  });
}
//获取最新装置信息
export function getNewDeviceList(data) {
  return request({
    url: "/xymanager/getLastedTerminalStatus",
    method: "post",
    data,
  });
}

//声光报警
export function alarmMarkJoggle(data) {
  return request({
    url: "/xymanager/alarmMark",
    method: "post",
    data,
  });
}

// 获取GPS位置
export function getTermGPSJoggle(data) {
  return request({
    url: "/xymanager/getTermGPS",
    method: "post",
    data,
  });
}
//setTermGPS 开启关闭gps
export function setTermGPSJoggle(data) {
  return request({
    url: "/xymanager/setTermGPS",
    method: "post",
    data,
  });
}

//获取GPS位置触发
export function getTermGPSPosition(data) {
  return request({
    url: "/xymanager/getTermGPSPosition",
    method: "post",
    data,
  });
}
// 获取GPS位置

export function getTermLastGPSPosition(data) {
  return request({
    url: "/xymanager/getTermLastGPSPosition",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
  });
}
//图片轮巡
//获取图片轮巡接口
export function getPictureList(data) {
  return request({
    url: "/xymanager/getPhotoBanner",
    method: "post",
    data,
  });
}

//历史图片
//获取电压-线路-杆塔等信息
export function getSearchInfo(data) {
  return request({
    url: "/xymanager/getLineAndGt",
    method: "post",
    data,
  });
}
//获取实时图片数据
export function getRealtimePhoto(data) {
  return request({
    url: "/xymanager/getPhotoList",
    method: "post",
    data,
  });
}

//告警功能
//获取告警列表
export function getAlarmList(data) {
  return request({
    url: "/xymanager/getTerminalAlarmList",
    method: "post",
    data,
  });
}
//获取告警label
export function getAlarmTypeList(data) {
  return request({
    url: "/xymanager/getAlarmTypeList",
    method: "post",
    data,
  });
}
//已读未读
export function readAlarm(data) {
  return request({
    url: "/xymanager/readAlarm",
    method: "post",
    data,
  });
}

//手动拍照
export function takePicJoggle(data) {
  return request({
    url: "/xymanager/takePic",
    method: "get",

    params: data,
    // data,
    // headers: {
    //   "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    // },
  });
}

//用户管理
//用户列表查询
export function getUserList(data) {
  return request({
    url: "/xymanager/userList",
    method: "post",
    data,
  });
}
//新增用户
export function addUserApi(data) {
  return request({
    url: "/xymanager/addUser",
    method: "post",
    data,
  });
}

//删除用户
export function delUserApi(data) {
  return request({
    url: "/xymanager/deleteUser",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
  });
}

//设置告警可信度
export function updateAlarmTypeList(data) {
  return request({
    url: "/xymanager/updateAlarmTypeList",
    method: "post",
    data,
  });
} //全局设置线缆绘制
export function getMarkEnableStatus(data) {
  return request({
    url: "/xymanager/getMarkEnableStatus",
    method: "post",
    data,
  });
}
//全局更新设置线缆绘制
export function updateMarkEnableStatus(data) {
  return request({
    url: "/xymanager/updateMarkEnableStatus",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
  });
}
//全局设置通道

export function updateAlarmChannel(data) {
  return request({
    url: "/xymanager/updateAlarmChannel",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
  });
}

//获取电压等级列表
export function getdyListJoggle(data) {
  return request({
    url: "/xymanager/getdyList",
    method: "post",
    data,
  });
}
//1.线路列表信息
export function getLineListJoggle(data) {
  return request({
    url: "/xymanager/getLineList",
    method: "post",
    data,
  });
}
//2.添加单个或者多个线路信息
export function addLineJoggle(data) {
  return request({
    url: "/xymanager/addLine",
    method: "post",
    data,
  });
}
//3.删除新路信息
export function deleteLineJoggle(data) {
  return request({
    url: "/xymanager/deleteLine",
    method: "post",
    data,
  });
}
//4.修改信息
export function updateLineJoggle(data) {
  return request({
    url: "/xymanager/updateLine",
    method: "post",
    data,
  });
}
//杆塔信息
//1.获取杆塔列表
export function getTowerListApi(data) {
  return request({
    url: "/xymanager/getTowerList",
    method: "post",
    data,
  });
}
//2.获取线路编号列表
export function getLineListApi(data) {
  return request({
    url: "/xymanager/getLineList",
    method: "post",
    data,
  });
}
//3.新增杆塔信息
export function addTowerApi(data) {
  return request({
    url: "/xymanager/addTower",
    method: "post",
    data,
  });
}
//4.修改杆塔信息
export function updateTowerApi(data) {
  return request({
    url: "/xymanager/updateTower",
    method: "post",
    data,
  });
}
//5.删除杆塔信息
export function delTowerApi(data) {
  return request({
    url: "/xymanager/deleteTower",
    method: "post",
    data,
  });
}

//通道管理
//1.获取通道列表
export function getChannelListapi(data) {
  return request({
    url: "/xymanager/getChannelList",
    method: "post",
    data,
  });
}
//2.新增通道
export function addChannelapi(data) {
  return request({
    url: "/xymanager/addChannelList",
    method: "post",
    data,
  });
}
//3.删除通道
export function deleteChannelapi(data) {
  return request({
    url: "/xymanager/deleteChannelList",
    method: "post",
    data,
  });
}
//4.修改通道
export function updateChannelapi(data) {
  return request({
    url: "/xymanager/updateChannelList",
    method: "post",
    data,
  });
}

//拍照装置管理  接口增删改查
//获取列表
export function getTerminalJoggle(data) {
  return request({
    url: "/xymanager/getTerminalList",
    method: "post",
    data,
  });
}
//添加设备信息
export function addTerminalJoggle(data) {
  return request({
    url: "/xymanager/addTerminal",
    method: "post",
    data,
  });
}
//添加设备---获取-线路-杆塔
export function getLineAndGtInfo(data) {
  return request({
    url: "/xymanager/getLineAndGtList",
    method: "post",
    data,
  });
}
//修改设备信息
export function updateTerminalJoggle(data) {
  return request({
    url: "/xymanager/updateTerminal",
    method: "post",
    data,
  });
}
//删除设备信息
export function deleteTerminalJoggle(data) {
  return request({
    url: "/xymanager/deleteTerminal",
    method: "post",
    data,
  });
}
//导出数据

export function getTerminalListExcel() {
  return request({
    url: "/xymanager/getTerminalListExcel",
    method: "post",
    responseType: "blob",
  });
}
//获取所有通道列表

export function getAllChannelListJoggle(data) {
  return request({
    url: "/xymanager/getAllChannelList",
    method: "post",
    data,
  });
}
//规约版本
export function getProtocolList(data) {
  return request({
    url: "/xymanager/getProtocolList",
    method: "get",
    params: data,
  });
}
//获取通道的接口

export function getChannelListJoggle(data) {
  return request({
    url: "/xymanager/getChannelByTermid",
    method: "post",
    data,
  });
}
//装置复位
export function resetTerminalApi(data) {
  return request({
    url: "/xymanager/resetTerminal",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
  });
}
//图像参数--获取图像分辨率
export function getResolutionRatio(data) {
  return request({
    url: "/xymanager/getResolutionList",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
  });
}
//获取设备接口

export function getCoordinate(data) {
  return request({
    url: "/xymanager/getCoordinate",
    method: "post",
    data,
  });
}
//绘制坐标保存

export function updateCoordinate(data) {
  return request({
    url: "/xymanager/updateCoordinate",
    method: "post",
    data,
  });
}

//拍照时间表设置
//1.获取任务规则列表接口
export function getScheduleRulelListJoggle(data) {
  return request({
    url: "/xymanager/getScheduleRulelList",
    method: "post",
    data,
  });
}
//2.新增任务规则
export function addScheduleRulel(data) {
  return request({
    url: "/xymanager/addSchelduleRuleList",
    method: "post",
    data,
  });
}
//3.删除任务规则
export function deleteScheduleRulel(data) {
  return request({
    url: "/xymanager/deleteSchelduleRule",
    method: "post",
    data,
  });
}
//4.修改任务规则
export function updateScheduleRulel(data) {
  return request({
    url: "/xymanager/updateSchelduleRule",
    method: "post",
    data,
  });
}
//5.获取所有通道
export function getScheduleRulelAccessList(data) {
  return request({
    url: "/xymanager/getChannelTreeList",
    method: "post",
    data,
  });
}
//6.设置时间表通道
export function setScheduleRulel(data) {
  return request({
    url: "/xymanager/relateSchelduleRule",
    method: "post",
    data,
  });
}
//7.查询设备时间表
export function getSchedulenr(data) {
  return request({
    url: "/xymanager/getChannelSchelduleRule",
    method: "post",
    data,
  });
}
//根据通道编号获取设备列表
export function getTermListByChannelJoggle(data) {
  return request({
    url: "/xymanager/getTermListByChannel ",
    method: "post",
    data,
  });
}
//调节焦距

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

//郑州检测左侧树状结构接口
export function getzzdyTreeList(data) {
  return request({
    url: "/xymanager/getzzdyTreeList",
    method: "get",
    params: data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
  });
}
//删除图片
export function deletePicList(data) {
  return request({
    url: "/xymanager/deletePicList",
    method: "post",
    data,
  });
}

export function addFavorList(data) {
  return request({
    url: "/xymanager/addFavorList",
    method: "post",
    data,
  });
}

//上传图片
export function uploadPicApi(data) {
  return request({
    url: "/xymanager/upload",
    method: "post",
    data,
    headers: {
      "Content-Type": "multipart/form-data", // set the content type to multipart/form-data
    },
  });
}

//角色管理
//获取所有角色
export function getRoleList(data) {
  return request({
    url: "/xymanager/role/listAll",
    method: "get",
    params: data,
  });
}
//新增角色
export function addRole(data) {
  return request({
    url: "/xymanager/role/add",
    method: "post",
    data,
  });
}
//修改角色
export function updateRole(data) {
  return request({
    url: "/xymanager/role/update",
    method: "post",
    data,
  });
}
//删除角色
export function deleteRole(data) {
  return request({
    url: "/xymanager/role/delete",
    method: "post",
    params: data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
  });
}

//查询权限数结构

export function getPermissionTree(data) {
  return request({
    url: "/xymanager/user/getFullTree",
    method: "get",
    params: data,
  });
}
//@Api0peration("查询杈限")

export function getPermission(data) {
  return request({
    url: "/xymanager/user/getPermission",
    method: "get",
    params: data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
  });
}

//@Api0peration("修改杈限")
export function changePermission(data) {
  return request({
    url: "/xymanager/user/changePermission",
    method: "post",
    data,
  });
}

//装置信息报
//故障信息报
export function getTermFaultsApi(data) {
  return request({
    url: "/xymanager/getTermFaults",
    method: "post",
    data,
  });
}
//导出数据故障信息报
export function getTermFaultsExcel() {
  return request({
    url: "/xymanager/getTermFaultsExcel",
    method: "get",
    responseType: "blob",
  });
}

//工作状态报
export function getWorkingStatusHistoryApi(data) {
  return request({
    url: "/xymanager/getWorkingStatusHistory",
    method: "post",
    data,
  });
}
//导出工作状态报
export function getWorkingStatusHistoryExcel(data) {
  return request({
    url: "/xymanager/getWorkingStatusHistoryExcel",
    method: "get",
    responseType: "blob",
  });
}
//运行状态报
export function getTermRunningHistoryApi(data) {
  return request({
    url: "/xymanager/getTermRunningHistory",
    method: "post",
    data,
  });
}
//导出运行状态报
export function getTermRunningHistoryExcel(data) {
  return request({
    url: "/xymanager/getTermRunningHistoryExcel",
    method: "get",
    responseType: "blob",
  });
}

//GPS位置报
export function getTermGpsHistoryApi(data) {
  return request({
    url: "/xymanager/getTermGpsHistory",
    method: "post",
    data,
  });
}
//导出GPS位置报
export function getTermGpsHistoryExcel(data) {
  return request({
    url: "/xymanager/getTermGpsHistoryExcel",
    method: "get",
    responseType: "blob",
  });
}
//基本信息报

export function getTermBasicInfoHistoryApi(data) {
  return request({
    url: "/xymanager/getTermBasicInfoHistory",
    method: "post",
    data,
  });
}
//导出基本信息报
export function getTermBasicInfoHistoryExcel(data) {
  return request({
    url: "/xymanager/getTermBasicInfoHistoryExcel",
    method: "get",
    responseType: "blob",
  });
}

//apk管理
//查询apk列表
export function listApk(data) {
  return request({
    url: "/xymanager/listApk",
    method: "post",
    data,
  });
}

//上传apk
export function uploadApk(data, onUploadProgress) {
  return request({
    url: "/xymanager/uploadApk",
    method: "post",
    data,
    headers: {
      "Content-Type": "multipart/form-data", // set the content type to multipart/form-data
    },
    onUploadProgress: onUploadProgress, // 允许外部传递进度回调函数
  });
}

//修改apk
export function updateApkApi(data) {
  return request({
    url: "/xymanager/updateApk",
    method: "post",
    data,
  });
}
//删除apk
export function deleteApkApi(data) {
  return request({
    url: "/xymanager/deleteApk",
    method: "post",
    data,
  });
}

//获取菜单功能列表
export function getMenuListApi(data) {
  return request({
    url: "/xymanager/resource/listAll",
    method: "get",
    params: data,
  });
}
//新增菜单功能
export function addResourceApi(data) {
  return request({
    url: "/xymanager/resource/add",
    method: "post",
    data,
  });
}
//修改菜单功能
export function updateResourceApi(data) {
  return request({
    url: "/xymanager/resource/update",
    method: "post",
    data,
  });
}
//删除菜单功能
export function deleteResourceApi(data) {
  return request({
    url: "/xymanager/resource/delete",
    method: "post",
    params: data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
  });
}

//查询角色权限数结构
export function getRolePermissionApi(data) {
  return request({
    url: "/xymanager/role/getPermission",
    method: "get",
    params: data,
  });
}
//@Api0peration("修改角色杈限")
export function getRolechangePermissionApi(data) {
  return request({
    url: "/xymanager/role/changePermission",
    method: "post",
    data,
  });
}
