import request from '@/utils/request'

/***************************检查计划***************************/

//检查计划-列表
//自查任务-列表
export function checkPlanList(data) {
  return request({
    url: '/zd-security/checkPlan/list',
    method: 'post',
    data: data
  })
}
//检查计划-根据计划ID删除
//自查任务-根据计划ID删除
export function checkPlanDelete(query) {
  return request({
    url: '/zd-security/checkPlan/delete',
    method: 'delete',
    params: query
  })
}
//附件列表查询-通过计划ID查询附件列表
export function getFindByCheckPlanId(query) {
  return request({
    url: '/zd-security/upload/findByCheckPlanId',
    method: 'get',
    params: query
  })
}
//检查计划-根据计划ID查询管理列表
//自查任务-根据计划ID查询管理列表
export function findByCheckPlanId(data) {
  return request({
    url: '/zd-security/checkManage/findByCheckPlanId',
    method: 'post',
    data: data
  })
}
// 查询校级下实验室数量
export function laboratorySubRelInfoGetAllSubNum(query) {
  return request({
    url: '/laboratory/subRelInfo/getAllSubNum',
    method: 'get',
    params: query
  })
}
// 检查范围，选择学院，查询学院信息和实验室数量
export function laboratorySubRelInfoConditionCollegeInfo(query) {
  return request({
    url: '/laboratory/subRelInfo/conditionCollegeInfo',
    method: 'get',
    params: query
  })
}
// 检查计划-查询选中院系下的实验室列表
export function laboratorySubRelInfoGetRelListByCondition(data) {
  return request({
    url: '/laboratory/subRelInfo/getRelListByCondition',
    method: 'post',
    data: data
  })
}
// 检查计划-查询选中院系下的实验室列表
export function laboratorySubRelInfoConditionSubjectInfo(data) {
  return request({
    url: '/laboratory/subRelInfo/conditionSubjectInfo',
    method: 'post',
    data: data
  })
}
// 检查计划-专项检查查询危化品穿梭框内容
export function laboratoryHazardQueryHazardList(data) {
  return request({
    url: '/laboratory/hazard/queryHazardList',
    method: 'post',
    data: data
  })
}

//通用接口-人员查询(过滤已选/未选)
export function findUserList(data) {
  return request({
    url: '/system/user/findUserList',
    method: 'post',
    data: data
  })
}
//检查计划-新增计划
//自查任务-新增计划
export function checkPlanAdd(data) {
  return request({
    url: '/zd-security/checkPlan/add',
    method: 'post',
    data: data
  })
}
//检查计划-计划详情
//自查任务-计划详情
export function findCheckPlan(query) {
  return request({
    url: '/zd-security/checkPlan/findCheckPlan',
    method: 'get',
    params: query
  })
}
//检查计划-修改计划
//自查任务-修改计划
export function checkPlanUpdate(data) {
  return request({
    url: '/zd-security/checkPlan/update',
    method: 'post',
    data: data
  })
}
//校院巡察组-通过id查询巡查组详情
export function checkGroupFind(query) {
  return request({
    url: '/zd-security/checkGroup/find',
    method: 'get',
    params: query
  })
}
//检查计划-查询历史计划标题列表
//自查任务-查询历史计划标题列表
export function getHistoryPlanTitles(query) {
  return request({
    url: '/zd-security/checkPlan/getHistoryPlanTitles',
    method: 'get',
    params: query
  })
}

//工作台-查询是否院级用户
export function isSCollege(query) {
  return request({
    url: '/zd-security/collegCheck/isSCollege',
    method: 'get',
    params: query
  })
}
//检查计划-根据ID隐藏历史标题
export function hideHistoryPlanTitle(query) {
  return request({
    url: '/zd-security/checkPlan/hideHistoryPlanTitle',
    method: 'get',
    params: query
  })
}
//通用接口-设备确定提交
export function haveHazardInSub(data) {
  return request({
    url: '/laboratory/hazard/haveHazardInSub',
    method: 'post',
    data: data
  })
}
//项目检查库-树状列表
export function checkOptionList(query) {
  return request({
    url: '/zd-security/checkOption/list',
    method: 'get',
    params: query
  })
}
//检查计划-查询管理详情接口
//自查任务-查询管理详情接口
//自查任务-查询管理计划详情接口
//自查任务-查询管理任务详情接口
export function findCheckManage(query) {
  return request({
    url: '/zd-security/checkManage/findCheckManage',
    method: 'get',
    params: query
  })
}
//检查计划-查询管理保存/提交
//自查任务-查询管理保存/提交
export function checkManageUpdate(data) {
  return request({
    url: '/zd-security/checkManage/update',
    method: 'put',
    data: data
  })
}
//通用接口-查询检查项再特定实验室发生历史次数
export function countHazardNum(query) {
  return request({
    url: '/zd-security/checkHazard/countHazardNum',
    method: 'get',
    params: query
  })
}

