import { TypeI5Tree } from '@/pages/Isystem/I5organization/data'

// 初始化状态
const initState = {
  // 所有字典数据
  dictAll: [] as TypeI5Tree[]
}

// 定义 action 类型
type Props = {
  type: 'I2/getDictAll'
  payload: TypeI5Tree[]
}

// reducer
export default function Reducer(state = initState, action: Props) {
  switch (action.type) {
    // 获取字典数据
    case 'I2/getDictAll':
      return { ...state, dictAll: action.payload }
    default:
      return state
  }
}
