refresh.js 582 B

123456789101112131415161718192021222324252627282930
  1. export default {
  2. namespace: 'refresh',
  3. state: {
  4. contactList: false,
  5. client: false,
  6. company: false,
  7. longle: false,
  8. department: false,
  9. staffList: false,
  10. business: false
  11. },
  12. // 用于处理异步操作和业务逻辑,由action触发,但不能修改state
  13. effects: {
  14. //
  15. *commitAction({ payload }, { put }) {
  16. yield put({
  17. type: 'changState',
  18. payload
  19. })
  20. }
  21. },
  22. reducers: {
  23. changState(state, action) {
  24. return {
  25. ...state,
  26. [action.payload]: !state[action.payload]
  27. }
  28. }
  29. }
  30. }