
const pastRoute = {
  state: {
	   tabStyle: 'vehicle',//vehicle personnel
	   pastRouteParams: {},//历史轨迹查询参数
       vehStopArr:null,  //停车记录列表
       veAlarmArr: null, //轨迹车辆报警信息列表
	    trackRecordArr: [], //当前查询的轨迹数据
		params: {}, //带参
		mapImg: '', //地图图标
		
  },

  mutations: {
	   SET_REAL_DATA: (state, {key,data}) => {
			state[key] = data
	   },
       setVehStopArr:(state, {key,data}) => {
            state[key] = data
       },
       setVeAlarm:(state, {key,data}) => {
        state[key] = data
    }
  },

  actions: {
	 setTrackRecordArr({ commit, state }, data) {
		 commit('SET_REAL_DATA', {key: 'trackRecordArr',data},)
	 },
     setVehStopArr({ commit, state }, data) {
        commit('setVehStopArr', {key: 'vehStopArr',data},)
     },
     setVeAlarm({ commit, state }, data) {
        commit('setVeAlarm', {key: 'veAlarmArr',data},)
     },
	 setTabStyle({ commit, state }, data) {	 
	 	commit('SET_REAL_DATA', {key: 'tabStyle',data},)
	 },
	 setParams({ commit, state }, data) {	 
	 	commit('SET_REAL_DATA', {key: 'params',data},)	 
	 }, 
	 setPastRouteParams({ commit, state }, data) {	 
        console.log('保存查询记录',data)
	 	commit('SET_REAL_DATA', {key: 'pastRouteParams',data},)	 
	 },
	 setMapImg({ commit, state }, data) {	 
	 	commit('SET_REAL_DATA', {key: 'mapImg',data},)	 
	 },
  }
}

export default pastRoute
