import {UserVO} from "@/api/system/user/types";

export const useAllUserStore = defineStore('allUser', () => {
    const state = reactive({
        allUser: [] as UserVO[],
        isIncludeResign: false,
        allDept: [],
        allCompany: [],
    });

    const setIsIncludeResign = (isIncludeResign: boolean)=>{
        state.isIncludeResign = isIncludeResign
    }
    const setUser = (userList: UserVO[])=>{
        state.allUser = userList
    }
    const getIsIncludeResign = ()=>{
        return state.isIncludeResign
    }
    const getUser = ()=>{
        return state.allUser
    }
    const clearUser = ()=>{
        return state.allUser = []
    }

    const setAllDept = (deptList: any[])=>{
        state.allDept = deptList
    }
    const getAllDept = ()=>{
        return state.allDept
    }
    const clearAllDept = ()=>{
        state.allDept = []
    }
    const setAllCompany = (companyList: any[])=>{
        state.allCompany = companyList
    }

    const getAllCompany = ()=>{
        return state.allCompany
    }

    const clearAllCompany = ()=>{
        state.allCompany = []
    }


    return {
        state,
        setUser,
        getUser,
        clearUser,
        setIsIncludeResign,
        getIsIncludeResign,
        setAllDept,
        getAllDept,
        clearAllDept,
        setAllCompany,
        getAllCompany,
        clearAllCompany,
    };
});

export default useAllUserStore;
