import request from '@/utils/request'

// 查询用户列表http://192.168.31.230:6209/api/v3/employees
export function listUsers(query) {
  return request({
    url: '/api/v3/employees',
    method: 'get',
    params: query
  })
}
// 获取组织员工列表http://192.168.31.230:6209/api/v3/departments/employees?deptID=10
export function getDeptListUsers(query) {
  return request({
    url: '/api/v3/departments/employees',
    method: 'get',
    params: query
  })
}

// 添加组织   http://192.168.31.230:6209/api/v1/departments/{deptID}/children/batch
export function departments(data, id) {
  return request({
    url: '/api/v3/departments/' + id + '/children/batch',
    method: 'post',
    data: data
  })
}
// 删除组织   http://192.168.31.230:6209/api/v1/departments/:deptID
export function delDepartments(id) {
  return request({
    url: '/api/v3/departments/' + id,
    method: 'delete'
  })
}

// 点击子级组织   http://192.168.31.230:6209/api/v1/departments/:parentDeptID/children/batch
export function addDepartments(data, id) {
  return request({
    url: '/api/v3/departments/' + id + '/children/batch',
    method: 'post',
    data: data
  })
}
// departments
// 删除组织   http://192.168.31.230:6209/api/v1/departments
export function editDepartments(data,id) {
  return request({
    url: '/api/v3/departments/'+id,
    method: 'put',
    data: data
  })
}
