const state = {
    organizations: []
}

const mutations = {
    setOrganizations(state, organizations) {
        state.organizations = organizations
    }
}

const actions = {
    fetchOrganizations({ commit }) {
        // 模拟API调用
        const organizations = [
            { id: 1, name: 'Organization 1' },
            { id: 2, name: 'Organization 2' }
        ]
        commit('setOrganizations', organizations)
    }
}

const getters = {
    allOrganizations: state => state.organizations
}

export default {
    namespaced: true,
    state,
    mutations,
    actions,
    getters
}
