import request from '@/utils/bigDataRequest' //引入axios的封装方法

//获取30天内预案执行次数
export function queryPlanCount(query) {
  return request({
    url: '/laboratory/plan/log/queryPlanCount',
    method: 'post',
    params: query
  })
}

//风险趋势统计图
export function queryRiskTrend(data) {
  return request({
    url: '/laboratory/plan/log/queryRiskTrend',
    method: 'post',
    type:'kong',
    data: data
  })
}

//危险源排名
export function queryRanking(data) {
  return request({
    url: '/laboratory/hazard/queryRanking',
    method: 'post',
    type:'kong',
    data: data
  })
}

//设备运行情况
export function getYearControlInfo(query) {
  return request({
    url: '/laboratory/control/getYearControlInfo',
    method: 'get',
    params: query
  })
}

//查询重点实验室
export function bigviewSub(query) {
  return request({
    url: '/laboratory/bigview/sub/9999',
    method: 'get',
    params: query
  })
}

//获取层数
export function getLablayout(id) {
  return request({
    url: '/laboratory/building/lablayout?showHazard=false&deptId='+id,
    method: '',
  })
}

//获取楼数据
export function deptListVO(query) {
  return request({
    url: '/system/dept/listVO',
    method: 'get',
    params: query
  })
}

//根据层数获取层数据
export function getlabInfoLayout(id,type) {
  return request({
    url: '/laboratory/building/labInfoLayout?deptId='+id+'&type='+type,
    method: 'get',
  })
}

//获取报警信息
export function getListStatus(query) {
  return request({
    url: '/laboratory/plan/group/getList?status=1',
    method: 'get',
    params: query
  })
}

//结束预案
export function closeRiskPlan(data) {
  return request({
    url: '/laboratory/plan/closeRiskPlan/',
    method: 'post',
    data:data
  })
}


//获取报警详情
export function abnormalLogOrderByList(id) {
  return request({
    url: '/laboratory/plan/log/abnormalLogOrderByList?groupId='+id,
    method: 'get',
  })
}

//获取实验室简要信息
export function bigview(id) {
  return request({
    url: '/laboratory/bigview/'+id+'/sub',
    method: 'get',
  })
}

//获取实验室简要信息
export function message(id) {
  return request({
    url: '/laboratory/bigview/'+id+'/warn/message',
    method: 'get',
  })
}

//实验室测点功能列表
export function onemachineList(id) {
  return request({
    url: '/laboratory/onemachine/'+id+'/function/list',
    method: 'get',
  })
}

//获取实验室一体机可控制设备
export function controllerList(id) {
  return request({
    url: '/laboratory/onemachine/'+id+'/controller/list',
    method: 'get',
  })
}

//根据ID查询摄像头列表
export function channels(query) {
  return request({
    url: '/camera/api/device/query/devices/channels',
    method: 'get',
    params: query
  })
}

//根据ID查询摄像头地址
export function startUrl(query) {
  return request({
    url: '/camera/api/play/startList',
    type:'video',
    method: 'get',
    params: query
  })
}

//根据组织架构和楼层查询摄像头
export function getVideoByDeptFloor(query) {
  return request({
    url: '/laboratory/building/getVideoByDeptFloor',
    method: 'get',
    params: query
  })
}

//设备开关
export function mangerControl(query) {
  return request({
    url: '/laboratory/subject/manger/control/'+query.id+'/'+query.command,
    method: 'post',
    params: query
  })
}

//根据预案关闭实验室电源
export function planClosePower(query) {
  return request({
    url: '/laboratory/plan/closePower/'+query.id,
    method: 'post',
  })
}

//**************2021-11-13***********大屏新接口
//安全隐患统计
export function dengerStatistics(data) {
  return request({
    url: '/laboratory/denger/statistics',
    method: 'post',
    data: data
  })
}
//安全隐患列表
export function dengerList(data) {
  return request({
    url: '/laboratory/denger/list',
    method: 'post',
    data: data
  })
}
//人员违规统计
export function violationBigDataStatistics(data) {
  return request({
    url: '/laboratory/violation/bigData/statistics',
    method: 'post',
    data: data
  })
}
//安全考试与安全准入统计
export function approvalBigDataStatistics(data) {
  return request({
    url: '/laboratory/approval/bigData/statistics',
    method: 'post',
    data: data
  })
}

//实验室人数
export function subOnline(query) {
  return request({
    url: '/laboratory/bigview/sub/online',
    method: 'post',
    data: query
  })
}

//查询实验室人员列表
export function subOnlineUser(query) {
  return request({
    url: '/laboratory/bigview/sub/online/user',
    method: 'post',
    data: query
  })
}

//根据用户获取地图展示权限
export function roleAuthUserPower(query) {
  return request({
    url: '/system/role/authUser/power',
    method: 'post',
  })
}

