12345678910111213141516171819202122232425 |
- import { Z3tableType } from '@/pages/Z_system/Z3flowSet/data'
- // 初始化状态
- const initState = {
- // 列表数据
- tableList: [] as Z3tableType[]
- }
- // 定义 action 类型
- type Props = {
- type: 'Z3/getList'
- payload: Z3tableType[]
- }
- // reducer
- export default function userReducer(state = initState, action: Props) {
- switch (action.type) {
- // 获取列表数据
- case 'Z3/getList':
- return { ...state, tableList: action.payload }
- default:
- return state
- }
- }
|