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

const Work: AppRouteRecordRaw = {
  path: '/my-work',
  name: 'MyWork',
  component: DEFAULT_LAYOUT,
  meta: {
    title: '我的工作',
    icon: 'icon-archive',
    iSize: 22,
    requiresAuth: true,
    showBadge: true,
    order: 7
  },
  children: [
    {
      path: 'all',
      name: 'AllWork',
      component: () => import('@/views/my-work/all/index.vue'),
      meta: {
        title: '全部工作',
        showBadge: true,
        permissions: [Api.PROJECT_WORK_LIST],
        requiresAuth: true,
        ignoreCache: true
      }
    },
    {
      path: 'completed',
      name: 'CompletedWork',
      component: () => import('@/views/my-work/completed/index.vue'),
      meta: {
        title: '已完成的',
        permissions: [Api.PROJECT_WORK_LIST],
        requiresAuth: true,
        ignoreCache: true
      }
    },
    {
      path: 'incomplete',
      name: 'IncompleteWork',
      component: () => import('@/views/my-work/incomplete/index.vue'),
      meta: {
        title: '未完成的',
        permissions: [Api.PROJECT_WORK_LIST],
        requiresAuth: true,
        ignoreCache: true
      }
    }
  ]
}

export default Work
