import Vue from 'vue' import Vuex from 'vuex' import { getStore } from "@/utils/store"; // import * as getters from './getters' // // 公共数据 // import common from './modules/common' // // 用户数据 // import user from './modules/user' // // TODO // // 组织机构 // import organize from '../service/organize/organize' // // 字典 // import dictionary from '../service/dictionary/dictionary' Vue.use(Vuex) export default new Vuex.Store({ state: { LOADING: false, // loading背景 loadBg: false, // 用户信息 userInfo: {}, // 项目名 pName: getStore({'name':'projectName','type':'','debug':''}) || '', // 项目id pid: getStore({'name':'projectId','type':'','debug':''}) || '', }, mutations: { showLoading(state,bol) { state.LOADING = true state.loadBg = bol }, hideLoading(state) { state.LOADING = false }, changeProgect(state, pyload) { state.pid = pyload.id state.pName = pyload.name }, setUserInfo(state, pyload) { state.userInfo = pyload } } })