import request from "@/utils/request";

// 视频列表树
export function cameraTree(data) {
  return request({
    url: "/service/baseCameraManagement/cameraTree",
    method: "post",
    params: data,
    data: data,
  });
}

// 批量获取视频直播流
export function recordsList(data) {
  return request({
    url: "/service/baseCameraManagement/api/recordsList",
    method: "get",
    data: data,
    // params: data
  });
}

// 批量获取视频直播流
export function editAccountManagement(data) {
  return request({
    url: "/service/baseCameraManagement/editAccountManagement",
    method: "post",
    data: data,
    params: data,
  });
}

// 单个获取视频直播流
export function records(code, flay = true) {
  if (!code) {
    return;
  }
  return request({
    url: "/service/baseCameraManagement/api/records/" + code,
    // url: '/service/baseCameraManagement/api/records/' + code + '/' + flay,
    method: "get",
  });
}

// 视频回放
export function invite(data) {
  return request({
    url: "/service/baseCameraManagement/api/play",
    method: "post",
    data: data,
  });
}
//回放视频
export function invites(data) {
  return request({
    url:
      "/service/baseCameraManagement/api/getRecordByAlarmId/?alarmId=" + data,
    method: "get",
  });
}

// 报警消息详情历史报警次数信息
export function alarmHistoricalAlarm(data) {
  return request({
    url: "/service/msgAlarm/alarmHistoricalAlarm/" + data,
    method: "get",
  });
}

// 视频服务设备数量

export function videoQuantity() {
  return request({
    url: "/service/baseCameraManagement/totalNumberOfDevices",
    method: "get",
  });
}

export function beseGetCameraCode(data) {
  return request({
    url: "/service/baseCameraManagement/getCameraCode?cameraCode=" + data,
    method: "get",
  });
}

// 视频上方显示的数据
export function lineDate(data) {
  return request({
    url: "/service/baseCameraManagement/getDate/" + data,
    method: "get",
  });
}
// 报警信息管理视频上方显示的数据
export function lineDatePro(data) {
  return request({
    url: "/service/msgAlarm/getDate" + data,
    method: "get",
  });
}

export function videoHistoricalAlarm(data) {
  return request({
    url: "/service/msgAlarm/videoHistoricalAlarm/" + data,
    method: "get",
  });
}

// 获取摄像机详细信息
export function getAlarm(data) {
  return request({
    url: "/service/baseCameraManagement/getAlarm/" + data,
    method: "get",
  });
}

export function baseCameraManagementPlay(data) {
  return request({
    url: "/service/baseCameraManagement/api/record",
    method: "post",
    data: data,
  });
}

export function lineDateStock(data) {
  return request({
    url: "/baseVehicle/getDate/" + data,
    method: "get",
  });
}

// 报警信息管理视频上方显示的数据
export function lineDateProPost(data) {
  let newDate = data;
  if (typeof newDate.alarmMile !== "number") {
    newDate.alarmMile = newDate.alarmMiles;
  }
  return request({
    url: "/service/msgAlarm/getDate",
    method: "post",
    data: newDate,
  });
}

// 导入
export function serviceFileoss(params) {
  return request({
    url: "/service/fileoss",
    method: "post",
    data: params,
  });
}

//首页-信息统计
export function messageStatistics() {
  return request({
    url: `/service/dataStatistic/getMessageStatistics`,
    method: "post",
  });
}
//首页-监测系统信息
export function monitorSystem() {
  return request({
    url: `/system/monitor/monitorSystem`,
    method: "post",
  });
}

//首页-报警列表
export function alarmList(alarmType) {
  return request({
    url: `/service/msgAlarm/list`,
    method: "post",
    data: {
      pageNum: 1,
      pageSize: 10,
      isRelease: alarmType,
    },
  });
}
