import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const moduleSocket = {
  state: {
    socketObj: null,
    onMessageCallback: null,
  },
}
const moduleBaseInfo = {
  state: {
    decLevels: null,
    empLevels: null,
    adminRoles: null,
    menu: null,
    daysDiff: null,
  },
}

const  moduleRegionInfo = {
  state: {
    provinceAndCityData: [],
    regionData: [],
    provinceAndCityDataPlus: [],
    regionDataPlus: [],
    CodeToText: {
      '': null,
    },
    TextToCode: {},
  }
}

export default new Vuex.Store({
  modules: {
    socket: moduleSocket,
    baseInfo: moduleBaseInfo,
    regionInfo: moduleRegionInfo,
  }
})