import { get, uget, post, upost } from '@/http/index'
import myAxios from '@/http/axios'

// 查询部门列表
export const listDept = async (data) => {
  return await get('/system/dept/list', data)
}

// 查询部门列表（排除节点）
export const listDeptExcludeChild = async (data) => {
  return await uget('/system/dept/list/exclude/', data)
}

// 查询部门详细
export const getDept = async (data) => {
  return await uget('/system/dept/', data)
}

// 新增部门
export const addDept = async (data) => {
  return await post('/system/dept', data)
}

// 修改部门
export function updateDept(data) {
  return myAxios({
    url: '/system/dept',
    method: 'put',
    data: data
  })
}

// 删除部门
export function delDept(deptId) {
  return myAxios({
    url: '/system/dept/' + deptId,
    method: 'delete'
  })
}
