import axios from '@/libs/api.request'

export const getTableData = (searchinfo,url) => {
 console.log("searchinfo...................")
 console.log(searchinfo)
  return axios.request({
    url: url,
    data:searchinfo,
    method: 'post'
  })
}

export const create = (url,entity) => {
   return axios.request({
     url: url,
     data:entity,
     method: 'post'
   })
 }

 export const update = (url,entity) => {
   return axios.request({
     url: url,
     data:entity,
     method: 'post'
   })
 }

 export const deleteByIds = (url,parray) => {
  return axios.request({
    url: url,
    data:parray,
    method: 'post'
  })
}



export const getDragList = () => {
  return axios.request({
    url: 'get_drag_list',
    method: 'get'
  })
}

export const errorReq = () => {
  return axios.request({
    url: 'error_url',
    method: 'post'
  })
}

export const saveErrorLogger = info => {
  return axios.request({
    url: 'save_error_logger',
    data: info,
    method: 'post'
  })
}

export const uploadImg = formData => {
  return axios.request({
    url: 'image/upload',
    data: formData
  })
}

export const getOrgData = () => {
  return axios.request({
    url: 'get_org_data',
    method: 'get'
  })
}

export const getTreeSelectData = () => {
  return axios.request({
    url: 'get_tree_select_data',
    method: 'get'
  })
}
