import request from '@/utils/request'

//编辑条件
export function materialdataPut(data) {
  return request({
    url: '/laboratory/materialdata',
    method: 'put',
    data:data
  })
}

//添加条件
export function materialdata(data) {
  return request({
    url: '/laboratory/materialdata/add',
    method: 'post',
    data: data
  })
}

//获取条件列表
export function materialdataList(query) {
  return request({
    url: '/laboratory/materialdata/list',
    method: 'get',
    params: query
  })
}

//删除条件
export function materialdataDel(id) {
  return request({
    url: '/laboratory/materialdata/'+id,
    method: 'delete',
  })
}

//安全准入审批接口
export function laboratoryApply(data) {
  return request({
    url: '/laboratory/apply',
    method: 'put',
    data: data
  })
}

// 查询安全准入资格列表
export function listGroup(query) {
  return request({
    url: '/laboratory/group/list',
    method: 'get',
    params: query
  })
}

// 查询安全准入资格详细
export function getGroup(id) {
  return request({
    url: '/laboratory/group/' + id,
    method: 'get'
  })
}

// 新增安全准入资格
export function addGroup(data) {
  return request({
    url: '/laboratory/group',
    method: 'post',
    data: data
  })
}

// 修改安全准入资格
export function updateGroup(data) {
  return request({
    url: '/laboratory/group',
    method: 'put',
    data: data
  })
}

// 查询实验室字典列表
export function filterSubjectDictList(data) {
  return request({
    url: '/laboratory/subject/getFilterSubjectDict',
    method: 'get',
    params: data
  })
}

// 查询审批记录列表
export function listApproval(query) {
  return request({
    url: '/laboratory/approval/list',
    method: 'get',
    params: query
  })
}

// 查询审批记录详细
export function getApproval(id) {
  return request({
    url: '/laboratory/approval/' + id,
    method: 'get'
  })
}

// 删除审批记录
export function delApproval(id) {
  return request({
    url: '/laboratory/approval/' + id,
    method: 'delete'
  })
}

// 新增审批记录
export function addApproval(data) {
  return request({
    url: '/laboratory/approval',
    method: 'post',
    data: data
  })
}

// 修改审批记录
export function updateApproval(data) {
  return request({
    url: '/laboratory/approval',
    method: 'put',
    data: data
  })
}

//查询审批列表
export function applyApproval(query) {
  return request({
    url: '/laboratory/apply/approval',
    method: 'get',
    params: query
  })
}

//安全准入审核列表接口
export function applyList(query) {
  return request({
    url: '/laboratory/apply/list',
    method: 'get',
    params: query
  })
}

// 查询危险源下拉列表
export function optionHazard(data) {
  return request({
    url: '/laboratory/hazard/queryOption',
    method: 'post',
    data: data
  })
}

//打包下载
export function downloadwBatch(data) {
  return request({
    url: '/laboratory/apply/downloadwBatch',
    method: 'post',
    data: data
  })
}

//安全准入详情接口
export function getDetails(query) {
  return request({
    url: '/laboratory/apply/getDetails',
    method: 'get',
    params: query
  })
}

//查询专业
export function majorListPower(query) {
  return request({
    url: '/system/major/listPower',
    method: 'get',
    params: query
  })
}

// 查询major列表
export function listMajorAll(query) {
  return request({
    url: '/system/major/listAll',
    method: 'get',
    params: query
  })
}

// 审批通过操作
export function submitApproval(data) {
  return request({
    url: '/laboratory/approval/appOperation',
    method: 'put',
    data: data
  })
}

// 审批不通过操作
export function failedApproval(data) {
  return request({
    url: '/laboratory/approval/failedOperation',
    method: 'put',
    data: data
  })
}

//获取实验室当前准入配置
export function materialApply(query) {
  return request({
    url: '/laboratory/apply/materialApply',
    method: 'get',
    params: query
  })
}

