import request from '@/utils/request'

// 查询故障码数据列表
export function listTrouble(data) {
  return request({
    url: '/business/trouble/troubleList',
    method: 'post',
    data: data
  })
}

// 查询故障类型
export function getTroubleType() {
  return request({
    url: '/business/trouble/troubleTypeList',
    method: 'get'
  })
}

// 查询故障等级
export function getTroubleGrade() {
  return request({
    url: '/business/trouble/troubleGradeList',
    method: 'get'
  })
}

// 添加故障码数据
export function getAddTrouble(data) {
  return request({
    url: '/business/trouble/insertTrouble',
    method: 'post',
    data: data
  })
}

// 修改故障码数据信息
export function getUpdateTrouble(data) {
  return request({
    url: '/business/trouble/updateTrouble',
    method: 'post',
    data: data
  })
}

// 删除故障码数据信息
export function getDelTrouble(troubleId) {
  return request({
    url: '/business/trouble/remove/' + troubleId,
    method: 'get'
  })
}
