import axios from '@/libs/api.request'

// 获取日常人员列表
export const getDmUserList = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyDmUser/selectList',
    method: 'post',
    data: param
  })
}

// 根据机构编码同步本级及下属机构用户（存在则更新、不存在则新增；null 不覆盖）
export const syncDmUsersByOffice = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyDmUser/syncByOffice',
    method: 'post',
    data: param
  })
}

// 保存单个日常人员（前端编辑后保存）
export const saveDmUser = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyDmUser/save',
    method: 'post',
    data: param
  })
}

// 获取人员选择器列表（根据机构和权限过滤）
export const getUserSelectorList = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyDmUser/selectUserSelectorList',
    method: 'post',
    data: param
  })
}

// 分页查询日常人员可选上级部门列表
export const dmUserOffice = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyDmUser/dmUserOffice',
    method: 'post',
    data: param
  })
}

export const getUserTypeList = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyDmUserCategory/selectList',

  })
}
// 获取人员多选器列表（所有在职人员）
export const getUserMultiSelectorList = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyDmUser/selectUserMultiSelectorList',
    method: 'post',
    data: param
  })
}
