import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/blade-manager/wbsInfo/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/blade-manager/wbsInfo/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/blade-manager/wbsInfo/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/blade-manager/wbsInfo/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/blade-manager/wbsInfo/submit',
    method: 'post',
    data: row
  })
}

//元素库、独立库节点排序
export const wbsInfotabSort = (primaryKeyIds) => {
  return request({
      url: '/api/blade-manager/wbsInfo/tab-sort',
      method: 'post',
      params: {
        primaryKeyIds,
      }
  })
}

//获取1质检 2实验公有树列表
export const getWbsList = (type) => {
  return request({
      url: '/api/blade-manager/wbsInfo/get-wbs-type',
      method: 'get',
      params: {
        type
      }
  })
}

export const sortWbs = (obj) => {
    return request({
        url: '/api/blade-manager/wbsInfo/sort',
        method: 'post',
        data: obj
    })
}

