Z3flowSet.ts 493 B

12345678910111213141516171819202122232425
  1. import { Z3tableType } from '@/pages/Z_system/Z3flowSet/data'
  2. // 初始化状态
  3. const initState = {
  4. // 列表数据
  5. tableList: [] as Z3tableType[]
  6. }
  7. // 定义 action 类型
  8. type Props = {
  9. type: 'Z3/getList'
  10. payload: Z3tableType[]
  11. }
  12. // reducer
  13. export default function userReducer(state = initState, action: Props) {
  14. switch (action.type) {
  15. // 获取列表数据
  16. case 'Z3/getList':
  17. return { ...state, tableList: action.payload }
  18. default:
  19. return state
  20. }
  21. }