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

// 初始化状态
const initState = {
  // 树数据
  treeData: [] as TypeI5Tree[]
}

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

// reducer
export default function Reducer(state = initState, action: Props) {
  switch (action.type) {
    // 获取树数据
    case 'E3/getTree':
      return { ...state, treeData: action.payload }

    default:
      return state
  }
}
