/**
 * Created by Administrator on 2017/12/18 0018.人事招聘
 */
import dynamic from 'dva/dynamic';

// wrapper of dynamic
const dynamicWrapper = (app, models, component) =>
  dynamic({
    app,
    models: () => models.map(m => import(`../models/${m}.js`)),
    component
  });

export const ExaminationApproval = app => {
  return {
    name: '审批',
    icon: 'shenpi',
    path: 'examinationapproval',
    children: [
      // {
      //   name: '审批管理',
      //   path: 'examinationapprovalmanage',
      //   component: dynamicWrapper(app, ['monitor'], () => import('../routes/ExaminationApproval/ExaminationApprovalManage')),
      // },
      // {
      //   name: '',//编辑审批
      //   title: '审批',
      //   path: 'editorialapproval',
      //   component: dynamicWrapper(app, ['monitor'], () => import('../routes/ExaminationApproval/EditorialApproval')),
      // },
      {
        name: '审批列表',
        path: 'approvallist',
        component: dynamicWrapper(app, ['approval'], () =>
          import('../routes/ExaminationApproval/ApprovalList/ApprovalList')
        )
      },
      {
        name: '审批类型管理',
        path: 'approvaltypemanage',
        component: dynamicWrapper(app, ['approval'], () =>
          import('../routes/ExaminationApproval/ApprovalTypeManage/ApprovalTypeManage')
        )
      }
    ]
  };
};
