import request from '@/utils/request'

/**
 * 1. 实验室基本情况统计 & 安全分级统计
 * GET /laboratory/labScreen/labBasicStatistics
 */
export function getLabBasicStatistics() {
  return request({
    url: '/laboratory/labScreen/labBasicStatistics',
    method: 'get'
  })
}

/**
 * 2. 实验室进入人数统计及走势（24小时）
 * GET /laboratory/labScreen/passOutTrend
 */
export function getPassOutTrend() {
  return request({
    url: '/laboratory/labScreen/passOutTrend',
    method: 'get'
  })
}

/**
 * 3. 实验环境安全实时监测（分页）
 * GET /laboratory/labScreen/envMonitor
 */
export function getEnvMonitor(params = { page: 1, pageSize: 10 }) {
  return request({
    url: '/laboratory/labScreen/envMonitor',
    method: 'get',
    params
  })
}

/**
 * 4. 实验室实时风险预警
 * GET /laboratory/labScreen/riskWarning
 */
export function getRiskWarning() {
  return request({
    url: '/laboratory/labScreen/riskWarning',
    method: 'get'
  })
}

/**
 * 5. 智能环境感知应用设备统计
 * GET /laboratory/labScreen/iotDeviceStatistics
 */
export function getIotDeviceStatistics() {
  return request({
    url: '/laboratory/labScreen/iotDeviceStatistics',
    method: 'get'
  })
}

/**
 * 6. 实验室设备分类及使用统计
 * GET /laboratory/labScreen/deviceCategoryStat
 */
export function getDeviceCategoryStat() {
  return request({
    url: '/laboratory/labScreen/deviceCategoryStat',
    method: 'get'
  })
}

/**
 * 7. 风险预警 - 触发预案信息查询
 * GET /laboratory/labScreen/selectTriggerInfo
 */
export function selectTriggerInfo() {
  return request({
    url: '/laboratory/labScreen/selectTriggerInfo',
    method: 'get'
  })
}

/**
 * 11. 耗材相关二级学院下拉列表
 * POST /laboratory/labScreen/deptDropList
 */
export function getDeptDropList(data = {}) {
  return request({
    url: '/laboratory/labScreen/deptDropList',
    method: 'post',
    data
  })
}

/**
 * 12. 根据条件查询楼道实验室信息
 * POST /laboratory/labScreen/rooms
 */
export function getRooms(data = {}) {
  return request({
    url: '/laboratory/labScreen/rooms',
    method: 'post',
    data
  })
}

/**
 * 13. 实验室分级配置列表
 * POST /laboratory/labScreen/getLevelTitleList
 */
export function getLevelTitleList() {
  return request({
    url: '/laboratory/labScreen/getLevelTitleList',
    method: 'post',
    data: {}
  })
}

/**
 * 14. 获取摄像头播放地址
 * GET /laboratory/labScreen/getPreviewURLs
 */
export function getPreviewURLs(params) {
  return request({
    url: '/laboratory/labScreen/getPreviewURLs',
    method: 'get',
    params
  })
}

/**
 * 8. 实时监控 - 楼栋楼层树
 * POST /laboratory/labScreen/monitorTree
 */
export function getMonitorTree(data = {}) {
  return request({
    url: '/laboratory/labScreen/monitorTree',
    method: 'post',
    data
  })
}

/**
 * 9. 实时监控 - 摄像头流地址
 * POST /iot/camera/large/findByCondition
 */
export function getCameraStream(data) {
  return request({
    url: '/iot/camera/large/findByCondition',
    method: 'post',
    data
  })
}

/**
 * getCameraList - 兼容 SecurityMonitor 组件，获取摄像头列表名称
 * 复用 cameraStream，返回设备名列表
 */
export function getCameraList(data = {}) {
  return request({
    url: '/iot/camera/large/findByCondition',
    method: 'post',
    data
  })
}

/**
 * 10. 大屏天气及服务器时间
 * GET /laboratory/labScreen/weather
 */
export function getWeather() {
  return request({
    url: '/laboratory/labScreen/weather',
    method: 'get'
  })
}

/**
 * 11. 根据设备ID查询视频流
 * GET /iot/camera/getPreviewURLs
 */
export function iotCameraGetPreviewURLs(params) {
  return request({
    url: '/iot/camera/getPreviewURLs',
    method: 'get',
    params
  })
}

//应急处置-获取楼层布局数据
export function laboratoryBigViewGetFloorByBigView(params) {
  return request({
    url: '/laboratory/bigView/getFloorByBigView',
    method: 'get',
    params
  })
}
//应急处置-查询当前正在发生的预案
export function laboratoryBigViewSelectTriggerInfo(params) {
  return request({
    url: '/laboratory/bigView/selectTriggerInfo',
    method: 'get',
    params
  })
}
//应急处置-获取当前楼栋-楼层下的疏散数据
export function laboratoryExitLineGetRedisEvacuation(data = {}) {
  return request({
    url: '/laboratory/exitLine/getRedisEvacuation',
    method: 'post',
    data
  })
}

//获取摄像头流地址
export function iotCameraFindByCondition(data = {}) {
  return request({
    url: '/iot/camera/findByCondition',
    method: 'post',
    data
  })
}
//应急处置-查询实验室传感器列表
export function iotBigViewDeviceFindBySubId(params) {
  return request({
    url: '/iot/bigView/device/findBySubId',
    method: 'get',
    params
  })
}

//应急处置-查询实验室喇叭列表
export function iotBigViewDeviceFindByType(data = {}) {
  return request({
    url: '/iot/bigView/device/findByType',
    method: 'post',
    data
  })
}
//应急处置-结束预案
export function laboratoryPlanCloseRiskPlan(params) {
  return request({
    url: '/laboratory/plan/closeRiskPlan',
    method: 'get',
    params
  })
}
//应急处置-结束疏散
export function laboratoryExitLineEndEvacuation(data = {}) {
  return request({
    url: '/laboratory/exitLine/endEvacuation',
    method: 'post',
    data
  })
}
//应急处置-开灯
export function laboratoryExitRelayOpenLight(data = {}) {
  return request({
    url: '/laboratory/exitRelay/openLight',
    method: 'post',
    data
  })
}
//应急处置-关灯
export function laboratoryExitRelayCloseLight(data = {}) {
  return request({
    url: '/laboratory/exitRelay/closeLight',
    method: 'post',
    data
  })
}
//应急处置-执行疏散
export function laboratoryExitLineExecuteEvacuation(data = {}) {
  return request({
    url: '/laboratory/exitLine/executeEvacuation',
    method: 'post',
    data
  })
}
//应急处置-喇叭播放文本
export function iotBigViewSpeakerPlayText(params) {
  return request({
    url: '/iot/bigView/speaker/playText',
    method: 'get',
    params
  })
}

// 化学品库存动态统计
export function getChemicalStockSummary() {
  return request({
    url: '/chemical/stock/stockSummary',
    method: 'get'
  })
}

//查询视频配置
export function laboratoryLabScreenScreenConfigGet(params) {
  return request({
    url: '/laboratory/labScreen/screenConfig/get',
    method: 'get',
    params
  })
}

