organization.ts 815 B

1234567891011121314151617181920212223242526272829303132
  1. import {organizationState} from "~/types/types";
  2. export const state = () => ({
  3. name: '',
  4. product: '',
  5. modules: [],
  6. hasChildren: false
  7. })
  8. export const mutations = {
  9. setName(state:organizationState, name:string){
  10. state.name = name
  11. },
  12. setProduct(state:organizationState, product:string){
  13. state.product = product
  14. },
  15. setModules(state:organizationState, modules:Array<string>) {
  16. state.modules = modules
  17. },
  18. setHasChildren(state:organizationState, hasChildren:boolean) {
  19. state.hasChildren = hasChildren
  20. }
  21. }
  22. export const actions = {
  23. setProfile(context:any, profile:any){
  24. context.commit('setName', profile.name)
  25. context.commit('setProduct', profile.product)
  26. context.commit('setModules', profile.modules)
  27. context.commit('setHasChildren', profile.hasChildren)
  28. }
  29. }