import request from '@/router/axios';

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

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

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

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

export const update = (row) => {
  return request({
    url: '/api/blade-manager/exceltab/submit',
    method: 'post',
    data: row
  })
}
//获取参数信息

export const checkParamElement = (params) => {
  return request({
    url: '/api/blade-manager/exceltab/checkParamElement',
    method: 'get',
    params:params
  })
}

//查看模板信息
export const getExcelInfo = (params) => {
  return request({
    url: '/api/blade-manager/exceltab/templateDetail',
    method: 'get',
    params:params
  })
}

//获取在线表格json
export const getExcelJson = (form) => {
  return request({
    url: '/api/blade-user/excel-table/getExcelUrl',
    method: 'post',
    data:form
  })
}
//保存在线表格json
export const saveExcelJson = (form) => {
  return request({
    url: '/api/blade-user/excel-table/saveExcel',
    method: 'post',
    data:form
  })
}
//预览pdf
export const getExcelPdf= (form) => {
  return request({
    url: '/api/blade-manager/exceltab/get-excel-pdf',
    method: 'post',
    data:form
  })
}
export const getTempExcelFileUrl= (form) => {
  return request({
    url: '/api/blade-user/excel-table/getTempExcelFileUrl',
    method: 'post',
    data:form
  })
}

//查看清表模板下的表格
export const getWbsTreeExcelTab = (params) => {
  return request({
    url: '/api/blade-manager/exceltab/getWbsTreeExcelTab',
    method: 'get',
    params:params
  })
}

// 批量保存表单
export const saveBatchWbsTree= (form) => {
  return request({
    url: '/api/blade-manager/wbsTree/saveBatchWbsTree',
    method: 'post',
    data:form
  })
}
