import request from '@/utils/ajax'

export function uploadBuildingExcel(query) {
  return new Promise((resolve, reject) => {
    request({
      url: '/building/uploadExcel',
      method: 'post',
      data: query
    }).then((res) => {
      console.log('out')
      resolve(res)
    }).catch((err) => {
      console.log(err)
    })
  })
}

export function submitBuildingExcel(query) {
  return new Promise((resolve, reject) => {
    request({
      url: '/building/submitExcel',
      method: 'post',
      data: query
    }).then((res) => {
      console.log('out')
      resolve(res)
    }).catch((err) => {
      console.log(err)
    })
  })
}

export function uploadBuildingTreeExcel(query) {
  return new Promise((resolve, reject) => {
    request({
      url: '/tree/uploadExcel',
      method: 'post',
      data: query
    }).then((res) => {
      console.log('out')
      resolve(res)
    }).catch((err) => {
      console.log(err)
    })
  })
}

export function submitBuildingTreeExcel(query) {
  return new Promise((resolve, reject) => {
    request({
      url: '/tree/submitExcel',
      method: 'post',
      data: query
    }).then((res) => {
      console.log('out')
      resolve(res)
    }).catch((err) => {
      console.log(err)
    })
  })
}
