/*
 * @Author: your name
 * @Date: 2021-04-27 11:30:49
 * @LastEditTime: 2021-05-05 21:36:49
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /react-antd-admin-template/src/api/groupManage.js
 */


import request from '@/utils/request'

export function getGroupIdentityList(data) {
  return request({
    url: '/sysDeptClass/list',
    method: 'get',
    params:{...data}
  })
}

export function addGroupIdentity(data) {
    return request({
      url: '/sysDeptClass/addDeptClass',
      method: 'post',
      data
    })
}

export function delGroupIdentity(data) {
    return request({
      url: '/sysDeptClass/delDeptClass',
      method: 'post',
      data
    })
}

export function editGroupIdentity(data) {
    return request({
      url: '/sysDeptClass/editDeptClass',
      method: 'post',
      data
    })
}

export function bindGroup(data) {
    return request({
      url: '/sysDepartment/bindDepartmentAndDeptClass',
      method: 'post',
      data
    })
}

//以单位为准添加单位和职工（人员）中间表
export function groupBindPerson(data) {
    return request({
      url: '/sysDepartment/bindEmpAndDept',
      method: 'post',
      data
    })
}

//追踪条件列表不分页
export function conditionList() {
    return request({
      url: '/sysFilterCondition/listAll',
      method: 'get'
    })
}

//获取所有查核点用于中间表选择
export function getCheckPointList() {
  return request({
    url: '/checkPoint/listAll',
    method: 'get'
  })
}

//以单位为准添加单位和查核点关系
export function groupBindCheckPoint(data) {
  return request({
    url: '/sysDepartment/bindDeptAndCheckPoint',
    method: 'post',
    data
  })
}

//人员列表不分页
export function getPersonList() {
    return request({
      url: '/employee/listAll',
      method: 'get'
    })
}

//单位分类绑定条件
export function groupIdentityBindCondition(data) {
    return request({
      url: '/sysDeptClass/bindDeptClassAndFilterCondition',
      method: 'post',
      data
    })
}


//获取所有列表不分页，用户中间表选择
export function listAll() {
    return request({
      url: '/sysDepartment/listAll',
      method: 'get',
    })
}

//单位列表
export function getGroupManaList(data) {
    return request({
      url: '/sysDepartment/list',
      method: 'get',
      params:{...data}
    })
}

export function addGroupMana(data) {
    return request({
      url: '/sysDepartment/addDepartment',
      method: 'post',
      data
    })
}

export function editGroupMana(data) {
    return request({
      url: '/sysDepartment/editDepartment',
      method: 'post',
      data
    })
}

export function delGroupMana(data) {
    return request({
      url: '/sysDepartment/delDepartment',
      method: 'post',
      data
    })
}

//新增单位时候选择管理员列表
export function getDeptManager() {
  return request({
    url: '/employee/getDeptManager',
    method: 'get'
  })
}

//单位分类和单位关系列表分页
export function getDeptClassDeptPage(data) {
  return request({
    url: '/sysDeptClass/deptClassDeptPage',
    method: 'get',
    params:{...data}
  })
}

//删除单位分类和单位关系
export function delDeptClassDeptPage(data) {
  return request({
    url: '/sysDeptClass/delDeptClassDept',
    method: 'post',
    data
  })
}

