/*
 * @Author: your name
 * @Date: 2021-11-18 13:40:39
 * @LastEditTime: 2021-12-25 19:20:05
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \hyyfClient\src\utils\chenApi.js
 */
import axios from './http';

/** 生物安全 */
/* 人员档案 */
// 新增人员
export function addPerson(data) {
  return axios({
    url: 'video/person/addPerson',
    method: 'post',
    data: data
  })
}
// 新增人员 - 图片
export function addPersonPicture(data, token) {
  return axios({
    url: 'video/person/addPersonPicture',
    method: 'post',
    data,
    headers: {
      "Authorization": `bearer ${token}`
    }
  })
}

export function addPictureToPerson(data) {
  return axios({
    url: 'video/person/addPictureToPerson',
    method: 'post',
    data: data
  })
}

// 删除人员
export function delPerson(data) {
  return axios({
    url: 'video/person/deletePercon',
    method: 'post',
    data: data
  })
}

/** 车辆档案列表 **/
export function getCarList(data) {
  return axios({
    url: '/video/car/geCarList',
    method: 'get',
    params: data
  })
}
/** 新增车辆档案 **/
export function addCarBase(data) {
  return axios({
    url: '/video/car/addCarBase',
    method: 'get',
    params: data
  })
}
/** 车辆档案删除 **/
export function delCarBase(data) {
  return axios({
    url: '/video/car/deleteFromCarBase',
    method: 'post',
    data: data
  })
}
/** 车辆档案添加白名单 **/
export function addCarWhite(data) {
  return axios({
    url: 'video/car/addCarWhiteList',
    method: 'post',
    data: data
  })
}

/** 车辆档案添加黑名单 **/
export function addCarBlack(data) {
  return axios({
    url: 'video/car/addCarBlackList',
    method: 'post',
    data: data
  })
}

/** 添加 白黑 名单 **/
export function addWandB(data) {
  return axios({
    url: '/video/car/ShowUnSendCar',
    method: 'post',
    params: data
  })
}

/** 车辆档案白名单 **/
export function showCarWhite(data) {
  return axios({
    url: 'video/car/ShowCarWhiteList',
    method: 'get',
    params: data
  })
}

/** 车辆档案黑名单 **/
export function showCarBlack(data) {
  return axios({
    url: 'video/car/ShowCarBlackList',
    method: 'get',
    params: data
  })
}

/** 移出白名单 **/
export function delCarWhite(data) {
  return axios({
    url: 'video/car/deleteFromCarWhiteList',
    method: 'post',
    data: data
  })
}

/** 移出黑名单 **/
export function delCarBlack(data) {
  return axios({
    url: 'video/car/deleteFromCarBlackList',
    method: 'post',
    data: data
  })
}
/* 获取门禁所有 - 人脸门禁 +  */
export function getFaceGuardTotal(data) {
  return axios({
    url: '/video/person/get_person_record_totalpage',
    method: 'post',
    data: data
  })
}

/* 车辆管理 - 车辆通行 */
export function getCarPassage(data) {
  return axios({
    url: '/video/car/get_car_record',
    method: 'get',
    params: data
  })
}

/* 车辆管理 - 车辆洗消 */
export function getCarWash(params) {
  return axios({
    url: '/video/accident/accident_record_xixiao',
    method: 'post',
    data: params
  })
}

/* 车辆管理 - 车辆洗消 - 总数 */
export function getCarWashTotal(params) {
  return axios({
    url: '/video/accident/accident_record_xixiao_totalpage',
    method: 'post',
    data: params
  })
}

/* 车辆洗消 - 视频回放 */
export function getCarWashVideo(params) {
  return axios({
    url: '/video/video/getVideoRecord',
    method: 'post',
    data: params
  })
}

/* 车辆烘干 */
// export function getCarDrying(params) {
//   return axios({
//     url: 'http://192.168.1.171:8089/baseTelecomRoom/list',
//     method: 'get',
//     params: params
//   })
// }
// 数据查询
export function getCarDrying(params) {
  return axios({
    url: '/video/telecom/listevent',
    method: 'get',
    params: params
  })
}
// 温度变化
export function getCarDryingTemp(params) {
  return axios({
    url: '/video/telecom/listeventdetail',
    method: 'get',
    params: params
  })
}

/* 人员管理 */
// 档案管理
export function getPersonFiles(params) {
  return axios({
    url: '/video/person/ge_person_list',
    method: 'post',
    data: params
  })
}
/** 门禁管理图表 **/
export function getRecord(data) {
  return axios({
    url: '/video/screen/person/count_person_record',
    method: 'get',
    params: data
  })
}

/** 大门事件 */
export function getDoorAdmin(params) {
  return axios({
    url: '/video/door/ListDoorEvent',
    method: 'post',
    data: params
  })
}

/** 熏蒸事件 */
export function getBenconAdmin(params) {
  return axios({
    url: '/video/event/xunZhengEvent',
    method: 'post',
    data: params
  })
}

/** 卖猪事件 */
export function getSaleAdmin(params) {
  return axios({
    url: '/video/event/maiZhuEvent',
    method: 'post',
    data: params
  })
}

