business.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. const state = {
  2. search: '',
  3. isSearchOfPartnerCustomer: 0,
  4. isSearchOfPartnerAll: 0,
  5. defaultNav: '' // 记录销售页nav切换时,路由名
  6. }
  7. const getters = {
  8. searchValue (state) {
  9. return state.search
  10. },
  11. isSearchOfPartnerCustomer (state) {
  12. return state.isSearchOfPartnerCustomer
  13. },
  14. isSearchOfPartnerAll (state) {
  15. return state.isSearchOfPartnerAll
  16. },
  17. defaultNav (state) {
  18. return state.defaultNav
  19. }
  20. }
  21. const actions = {
  22. setSearchValue ({ commit }, value) {
  23. commit('UPDATE_SEARCH_VALUE', value)
  24. },
  25. setIsSearchOfPartnerCustomer ({ commit }, value) {
  26. commit('UPDATE_ISSEARCHOFPARTNERCUSTOMER_VALUE', value)
  27. },
  28. setIsSearchOfPartnerAll ({ commit }, value) {
  29. commit('UPDATE_ISSEARCHOFPARTNERALL_VALUE', value)
  30. },
  31. setDefaultNav ({ commit }, value) {
  32. commit('UPDATE_DEFAULTNAV_VALUE', value)
  33. }
  34. }
  35. const mutations = {
  36. UPDATE_SEARCH_VALUE (state, value) {
  37. state.search = value
  38. },
  39. UPDATE_ISSEARCHOFPARTNERCUSTOMER_VALUE (state, value) {
  40. state.isSearchOfPartnerCustomer = value
  41. },
  42. UPDATE_ISSEARCHOFPARTNERALL_VALUE (state, value) {
  43. state.isSearchOfPartnerAll = value
  44. },
  45. UPDATE_DEFAULTNAV_VALUE (state, value) {
  46. state.defaultNav = value
  47. }
  48. }
  49. export default {
  50. namespaced: true,
  51. state,
  52. getters,
  53. actions,
  54. mutations
  55. }