import request from '@/utils/request'

// 查询参数包列表
export function listParabar(query) {
  return request({
    url: '/business/parabar/list',
    method: 'get',
    params: query
  })
}

export function listParabarDetail(query) {
  return request({
    url: '/business/parabar/parabarDetailList',
    method: 'get',
    params: query
  })
}

// 更新状态
export  function changeParaStatus(id, status){
  const data = {
    id,
    status
  }
  return request({
    url: '/business/parabar/changeStatus',
    method: 'put',
    data: data
  })
}

// 获取关联梯型
export function getRelatedModelList(query) {
  return request({
    url: '/business/parabar/relatedModelList',
    method: 'get',
    params: query
  })
}

// 获取关联梯形的共同参数
export function getCommmonPara(query) {
  return request({
    url: '/business/parabar/commonParaList',
    method: 'get',
    params: query
  })
}

// 获取关联梯形的共同参数以及下拉框选项
export function getCommmonParaAndItem(query) {
  return request({
    url: '/business/parabar/commonParaAndItemList',
    method: 'get',
    params: query
  })
}

// 查询参数包详细
export function getParabar(id) {
  return request({
    url: '/business/parabar/' + id,
    method: 'get'
  })
}

// 新增参数包
export function addParabar(data) {
  return request({
    url: '/business/parabar',
    method: 'post',
    data: data
  })
}

// 修改参数包
export function updateParabar(data) {
  return request({
    url: '/business/parabar',
    method: 'put',
    data: data
  })
}

// 删除参数包
export function delParabar(id) {
  return request({
    url: '/business/parabar/' + id,
    method: 'delete'
  })
}