/** 生产数据 - ERP 数据分析 - 工作看板 */
// 汇总信息
export function getWorkTotal(params) {
  return axios({
    url: '/produce/prodWorkPlan/listWorkPlan',
    method: 'get',
    params: params
  })
}
// 报警信息
export function getWorkInfos(params) {
  return axios({
    url: '/produce/prodWarningMsg/listWarningMsg',
    method: 'get',
    params: params
  })
}

/**  生产数据 - ERP 数据分析 - 安全库存报警 */
export function getSafeInventory(params) {
  return axios({
    url: '/produce/prodGoodsWarning/listGoodsWarning',
    method: 'post',
    data: params
  })
}

/** 生产数据 - ERP - 生产情况 */
export function getProductionCondition(params) {
  return axios({
    url: '/produce/prodProduce/listProducee',
    method: 'get',
    params: params
  })
}

/** 生产数据 - ERP - 重要指标折线图 */
export function getImportantData(params) {
  return axios({
    url: '/produce/prodProduce/listImportance',
    method: 'post',
    data: params
  })
}

/* ERP - 经营分析 - 成本分析 */
export function getCostData(params) {
  return axios({
    url: '/produce/prodCostStatistics/listCost',
    method: 'get',
    params: params
  })
}

// 销售情况
export function getTheSales(params) {
  return axios({
    url: '/produce/prodSales/listSales',
    method: 'post',
    data: params
  })
}

/* 电子秤 */
// 重量详情
export function getDayWeight(params) {
  return axios({
    url: '/produce/weight/getEveryWeightOnPage',
    method: 'get',
    params: params
  })
}
// 近七次
export function getDaysQuery(params) {
  return axios({
    url: '/produce/weight/getWeightLastNtimes',
    method: 'get',
    params: params
  })
}
// 本月
export function getMonthQuery(params) {
  return axios({
    url: '/produce/weight/getWeightInOneMonth',
    method: 'get',
    params: params
  })
}
// 指定时间
export function getQuery(params) {
  return axios({
    url: '/produce/weight/getWeight',
    method: 'get',
    params: params
  })
}

/** 违规报警 */
/* 报警阈值设置 */
// 常规设置 - list
export function getRegularList(params) {
  return axios({
    url: '/produce/threshold/getThreshold',
    method: 'get',
    params: params
  })
}

// 常规设置 - 修改
export function getRegularSet(params) {
  return axios({
    url: '/produce/threshold/addThreshold',
    method: 'post',
    data: params
  })
}

// 报警设置 - 获取电话号码
export function getAlarmPhones(params) {
  return axios({
    url: '/produce/warningPhone/getWarningPhone',
    method: 'get',
    params: params
  })
}

// 报警设置 - 修改电话号码
export function postAlarmPhones(params) {
  return axios({
    url: '/produce/warningPhone/addWarningPhone',
    method: 'post',
    data: params
  })
}

// 报警设置 - 获取三个级别报警 table
export function getAlarmSets(params) {
  return axios({
    url: '/produce/warningSet/getWarningSet',
    method: 'get',
    params: params
  })
}

// 报警设置 - 修改三个级别报警 table
export function postAlarmSets(params) {
  return axios({
    url: '/produce/warningSet/addWarningSet',
    method: 'post',
    data: params
  })
}

/* 环境监测报警 */
export function getEnvAlarm(params) {
  return axios({
    url: '/produce/warningInfo/listWarningInfoZoology',
    method: 'post',
    data: params
  })
}

/* 环境排放报警 */
export function getSewageAlarm(params) {
  return axios({
    url: '/produce/warningInfo/listWarningInfoSewage',
    method: 'post',
    data: params
  })
}

/* 报警信息 */
// 报警情况占比 - 长条图
export function getOneWeekAlarm(params) {
  return axios({
    url: 'env/alarm/getOneWeekAlarm',
    method: 'get',
    params: params
  })
}

// 报警情况占比 - 圆环图
export function getTodayAlarmRate(params) {
  return axios({
    url: 'env/alarm/getTodayAlarmRate',
    method: 'get',
    params: params
  })
}

// 报警信息列表
export function getAlarmInfo(params) {
  return axios({
    url: '/produce/warningInfo/listWarningInfo',
    method: 'post',
    data: params
  })
}

/**
 * 设备管理
 */
/* 设备详情 */
// 设备概况
export function getDeviceSummer(params) {
  return axios({
    url: '/admin/farm/device/getCountDeviceFailureRate',
    method: 'get',
    params: params
  })
}
// 设备列表
export function getDeviceList(params) {
  return axios({
    url: '/admin/farm/device/listDevice',
    method: 'get',
    params: params
  })
}

// 设备新增
export function postDeviceAdd(params) {
  return axios({
    url: '/admin/farm/device/newDevice',
    method: 'get',
    params: params
  })
}

// 设备编辑
export function postDeviceEdit(params) {
  return axios({
    url: '/admin/farm/device/editDevice',
    method: 'get',
    params: params
  })
}

// 设备删除
export function postDeviceDel(params) {
  return axios({
    url: '/admin/farm/device/removeDevice',
    method: 'get',
    params: params
  })
}

export function postPerson(params) {
  return axios({
    url: '/video/person/getPersonOpenDoorFail',
    method: 'post',
    data: params
  })
}
