import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) export default new Vuex.Store({ state: { selAttr: { visa: false, type: "", id: "", value: "" }, maptool: false, headerIndex: 0, parentCompany: true, companyId: '', mapMenu: "分公司", lineName: '411' }, mutations: { SET_SelAttr: (state, selAttr) => { state.selAttr = selAttr }, SET_Maptool: (state, maptool) => { state.maptool = maptool }, SET_MapMenu: (state, mapMenu) => { state.mapMenu = mapMenu }, SET_HeaderIndex: (state, headerIndex) => { state.headerIndex = headerIndex }, SET_ParentCompany: (state, parentCompany) => { state.parentCompany = parentCompany }, SET_CompanyId: (state, companyId) => { state.companyId = companyId }, SET_LineName: (state, lineName) => { state.lineName = lineName }, }, actions: { setSelAttr({ commit }, selAttr) { commit('SET_SelAttr', selAttr) }, setMaptool({ commit }, maptool) { commit('SET_Maptool', maptool) }, setMapMenu({ commit }, mapMenu) { commit('SET_MapMenu', mapMenu) }, setLineName({ commit }, lineName) { commit('SET_LineName', lineName) }, } })