product.js 673 B

1234567891011121314151617181920212223242526
  1. export default {
  2. state: {
  3. //选中的花材信息
  4. selectInfo: {}
  5. },
  6. getters: {
  7. getSelectInfo(state) {
  8. return state.selectInfo
  9. }
  10. },
  11. actions: {
  12. //保存已选花材列表
  13. setSelectInfo({ commit }, { selectJobType, info,selectJobId }) {
  14. commit("SET_SELECTED_ITEM", { selectJobType, info,selectJobId });
  15. },
  16. //清空已选花材信息
  17. reSetSelectInfo({ commit }, {selectJobType,selectJobId}) {
  18. commit("SET_SELECTED_ITEM", { selectJobType, info: [],selectJobId });
  19. }
  20. },
  21. mutations: {
  22. SET_SELECTED_ITEM(state, { selectJobType, info,selectJobId }) {
  23. state.selectInfo = { ...state.selectInfo, [selectJobType+'_'+selectJobId]: info }
  24. }
  25. }
  26. };