import request from "@/utils/request";

// 列表查询
export function getCameraDataList(data) {
  return request({
    url: "/service/baseCameraManagement/list",
    method: "post",
    data,
  });
}

// 获取摄像机详情
export function homeGetInfo(data) {
  return request({
    url: "/service/baseCameraManagement/homeGetInfo",
    method: "post",
    data,
  });
}

export function getSelectCameraAll(data) {
  return request({
    url: "/service/baseCameraManagement/selectCameraAll",
    method: "get",
    data,
  });
}

// 新增
export function getCameraDataAddNewer(data) {
  return request({
    url: "/service/baseCameraManagement/saveAccountManagement",
    method: "post",
    data,
  });
}
// 获取工务段
export function getWorkSetion(data) {
  return request({
    url: "/system/dict/data/type/public_worksSection_nam",
    method: "get",
    data,
  });
}
// 获取行别
export function getLineDir(data) {
  return request({
    url: "/system/dict/data/type/sys_line_dir",
    method: "get",
    data,
  });
}
// 获取监视方向
export function getDirection(data) {
  return request({
    url: "/system/dict/data/type/monitoring_direction",
    method: "get",
    data,
  });
}
// 获取线路
export function getLineData(data) {
  return request({
    url: "/system/dict/data/type/railway_name",
    method: "get",
    data,
  });
}
// 删除
export function getCameraDataDelete(userIds) {
  return request({
    url: `/service/baseCameraManagement/remove/${userIds}`,
    method: "get",
  });
}
// 修改
export function getCameraDataUpdate(data) {
  return request({
    url: "/service/baseCameraManagement/editAccountManagement",
    method: "post",
    data,
  });
}
// 导入
export function getCameraDataUpLoadIn(params) {
  return request({
    url: "/service/baseCameraManagement/importBaseAccountManagement",
    method: "post",
    data: params,
  });
}
// 导出
export function getCameraDataUpLoadOut(data) {
  return request({
    url: "/service/baseCameraManagement/exportBaseAccountManagement",
    method: "post",
    data,
    responseType: "blob",
  });
}
// 下载模板
export function getCameraDataLoadOut(params) {
  return request({
    url: "/service/baseAccountManagement/exportBaseAccountManagement",
    method: "post",
    params,
  });
}
// 根据相机ID获取详细信息
export function getCameraFetail(userId) {
  return request({
    url: `/service/baseCameraManagement/${userId}`,
    method: "get",
  });
}
// 关联用户
export function getCameraGlUser(params) {
  return request({
    url: "/service/baseAccountManagement/associatedUser/1/1",
    method: "get",
    params,
  });
}
// 关联用户回显
export function getCameraGlUserDet(params) {
  return request({
    url: "/service/baseAccountManagement/getRoleId/1",
    method: "get",
    params,
  });
}

// 部门
// export function getDeptList(data) {
//   return request({
//     url: '/system/dept/list',
//     method: 'get',
//     data
//   })
// }

export function getDeptList(data) {
  return request({
    url: "/system/user/deptTree",
    method: "get",
    data,
  });
}
// 线路
export function getLineWayList(data) {
  return request({
    url: "/service/baseRailwayManagement/query",
    method: "get",
    data,
  });
}
// 视频服务列表
// 查询录像
// 模板下载
export function getDownLoadList(data) {
  return request({
    url: "/service/baseCameraManagement/downloaExcel",
    method: "get",
    data,
    responseType: "blob",
  });
}
// 视频录制状态关闭
export function getRecording(id) {
  return request({
    url: `/service/baseCameraManagement/endRecording/${id}`,
    method: "get",
  });
}
// 视频录制状态关闭
export function getStartRecording(id) {
  return request({
    url: `/service/baseCameraManagement/startRecording/${id}`,
    method: "get",
  });
}
// 摄像机状态关闭
export function toEnabAccrame(params) {
  return request({
    url: "service/baseCameraManagement/updateEnableOrNot",
    method: "get",
    params,
  });
}
// 树
