import request from '@/utils/request'

// 查询仪器列列表
export function listInstrument(query) {
  return request({
    url: '/system/instrument/list',
    method: 'get',
    params: query
  })
}

// 查询仪器列详细
export function getInstrument(id) {
  return request({
    url: '/system/instrument/' + id,
    method: 'get'
  })
}

// 新增仪器列
export function addInstrument(data) {
  return request({
    url: '/system/instrument',
    method: 'post',
    data: data
  })
}

// 修改仪器列
export function updateInstrument(data) {
  return request({
    url: '/system/instrument',
    method: 'put',
    data: data
  })
}

// 删除仪器列
export function delInstrument(id) {
  return request({
    url: '/system/instrument/' + id,
    method: 'delete'
  })
}

/* 获取小程序标签树 */
export function getMiniProgramTagTree() {
  return request({
    url: '/system/tagInfo/tagTree',
    method: 'get',
    params: {
      type: 1
    }
  })
}

/* 获取外部标签树 */
export function getWecomTagTree() {
  return request({
    url: '/system/tagInfo/tagTree',
    method: 'get',
    params: {
      type: 2
    }
  })
}

// 查询仪器关联正品控产品名列表
export function listRelate(query) {
  return request({
    url: '/system/instrumentRelateName/list',
    method: 'get',
    params: query
  })
}

// 新增仪器关联正品控产品名
export function addRelate(data) {
  return request({
    url: '/system/instrumentRelateName',
    method: 'post',
    data: data
  })
}

// 修改仪器关联正品控产品名
export function updateRelate(data) {
  return request({
    url: '/system/instrumentRelateName',
    method: 'put',
    data: data
  })
}

// 删除仪器关联正品控产品名
export function delRelate(id) {
  return request({
    url: '/system/instrumentRelateName/' + id,
    method: 'delete'
  })
}

// 查询仪器说明书列表
export function listInstructions(query) {
  return request({
    url: '/system/instructions/list',
    method: 'get',
    params: query
  })
}

// 新增仪器说明书
export function addInstructions(data) {
  return request({
    url: '/system/instructions',
    method: 'post',
    data: data
  })
}

// 修改仪器说明书
export function updateInstructions(data) {
  return request({
    url: '/system/instructions',
    method: 'put',
    data: data
  })
}

// 删除仪器说明书
export function delInstructions(id) {
  return request({
    url: '/system/instructions/' + id,
    method: 'delete'
  })
}

export function listAllMode(query) {
  return request({
    url: '/system/mode/listAll',
    method: 'get',
    params: query
  })
}


// 新增仪器标签关联
export function addInstrumentTag(data) {
  return request({
    url: '/system/instrumentTag/add',
    method: 'post',
    data: data
  })
}

// 查询仪器标签关联列表
export function listInstrumentTag(query) {
  return request({
    url: '/system/instrumentTag/list',
    method: 'get',
    params: query
  })
}
