/*
 * @Author       : ldc 951052117@qq.com
 * @Date         : 2023-06-12 10:36:30
 * @LastEditors: suhang suhang_max@163.com
 * @LastEditTime: 2023-07-07 16:09:00
 * @Description  :路由配置文件  routes静态路由  asyncRoutes异步路由
 */
import {
  HomeFilled,
  Briefcase,
  User,
  Calendar,
  Document,
  Setting,
  PieChart,
  List,
  Tickets,
  Monitor
} from '@element-plus/icons-vue'
import Login from '@/views/Login/Login.vue'
import layout from '@/layout/Layout.vue'
import { shallowRef } from 'vue'
export const routes = [
  {
    path: '/',
    redirect: '/login',
  },
  {
    name: 'login',
    path: '/login',
    meta: { title: '登录' },
    component: Login,
  },

]
export const asyncRoutes = [
  {
    path: '/home',
    name: 'home',
    authKey: 'Workorder',
    redirect: '/project',
  },
  {
    path: '/project',
    name: 'project',
    authKey: 'Workorder',
    redirect: '/project/list',
    meta: { title: '项目管理', imgSrc: 'slider/system' },
    component: shallowRef(layout),
    children: [
      {
        path: '/project/list',
        name: 'projectList',
        authKey: 'Workorder',
        meta: {
          title: '项目列表',
        },
        component: () => import('@/views/project/list.vue'),
      },
      {
        path: '/project/detail',
        name: 'projectDetail',
        authKey: 'Workorder',
        meta: {
          title: '项目详情',
          menuHide: true, // 添加这个属性来隐藏菜单项
        },
        component: () => import('@/views/project/detail.vue'),
      },
    ],
  },
  {
    path: '/system',
    name: 'system',
    authKey: 'Workorder',
    meta: { title: '系统管理', imgSrc: 'slider/system' },
    component: shallowRef(layout),
    children: [
      {
        path: '/system/user',
        name: 'systemUser',
        authKey: 'Workorder',
        meta: {
          title: '用户管理',
        },
        component: () => import('@/views/system/user/index.vue'),
      },
      // {
      //   path: '/system/job',
      //   name: 'systemJob',
      //   authKey: 'Workorder',
      //   meta: {
      //     title: '定时任务',
      //   },
      //   component: () => import('@/views/system/job/index.vue'),
      // },
    ],
  },
  {
    path: '/worklog',
    name: 'worklog',
    authKey: 'Workorder',
    meta: { title: '工作日志', imgSrc: 'slider/worklog' }, // 您可能需要为工作日志添加一个图标
    component: shallowRef(layout),
    children: [
      {
        path: '/worklog/list',
        name: 'worklogList',
        authKey: 'Workorder',
        meta: {
          title: '工作日志',
        },
        component: () => import('@/views/workLog/list.vue'),
      },
      // 如果需要其他工作日志相关的子路由,可以在这里添加
    ],
  },
  {
    path: '/projectBank',
    name: 'projectBank',
    authKey: 'Workorder',
    meta: { title: '项目看板', imgSrc: 'slider/worklog' }, // 您可能需要为工作日志添加一个图标
    component: shallowRef(layout),
    children: [
      {
        path: '/projectBank/projectProgress',
        name: 'projectProgress',
        authKey: 'Workorder',
        meta: {
          title: '项目执行表',
        },
        component: () => import('@/views/projectBank/projectProgress.vue'),
      },
      {
        path: '/projectBank/userProject',
        name: 'userProject',
        authKey: 'Workorder',
        meta: {
          title: '人员项目表',
        },
        component: () => import('@/views/projectBank/userProject.vue'),
      },
      {
        path: '/projectBank/projectUser',
        name: 'projectUser',
        authKey: 'Workorder',
        meta: {
          title: '项目人员表',
        },
        component: () => import('@/views/projectBank/projectUser.vue'),
      },
    ],
  },
]
