import request from '@/utils/request'

// 查询违规记录列表
export function listViolation(query) {
  return request({
    url: '/laboratory/violation/list',
    method: 'get',
    params: query
  })
}

// 查询违规记录详细
export function getViolation(id) {
  return request({
    url: '/laboratory/violation/' + id,
    method: 'get'
  })
}

// 查询违规记录详细-工作台用
export function getViolationDetail(id) {
  return request({
    url: '/laboratory/violation/'+id+'/detail',
    method: 'get'
  })
}

// 新增违规记录
export function addViolation(data) {
  return request({
    url: '/laboratory/violation',
    method: 'post',
    data: data
  })
}

// 修改违规记录
export function updateViolation(data) {
  return request({
    url: '/laboratory/violation',
    method: 'put',
    data: data
  })
}

// 删除违规记录
export function delViolation(id) {
  return request({
    url: '/laboratory/violation/' + id,
    method: 'delete'
  })
}

//加入黑名单
export function joinBlackList(id) {
  return request({
    url: '/laboratory/violation/joinBlackList/'+id,
    method: 'post'
  })
}


// 查询个人违规记录列表
export function myListViolation(query) {
  return request({
    url: '/laboratory/violation/myListViolation',
    method: 'get',
    params: query
  })
}
// 查询违规记录详情列表
export function violationHistoryRecord(query) {
  return request({
    url: '/laboratory/violationHistoryRecord/list',
    method: 'get',
    params: query
  })
}

// 查询学期
export function getSemesterList(query) {
  return request({
    url: '/laboratory/semester/getSemesterList',
    method: 'get',
    params: query
  })
}

// 查询学期
export function getByIdlist(query) {
  return request({
    url: '/laboratory/violationHistoryRecord/byIdlist',
    method: 'get',
    params: query
  })
}

//移除黑名单
export function delBlacklist(data) {
  return request({
    url: '/laboratory/violation/delBlacklistByPc',
    method: 'post',
    data: data
  })
}

//移除负面清单
export function delNegivelist(data) {
  return request({
    url: '/laboratory/violation/delNegivelistByPc',
    method: 'post',
    data: data
  })
}

//获取违规类型
export function violationSiteType(query) {
  return request({
    url: '/laboratory/violationSite/type',
    method: 'get',
    params: query
  })
}

//添加违规记录
export function addViolationHistory(data) {
  return request({
    url: '/laboratory/violation/addViolationHistory',
    method: 'post',
    data: data
  })
}

//添加黑名单
export function blackAdd(data) {
  return request({
    url: '/laboratory/violation/blackAdd',
    method: 'post',
    data: data
  })
}

//根据输入值查询除法方式
export function getIntegralMatchingRules(query) {
  return request({
    url: '/laboratory/violation/getIntegralMatchingRules',
    method: 'get',
    params: query
  })
}

// 根据院系ID查询实验室列表(无权限)
export function getSubjectDictByViolation(data) {
  return request({
    url: '/laboratory/subject/getSubjectDictByViolation',
    method: 'get',
    params: data
  })
}
