alarm.js 760 B

12345678910111213141516171819202122232425262728
  1. const alarm = {
  2. namespaced: true,
  3. state: {
  4. index: 0, //刷新数据的index 递增刷新
  5. spaceNameObj: null, //对象空间的名称字典
  6. spaceCodeObj: null //对象类空间字典对象
  7. },
  8. getters: {
  9. index: state => state.index,
  10. spaceNameObj: state => state.spaceNameObj,
  11. spaceCodeObj: state => state.spaceCodeObj
  12. },
  13. mutations: {
  14. // 刷新index
  15. ADD_INDEX(state) {
  16. state.index = state.index + 1 ;
  17. },
  18. // 空间名称dict
  19. SPACE_NAME_OBJ(state, spaceNameObj ){
  20. state.spaceNameObj = spaceNameObj
  21. },
  22. // 空间code值dict
  23. SPACE_CODE_OBJ(state, spaceCodeObj) {
  24. state.spaceCodeObj = spaceCodeObj
  25. }
  26. }
  27. }
  28. export default alarm;