You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
992 B

4 months ago
  1. // counterSlice.ts 文件
  2. import { createSlice } from "@reduxjs/toolkit";
  3. const initialState = {
  4. systemInfo:[],
  5. orgInfo:{
  6. id:'',
  7. name:'',
  8. value:'',
  9. code:''
  10. },
  11. accountInfo:{
  12. id:'',
  13. name:'',
  14. value:'',
  15. code:''
  16. }
  17. };
  18. // 创建一个 Slice
  19. export const systemStateSlice = createSlice({
  20. name: "systemState",
  21. initialState,
  22. reducers: {
  23. updateSystemAllState: (state, { payload }) => {
  24. state.systemInfo = payload
  25. },
  26. updateSystemOrgState: (state, { payload }) => {
  27. console.log('systemState.orgInfo------11----', payload)
  28. state.orgInfo = payload
  29. },
  30. updateSystemAccountState: (state, { payload }) => {
  31. state.accountInfo = payload
  32. },
  33. },
  34. });
  35. export const {updateSystemAllState, updateSystemOrgState, updateSystemAccountState } = systemStateSlice.actions;
  36. // 默认导出
  37. export default systemStateSlice.reducer;