import { eLevel } from '@/types/level'
import { Module } from 'vuex'
import {
  eAddManagerModalMode,
  eTypeOfOperatedObject,
  iUserManagementState,
} from './types'

export default <Module<iUserManagementState, {}>>{
  namespaced: true,
  state: {
    refreshMark: NaN,
    modalShow: false,
    modalMode: eAddManagerModalMode.create,
    typeOfOperatedObject: eTypeOfOperatedObject.manager,
    searchLevel: eLevel.secondary_branch,
    branchDetailMsg: {
      // fb: 'zhejiang',
      // fb_id: 1,
      // sb: 'hz',
      // sb_id: 1,
    },
    personalMsg: {
      name: '',
      uid: '',
      phone: '',
      branchDetailMsg: {},
      address: '',
    },
    address: '',
  },
  mutations: {
    save(state, payload) {
      Object.assign(state, payload)
    },
  },
  actions: {},
}
