const state = { search: '', isSearchOfPartnerCustomer: 0, isSearchOfPartnerAll: 0, defaultNav: '' // 记录销售页nav切换时,路由名 } const getters = { searchValue (state) { return state.search }, isSearchOfPartnerCustomer (state) { return state.isSearchOfPartnerCustomer }, isSearchOfPartnerAll (state) { return state.isSearchOfPartnerAll }, defaultNav (state) { return state.defaultNav } } const actions = { setSearchValue ({ commit }, value) { commit('UPDATE_SEARCH_VALUE', value) }, setIsSearchOfPartnerCustomer ({ commit }, value) { commit('UPDATE_ISSEARCHOFPARTNERCUSTOMER_VALUE', value) }, setIsSearchOfPartnerAll ({ commit }, value) { commit('UPDATE_ISSEARCHOFPARTNERALL_VALUE', value) }, setDefaultNav ({ commit }, value) { commit('UPDATE_DEFAULTNAV_VALUE', value) } } const mutations = { UPDATE_SEARCH_VALUE (state, value) { state.search = value }, UPDATE_ISSEARCHOFPARTNERCUSTOMER_VALUE (state, value) { state.isSearchOfPartnerCustomer = value }, UPDATE_ISSEARCHOFPARTNERALL_VALUE (state, value) { state.isSearchOfPartnerAll = value }, UPDATE_DEFAULTNAV_VALUE (state, value) { state.defaultNav = value } } export default { namespaced: true, state, getters, actions, mutations }