import request from '@/utils/request'

/***************************工作台***************************/

//工作台-查询是否院级用户
export function isSCollege(query) {
  return request({
    url: '/security/collegCheck/isSCollege',
    method: 'get',
    params: query
  })
}

//工作台-校级巡查数据
export function schoolWorkCheck(query) {
  return request({
    url: '/security/schoolWork/check',
    method: 'get',
    params: query
  })
}

//工作台-实验室巡查数据
export function schoolWorkSubCheck(query) {
  return request({
    url: '/security/schoolWork/subCheck',
    method: 'get',
    params: query
  })
}

//工作台-待办事项列表
export function todoList(query) {
  return request({
    url: '/security/schoolWork/todoList',
    method: 'get',
    params: query
  })
}

//工作台-待办事项列表-待复核
export function tobeReviewed(query) {
  return request({
    url: '/security/schoolWork/tobeReviewed',
    method: 'get',
    params: query
  })
}

//工作台-存在隐患
export function hiddenCount(query) {
  return request({
    url: '/security/schoolWork/hiddenCount',
    method: 'get',
    params: query
  })
}

//工作台-检查覆盖率
export function yearRate(query) {
  return request({
    url: '/security/schoolWork/yearRate',
    method: 'get',
    params: query
  })
}

//工作台-检查统计
export function checkStatistics(query) {
  return request({
    url: '/security/schoolWork/checkStatistics',
    method: 'get',
    params: query
  })
}

//工作台-已处理隐患
export function hiddenDangerRectify(query) {
  return request({
    url: '/security/schoolWork/hiddenDangerRectify',
    method: 'get',
    params: query
  })
}

//工作台-指标统计(校级)
export function hiddenCountByType(query) {
  return request({
    url: '/security/schoolWork/hiddenCountByType',
    method: 'get',
    params: query
  })
}
//工作台-指标统计(院级)
export function collegCheckHiddenCountByType(query) {
  return request({
    url: '/security/collegCheck/hiddenCountByType',
    method: 'get',
    params: query
  })
}

/***************************随手拍***************************/

//随手拍-上报记录-列表
export function securityCheckClapList(query) {
  return request({
    url: '/security/checkClap/list',
    method: 'get',
    params: query
  })
}

//随手拍-上报记录-提交
export function checkClapAdd(data) {
  return request({
    url: '/security/checkClap/add',
    method: 'post',
    data: data
  })
}

//随手拍-上报记录-详情
export function findById(query) {
  return request({
    url: '/security/checkClap/findById',
    method: 'get',
    params: query
  })
}

//随手拍-上报记录-整改
export function clapApprove(data) {
  return request({
    url: '/security/checkClap/clapApprove',
    method: 'post',
    data: data
  })
}

//随手拍-上报记录-上报记录
export function checkClapMylist(query) {
  return request({
    url: '/security/checkClap/mylist',
    method: 'get',
    params: query
  })
}

/***************************整改报告***************************/

//整改报告-列表
export function checkRectifyList(query) {
  return request({
    url: '/security/checkRectify/list',
    method: 'get',
    params: query
  })
}
//整改报告-下载  '/security/checkRectify/genReport/'+row.id
//整改报告-批量下载  '/security/checkRectify/genReport/zip/'+text

/***************************项目检查库***************************/

//项目检查库-树状列表
export function checkOptionList(query) {
  return request({
    url: '/security/checkOption/list',
    method: 'get',
    params: query
  })
}

//项目检查库-添加
export function checkOptionAdd(data) {
  return request({
    url: '/security/checkOption/add',
    method: 'post',
    data: data
  })
}

//项目检查库-编辑
export function checkOptionUpdate(data) {
  return request({
    url: '/security/checkOption/update',
    method: 'post',
    data: data
  })
}

//项目检查库-删除
export function checkOptionDelete(id) {
  return request({
    url: '/security/checkOption/delete/'+id,
    method: 'delete'
  })
}

//项目检查库-批量删除
export function checkOptionBatchDelete(ids) {
  return request({
    url: '/security/checkOption/batchDelete/'+ids,
    method: 'delete'
  })
}

/***************************检查配置***************************/

//检查配置 检查人员/整改人员-列表
export function checkStaffList(query) {
  return request({
    url: '/security/checkStaff/list',
    method: 'get',
    params: query
  })
}

//检查配置 检查人员/整改人员-查询当前配置
export function checkSet(query) {
  return request({
    url: '/security/checkSet/list',
    method: 'get',
    params: query
  })
}

//检查配置 检查人员/整改人员-保存当前配置
export function checkSetAdd(data) {
  return request({
    url: '/security/checkSet/add',
    method: 'post',
    data: data
  })
}

