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

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    $x_user: null, // 用户信息
    $x_factoryList: null, // 电厂列表
    $x_factory: null, // 当前选择的电厂信息
    $x_crew: null, // 当前选择的机组信息
    $x_allData: [], // 所有测点数据
  },
  mutations: {
    user(state, data) {
      state.$x_user = data;
    },
    factoryList(state, data) {
      state.$x_factoryList = data;
    },
    factory(state, data) {
      state.$x_factory = data;
    },
    crew(state, data) {
      state.$x_crew = data;
    },
    allData(state, data) {
      state.$x_allData = data;
    },
  },
  actions: {},
  modules: {}
})
