export default {
	state: {
		selectInfo: {} //选择商品信息  用页面pageType当key  查询对应模块选择的商品列表
	},
	getters: {
		getSelectInfo(state) {
			return state.selectInfo || {};
		}
	},
	actions: {
		/**
		 * 设置不同类别选中商品列表信息
		 */
		setSelectInfoByType({ commit }, { type, info }) {
			commit("SET_SELECTINFO_BY_TYPE", { type, info });
		},
		/**
		 * 清空不同类别选中商品列表信息
		 */
		resetSelectInfoByType({ commit }, type) {
			commit("SET_SELECTINFO_BY_TYPE", { type, info: [] });
		}
	},
	mutations: {
		["SET_SELECTINFO_BY_TYPE"](state, { type, info }) {
			state.selectInfo = {
				...state.selectInfo,
				[type]: info
			};
		}
	}
};