/***************************校院巡察组***************************/
//校院巡察组-启用-停用巡查组
export function checkGroupEnable(query) {
  return request({
    url: '/zd-security/checkGroup/enable',
    method: 'put',
    params: query
  })
}
//校院巡察组-通过id删除巡查组
export function checkGroupDelete(query) {
  return request({
    url: '/zd-security/checkGroup/delete',
    method: 'delete',
    params: query
  })
}
//校院巡察组-分页获取校院巡查组列表
export function checkGroupList(data) {
  return request({
    url: '/zd-security/checkGroup/list',
    method: 'post',
    data: data
  })
}
//校院巡察组-新增
export function checkGroupAdd(data) {
  return request({
    url: '/zd-security/checkGroup/add',
    method: 'post',
    data: data
  })
}

//校院巡察组-编辑
export function checkGroupUpdate(data) {
  return request({
    url: '/zd-security/checkGroup/update',
    method: 'put',
    data: data
  })
}

//校院巡察组-获取巡察组下拉列表
export function findGroupList(data) {
  return request({
    url: '/zd-security/checkGroup/findGroupList',
    method: 'post',
    data: data
  })
}

//通用接口-根据实验室id查询该实验室有关计划
export function getCheckPlanBySubId(query) {
  return request({
    url: '/zd-security/checkManage/getCheckPlanBySubId',
    method: 'get',
    params: query
  })
}

//开展检查-提交
export function checkManageAdd(data) {
  return request({
    url: '/zd-security/checkManage/add',
    method: 'post',
    data: data
  })
}
//获取权限范围(巡查/自查)
export function getGentle(query){
  return request({
    url: '/zd-security/checkSet/getGentle',
    method: 'get',
    params: query
  })
}

//通用接口-根据实验室id分类查询实验室内设备
export function getHazardInfoBySubId(query) {
  return request({
    url: '/laboratory/hazard/getHazardInfoBySubId',
    method: 'get',
    params: query
  })
}
//通用接口-根据选择的设备id生成检查项
export function getHazardInfoByJoinIds(query) {
  return request({
    url: '/security/checkManage/getHazardInfoByJoinIds',
    method: 'get',
    params: query
  })
}

//检查计划-查询管理列表
//自查任务-查询管理列表
export function checkManageList(data) {
  return request({
    url: '/security/checkManage/list',
    method: 'post',
    data: data
  })
}
//安全隐患-隐患详情
export function getHazardById(query) {
  return request({
    url: '/zd-security/checkHazard/getHazardById',
    method: 'get',
    params: query
  })
}
//安全隐患-隐患整改-隐患审核
export function addOrApprove(data) {
  return request({
    url: '/zd-security/checkRectify/addOrApprove',
    method: 'post',
    data: data
  })
}

//待整改
export function rectifyList(query) {
  return request({
    url: '/zd-security/checkHazard/rectifyList',
    method: 'get',
    params: query
  })
}
//待复核
export function recheckList(query) {
  return request({
    url: '/zd-security/checkHazard/recheckList',
    method: 'get',
    params: query
  })
}
//已完成
export function overList(query) {
  return request({
    url: '/zd-security/checkHazard/overList',
    method: 'get',
    params: query
  })
}

//安全隐患-校院巡察/批量审核列表
export function batchApprovalList(query) {
  return request({
    url: '/zd-security/checkHazard/batchApprovalList',
    method: 'get',
    params: query
  })
}

//安全隐患-批量审核
export function batchApprove(data) {
  return request({
    url: '/zd-security/checkRectify/batchApprove',
    method: 'post',
    data: data
  })
}

//安全隐患-暂无法整改列表数据
export function unableRectifyList(query) {
  return request({
    url: '/zd-security/checkHazard/unableRectifyList',
    method: 'get',
    params: query
  })
}

//整改报告-列表
export function checkRectifyList(query) {
  return request({
    url: '/zd-security/checkRectify/list',
    method: 'get',
    params: query
  })
}