//安全准入提交接口
export function materialAdd(data) {
  return request({
    url: '/laboratory/apply/materialAdd',
    method: 'post',
    data: data
  })
}
//安全准入修改接口
export function materialUpdate(data) {
  return request({
    url: '/laboratory/apply/materialUpdate',
    method: 'post',
    data: data
  })
}

//根据名称查询导师
export function selectUserListByName(query) {
  return request({
    url: '/system/user/selectUserListByName',
    method: 'get',
    params: query
  })
}

// 查询实验室字典列表
export function subjectDictList(data) {
  return request({
    url: '/laboratory/subject/getSubjectDict',
    method: 'get',
    params: data
  })
}

// 查询个人安全准入办理列表
export function userAppRovallist(query) {
  return request({
    url: '/laboratory/approval/userAppRovallist',
    method: 'get',
    params: query
  })
}

// 通过实验室 查询对应的安全准入规则
export function securityBySubjectId(subjectId) {
  return request({
    url: '/laboratory/approval/querySecurityBySubjectId',
    method: 'post',
    data: {subjectId: subjectId}
  })
}

//查询申请记录列表
export function listapply(query) {
  return request({
    url: '/laboratory/apply/listapply',
    method: 'get',
    params: query
  })
}

// 删除审批记录
export function applyDelete(id) {
  return request({
    url: '/laboratory/apply/'+id,
    method: 'delete'
  })
}

// 查询学生信息列表
export function listStudentinfo(query) {
  return request({
    url: '/laboratory/studentinfo/list',
    method: 'get',
    params: query
  })
}
// 查询学生信息列表 -按审核类型
export function listStudentinfoByAudit(type) {
  return request({
    url: `/laboratory/studentinfo/list/${type}`,
    method: 'get'
  })
}
// 查询学生信息详细
export function getStudentinfo(joinStudentsId) {
  return request({
    url: '/laboratory/studentinfo/' + joinStudentsId,
    method: 'get'
  })
}
// 删除学生信息
export function delStudentinfo(joinStudentsId) {
  return request({
    url: '/laboratory/studentinfo/' + joinStudentsId,
    method: 'delete'
  })
}
// 新增学生信息
export function addStudentinfo(data) {
  return request({
    url: '/laboratory/studentinfo',
    method: 'post',
    data: data
  })
}
// 修改学生信息
export function updateStudentinfo(data) {
  return request({
    url: '/laboratory/studentinfo',
    method: 'put',
    data: data
  })
}

// 审核
export function auditStudentinfo(data,f) {
  let v = f==1?'success':'fail'
  return request({
    url: `/laboratory/studentinfo/audit/${v}`,
    method: 'put',
    data: data
  })
}

//新增白名单
export function whitelistAddList(data) {
  return request({
    url: '/laboratory/whitelist/addList',
    method: 'post',
    data:data
  })
}

//编辑白名单
export function whitelistEditList(data) {
  return request({
    url: '/laboratory/whitelist/editWhiteBySubJoin',
    method: 'put',
    data:data
  })
}

//新增准入实验室获取实验室列表
export function getAllSubjectByParame(query) {
  return request({
    url: '/laboratory/subject/getAllSubjectByParame',
    method: 'get',
    params: query
  })
}

// 新增白名单人员查询接口
export function whitelistSelectUserListByName(name) {
  return request({
    url: '/system/user/selectUserListByNotWhite?nickName='+name,
    method: 'get'
  })
}

//编辑 获取白名单用户的信息
export function whitelistEdit(name) {
  return request({
    url: '/laboratory/whitelist/'+name,
    method: 'get'
  })
}

//获取白名单列表
export function whitelistList(query) {
  return request({
    url: '/laboratory/whitelist/list',
    method: 'get',
    params: query
  })
}

//编辑 获取白名单实验室信息
export function whitelistSubListEdit(name) {
  return request({
    url: '/laboratory/whitelist/subList/'+name,
    method: 'get'
  })
}

//删除白名单
export function whitelistDel(id) {
  return request({
    url: '/laboratory/whitelist/'+id,
    method: 'post'
  })
}
