const goodsCate = {
  state: {
    goodsCateList: [],	// 分类列表
	cate: {}		 ,  // 作品绘制参数
	snapshot:[],        // diy操作步骤图	
	stock:[],           // 设备信息库存信息
  },

  getters: {
    goodsCateList: state => state.goodsCateList || [],
	cate: state => state.cate || {},
	snapshot: state => state.snapshot || [],
	stock: state => state.stock || [],
  },

  mutations: {
    SET_GOODS_CATE_LIST: (state, goodsCateList) => {
      state.goodsCateList = goodsCateList
    },
	SET_CATE: (state, cate) => {
	  state.cate = cate
	},
	SET_SNAPSHOT: (state, snapshot) => {
	  state.snapshot = snapshot
	},
	SET_STOCK: (state, stock) => {
	  state.stock = stock
	},
  },

  actions: {
    setGoodsCateList: ({ commit }, goodsCateList) => {
      commit('SET_GOODS_CATE_LIST', goodsCateList)
    },
	setCate: ({ commit }, cate) => {
	  commit('SET_CATE', cate)
	},
	setSnapshot: ({ commit }, snapshot) => {
	  commit('SET_SNAPSHOT', snapshot)
	},
	setStock: ({ commit }, stock) => {
	  commit('SET_STOCK', stock)
	},
  }
}

export default goodsCate
