import req from '@/request'

const portal = window.context.portal

export function getTree() {
  return new Promise((resolve, reject) => {
    req.get(portal + `/uc/org/into/roadTree`)
      .then(res => resolve(res?.data || []))
      .catch(err => reject(err))
  })
}

export function orgTree() {
  return new Promise((resolve, reject) => {
    req.get(portal + `/uc/org/into/orgTree`)
      .then(res => resolve(res?.data || []))
      .catch(err => reject(err))
  })
}

export function getRoadTree() {
  return new Promise((resolve, reject) => {
    req.get(portal + `/uc/org/roadTree`)
      .then(res => resolve(res?.data || []))
      .catch(err => reject(err))
  })
}