import request from '@/utils/request'

// 获取部门
const getMyDeptList = () => {
    return request({
        url: '/publics/deptList',
        method: 'get'
    })
}
// 查询部门下拉树结构
const getDeptTree = () => {
    return request({
      url: '/publics/deptTree',
      method: 'get'
    })
}
// 查询子公司列表
const getZgsDeptList = () => {
    return request({
      url: '/publics/queryZgsDeptList',
      method: 'get'
    })
}
// 获取项目
const getProjectList = () => {
    return request({
        url: '/publics/projectList',
        method: 'get'
    })
}

// 获取所有项目
const getProjectAllList = () => {
    return request({
        url: '/publics/projectAllList',
        method: 'get'
    })
}

// 获取和我相关的项目信息
const getMyProjectList = () => {
    return request({
        url: '/publics/findMyProjectList',
        method: 'get'
    })
}
// 获取人员
const getUserList = (data) => {
    return request({
        url: '/publics/userList',
        method: 'get',
        params: data
    })
}

// 查询项目部门信息
const queryUnitList = (query) => {
    return request({
      url: '/publics/queryUnitList',
      method: 'get',
      params: query
    })
}

// 查询项目部门信息
const queryAllUnitList = (projId,unitType) => {
    return request({
      url: '/publics/queryAllUnitList/'+projId+'/'+unitType,
      method: 'get'
    })
}

const selectProjectAllUnitUser = (query) => {
    return request({
      url: '/publics/selectProjectAllUnitUser',
      method: 'get',
      params: query
    })
}

const selectProjectUnitUser = (query) => {
    return request({
      url: '/publics/selectProjectUnitUser',
      method: 'get',
      params: query
    })
}

const selectProjectAuditinfo = (query) => {
    return request({
      url: '/publics/selectProjectAuditinfo',
      method: 'get',
      params: query
    })
}

const findAttendanceCfgList = (query) =>{
    return request({
        url: '/publics/findAttendanceCfgList',
        method: 'get',
        params: query
      })
}

export function findMyTask(){
    return request({
      url: '/publics/findTask',
      method: 'get'
    })
}

export default{
    getMyDeptList,
    getDeptTree,
    getZgsDeptList,
    getProjectList,
    getProjectAllList,
    getMyProjectList,
    getUserList,
    queryUnitList,
    queryAllUnitList,
    selectProjectAllUnitUser,
    selectProjectUnitUser,
    selectProjectAuditinfo,
    findAttendanceCfgList
}

