import Vue from 'vue'
import Vuex from 'vuex'
import Mock from 'mockjs';//es6语法引入mock模块
import classMgmt from './module/classMgmt';
import talMgmt from './module/talMgmt';
import authorization from './module/authorization';
import totalAnalysis from './module/totalAnalysis';

Vue.use(Vuex)

// TYPES
const MAIN_SET_COUNTER = 'MAIN_SET_COUNTER'


// MUTATIONS
const mutations = {
  [MAIN_SET_COUNTER](state, obj) {
    state.counter = obj.counter
  }
}

// ACTIONS
const actions = ({
  setCounter({ commit }, obj) {
    commit(MAIN_SET_COUNTER, obj)
  }
})

const getters = {
  radarData: state => state.totalAnalysis.radarData
}


export default new Vuex.Store({
  mutations,
  actions,
  getters,
  state: {
    //选择关注年级
    selectgrade: [],
    //选择关注学期
    selectterm: [],
    //选择某次考试
    selectexam: {},
    //基础数据
    basicsdata: {},
    //柱状图
    zhuxhuang: {},
    //雷达图
    leida: {},
    //饼图
    pie: {},
     //折线图（大）
    linechart: {},
    //考试类型选择
    examtype: {},

    //文理科展现
    wenli_show: true,

    //任教老师页面
    //选择数据对比
    selectcontrast: [],
    //柱状图
    barline: {},
    //大饼图
    annulus: {},
    //PR
    accuracyPR: {},

    periodList: []
  },
  modules: {
    classMgmt,
    talMgmt,
    authorization,
    totalAnalysis
  }
})
