import request from '@/utils/request'

//团队管理

//获取用户可以查看的组织树
export function getOrganization() {
  return request({
    url: request.apiModule.authority + '/organize/child/tree',
    method: 'get'
  })
}

//获取组织的角色信息
export function getOrganizeRole(data) {
  return request({
    url: request.apiModule.authority + '/organize/role',
    method: 'get',
    params: data
  })
}

//获取组织下的用户
export function getUers(data) {
  return request({
    url: request.apiModule.authority + '/users/organize/page',
    method: 'get',
    params: data
  })
}

//新增或修改组织关联
export function postUserOrganize(data) {
  return request({
    url: request.apiModule.authority + '/organize/userorganize',
    method: 'post',
    data
  })
}

//新增或修改部门
export function postOrganize(data) {
  return request({
    url: request.apiModule.authority + '/organize',
    method: 'post',
    data
  })
}

//将用户从组织中移出
export function deleteOrganizeRole(data) {
  return request({
    url: request.apiModule.authority + '/organize/userorganize',
    method: 'delete',
    data
  })
}

//添加组员
export function postMember(data) {
  return request({
    url: request.apiModule.authority + '/organize/member',
    method: 'post',
    data
  })
}