//检查配置 人员列表查询
export function checkStaffUserList(data) {
  return request({
    url: '/security/checkStaffUser/list',
    method: 'post',
    data: data
  })
}

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

//检查计划-列表
//自查任务-列表
export function checkPlanList(data) {
  return request({
    url: '/security/checkPlan/list',
    method: 'post',
    data: data
  })
}

//检查计划-根据计划ID查询管理列表
//自查任务-根据计划ID查询管理列表
export function findByCheckPlanId(data) {
  return request({
    url: '/security/checkManage/findByCheckPlanId',
    method: 'post',
    data: data
  })
}

//检查计划-查询管理列表
//自查任务-查询管理列表
export function checkManageList(data) {
  return request({
    url: '/security/checkManage/list',
    method: 'post',
    data: data
  })
}

//检查计划-查询管理详情接口
//自查任务-查询管理详情接口
//自查任务-查询管理计划详情接口
//自查任务-查询管理任务详情接口
export function findCheckManage(query) {
  return request({
    url: '/security/checkManage/findCheckManage',
    method: 'get',
    params: query
  })
}

//检查计划-查询管理保存/提交
//自查任务-查询管理保存/提交
export function checkManageUpdate(data) {
  return request({
    url: '/security/checkManage/update',
    method: 'put',
    data: data
  })
}

//检查计划-根据计划ID删除
//自查任务-根据计划ID删除
export function checkPlanDelete(query) {
  return request({
    url: '/security/checkPlan/delete',
    method: 'delete',
    params: query
  })
}

//检查计划-查询历史计划标题列表
//自查任务-查询历史计划标题列表
export function getHistoryPlanTitles(query) {
  return request({
    url: '/security/checkPlan/getHistoryPlanTitles',
    method: 'get',
    params: query
  })
}

//检查计划-根据ID隐藏历史标题
export function hideHistoryPlanTitle(query) {
  return request({
    url: '/security/checkPlan/hideHistoryPlanTitle',
    method: 'get',
    params: query
  })
}

//检查计划-查询当前学校下实验室数量
export function getAllSubNum(query) {
  return request({
    url: '/laboratory/subject/getAllSubNum',
    method: 'get',
    params: query
  })
}

//检查计划-查询当前学校下学院列表与实验室数量
export function conditionCollegeInfo(query) {
  return request({
    url: '/laboratory/subject/conditionCollegeInfo',
    method: 'get',
    params: query
  })
}

//检查计划-查询选中院系下的实验室列表
export function findSubInfoByDeptIds(data) {
  return request({
    url: '/laboratory/subject/findSubInfoByDeptIds',
    method: 'post',
    data: data
  })
}

//检查计划-查询实验室(已过滤/未选)
export function conditionSubjectInfo(data) {
  return request({
    url: '/laboratory/subject/conditionSubjectInfo',
    method: 'post',
    data: data
  })
}

//检查计划-新增计划
//自查任务-新增计划
export function checkPlanAdd(data) {
  return request({
    url: '/security/checkPlan/add',
    method: 'post',
    data: data
  })
}

//检查计划-计划详情
//自查任务-计划详情
export function findCheckPlan(query) {
  return request({
    url: '/security/checkPlan/findCheckPlan',
    method: 'get',
    params: query
  })
}

//检查计划-修改计划
//自查任务-修改计划
export function checkPlanUpdate(data) {
  return request({
    url: '/security/checkPlan/update',
    method: 'put',
    data: data
  })
}



/***************************校院巡察组***************************/

//校院巡察组-分页获取校院巡查组列表
export function checkGroupList(data) {
  return request({
    url: '/security/checkGroup/list',
    method: 'post',
    data: data
  })
}

//校院巡察组-通过id查询巡查组详情
export function checkGroupFind(query) {
  return request({
    url: '/security/checkGroup/find',
    method: 'get',
    params: query
  })
}

//校院巡察组-启用-停用巡查组
export function checkGroupEnable(query) {
  return request({
    url: '/security/checkGroup/enable',
    method: 'put',
    params: query
  })
}

//校院巡察组-通过id删除巡查组
export function checkGroupDelete(query) {
  return request({
    url: '/security/checkGroup/delete',
    method: 'delete',
    params: query
  })
}
//校院巡察组-新增
export function checkGroupAdd(data) {
  return request({
    url: '/security/checkGroup/add',
    method: 'post',
    data: data
  })
}

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

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

/***************************安全隐患***************************/

//安全隐患-校院巡察/实验室自查-安全隐患列表
//整改报告-报告隐患列表
export function checkHazardList(query) {
  return request({
    url: '/security/checkHazard/list',
    method: 'get',
    params: query
  })
}

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

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

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

