import { DEFAULT_LAYOUT } from '@/router/constants'
import { Project, Domain } from '@/enums/api'
import { AppRouteRecordRaw } from '../types'

const ProjectCenter: AppRouteRecordRaw = {
  path: '/project-center',
  name: 'ProjectCenter',
  component: DEFAULT_LAYOUT,
  meta: {
    title: '项目中心',
    icon: 'icon-layers',
    iSize: 22,
    requiresAuth: true,
    order: 6
  },
  children: [
    {
      path: 'project',
      name: 'ProjectList',
      component: () => import('@/views/project-center/project/index.vue'),
      meta: {
        title: '项目管理',
        permissions: [Project.PROJECT_INFO_LIST],
        requiresAuth: true,
        ignoreCache: true,
        hideTabBar: true
      }
    },
    {
      path: 'contract',
      name: 'Contract',
      component: () => import('@/views/project-center/contract/index.vue'),
      meta: {
        title: '合同管理',
        permissions: [Project.PROJECT_CONTRACT_LIST],
        requiresAuth: true,
        ignoreCache: true
      }
    },
    {
      path: 'week-report',
      name: 'WeekReport',
      component: () => import('@/views/project-center/week-report/index.vue'),
      meta: {
        title: '项目周报',
        permissions: [Project.PROJECT_WEEK_REPORT_LIST],
        requiresAuth: true,
        ignoreCache: true
      }
    },
    {
      path: 'crew-task',
      name: 'CrewTask',
      component: () => import('@/views/project-center/crew-task/index.vue'),
      meta: {
        title: '组员任务',
        permissions: [Project.PROJECT_CREW_TASKS],
        requiresAuth: true,
        ignoreCache: true
      }
    }
    // {
    //   path: 'project-detail/:id',
    //   name: 'ProjectDetail',
    //   component: () =>
    //     import('@/views/project-center/project/components/Detail.vue'),
    //   meta: {
    //     title: '项目详情',
    //     permissions: [Domain.SYSTEM_DOMAIN_TREE],
    //     hideInMenu: true,
    //     requiresAuth: true,
    //     ignoreCache: false
    //   },
    //   children: []
    // }
  ]
}

export default ProjectCenter