//安全隐患-隐患详情
export function getHazardById(query) {
  return request({
    url: '/security/checkHazard/getHazardById',
    method: 'get',
    params: query
  })
}

//安全隐患-隐患整改-隐患审核
export function addOrApprove(data) {
  return request({
    url: '/security/checkRectify/addOrApprove',
    method: 'post',
    data: data
  })
}


/***************************数据统计***************************/

//数据统计-实验室列表头部数据汇总
export function dataStatisticsSubListTop(query) {
  return request({
    url: '/security/DataStatistics/subListTop',
    method: 'get',
    params: query
  })
}

//数据统计-按实验室查询列表
export function dataStatisticsSubList(query) {
  return request({
    url: '/security/DataStatistics/subList',
    method: 'get',
    params: query
  })
}

//数据统计-安全隐患列表头部数据汇总
export function dataStatisticsHazardListTop(query) {
  return request({
    url: '/security/DataStatistics/hazardListTop',
    method: 'get',
    params: query
  })
}

//数据统计-按安全隐患查询列表
export function dataStatisticsHazardList(query) {
  return request({
    url: '/security/DataStatistics/hazardList',
    method: 'get',
    params: query
  })
}

//数据统计-指标列表头部数据汇总
export function dataStatisticsItemsListTop(query) {
  return request({
    url: '/security/DataStatistics/itemsListTop',
    method: 'get',
    params: query
  })
}

//数据统计-按指标查询列表
export function dataStatisticsItemsList(query) {
  return request({
    url: '/security/DataStatistics/itemsList',
    method: 'get',
    params: query
  })
}

















/***************************通用接口***************************/

//通用接口-人员查询(过滤已选/未选)
export function findUserList(data) {
  return request({
    url: '/system/user/findUserList',
    method: 'post',
    data: data
  })
}

//通用接口-查询检查项再特定实验室发生历史次数
export function countHazardNum(query) {
  return request({
    url: '/security/checkHazard/countHazardNum',
    method: 'get',
    params: query
  })
}

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

//通用接口-根据楼栋ID查询实验室列表
//通用接口-根据名称查询实验室列表
export function buildBySubList(query) {
  return request({
    url: '/laboratory/subject/buildBySub/list',
    method: 'get',
    params: query
  })
}

//开展检查-提交
export function checkManageAdd(data) {
  return request({
    url: '/security/checkManage/add',
    method: 'post',
    data: data
  })
}
//通知配置-获取通知配置
export function noticeConfigList(query) {
  return request({
    url: '/security/noticeConfig/list',
    method: 'get',
    params: query
  })
}
//通知配置-提交通知配置
export function noticeConfigAdd(data) {
  return request({
    url: '/security/noticeConfig/add',
    method: 'post',
    data: data
  })
}

//附件列表查询-通过计划ID查询附件列表
export function getFindByCheckPlanId(query) {
  return request({
    url: '/security/upload/findByCheckPlanId',
    method: 'get',
    params: query
  })
}

//工作台跳转后-按指标统计列表
export function hiddenDataItemsSubList(query) {
  return request({
    url: '/security/collegCheck/hiddenDataItemsSubList',
    method: 'get',
    params: query
  })
}

//工作台跳转后-按指标统计顶部数据
export function hiddenDataItemsSubListTop(query) {
  return request({
    url: '/security/collegCheck/hiddenDataItemsSubListTop',
    method: 'get',
    params: query
  })
}

//工作台跳转后-按名称搜索权限下实验室列表
export function listSubAdmin(query){
  return request({
    url: '/laboratory/subject/list/listSubAdmin',
    method: 'get',
    params: query
  })
}

//工作台跳转后-获取当前角色所属院系ID
export function getloginUser(query){
  return request({
    url: '/security/collegCheck/getloginUser',
    method: 'get',
    params: query
  })
}

//整改报告-查看文档模式数据
export function viewReport(id){
  return request({
    url: '/security/checkRectify/viewReport/'+id,
    method: 'get',
  })
}

//整改通知书-查看文档模式数据
export function getRectifyAdviceNoteView(id){
  return request({
    url: '/security/checkManage/getRectifyAdviceNoteView/'+id,
    method: 'get',
  })
}

//整改告知书-查看文档模式数据
export function getRectifyNotificationView(id){
  return request({
    url: '/security/checkManage/getRectifyNotificationView/'+id,
    method: 'get',
  })
}

//下载-整改报告
//下载-通知书
//下载-告知书
//下载-检查材料
//批量下载-检查材料

//获取权限范围(巡查/自查)
export function getGentle(query){
  return request({
    url: '/security/checkSet/getGentle',
    method: 'get',
    params: query
  })
}
