import type { RouteRecordRaw } from 'vue-router'
const Layout = () => import('@/layout/AppLayout.vue')

export const routes: Array<RouteRecordRaw> = [
  /** 默认跳转到首页 */
  {
    path: '/',
    name: 'home',
    redirect: '/smart',
    
  },
  /**  Layout 动态路由 start */

  /** 智能中心 */
  {
    path: '/smart',
    name: 'smart',
    meta: { title: '智能中心', icon: 'znzx' },
    component: Layout,
    redirect: { name: 'smartAnswer' },
    children: [
      {
        path: '/smart/answer/index',
        name: 'smartAnswer',
        component: () => import('@/views/smart/answer/index.vue'),
        meta: {
          title: '智能问答',
          keepAlive: false
        }
      },
      {
        path: '/smart/writing/list',
        name: 'smartWriting',
        component: () => import('@/views/smart/writing/list.vue'),
        meta: {
          title: '智能写作',
          keepAlive: false
        }
      },
      {
        path: '/smart/review/list',
        name: 'smartReview',
        component: () => import('@/views/smart/review/list.vue'),
        meta: {
          title: '智能审核',
          keepAlive: false
        }
      },

      /******************************************* 二级页面 ***************************************************/
      {
        path: '/smart/review/plan',
        name: 'smartReviewPlan',
        component: () => import('@/views/smart/review/plan.vue'),
        meta: {
          title: '审核方案名称',
          keepAlive: false,
          activeMenu: '/smart/review/list',
          hidden: true
        }
      },
      {
        path: '/smart/review/rule',
        name: 'smartReviewRule',
        meta: {
          title: '规则详情',
          keepAlive: false,
          activeMenu: '/smart/review/list',
          hidden: true
        },
        component: () => import('@/views/smart/review/rule/index.vue')
      },
      {
        path: '/smart/answer/:id/setting',
        name: 'smartAnswerSetting',
        component: () => import('@/views/smart/answer/setting.vue'),
        meta: {
          title: '智能设置',
          keepAlive: false,
          activeMenu: '/smart/answer/index',
          hidden: true
        }
      },
    ]
  },


  /** 知识中心 */
  {
    path: '/knowledge',
    name: 'knowledge',
    meta: { title: '知识中心', icon: 'zszx' },
    component: Layout,
    redirect: { name: 'knowledgeDataset' },
    children: [
      {
        path: '/knowledge/dataset/index',
        name: 'knowledgeDataset',
        component: () => import('@/views/knowledge/dataset/index.vue'),
        meta: {
          title: '知识库管理',
          keepAlive: false
        }
      },
      {
        path: '/knowledge/dataset/view',
        name: 'knowledgeDatasetView',
        component: () => import('@/views/knowledge/dataset/view.vue'),
        meta: {
          title: '知识库详情',
          keepAlive: false,
          hidden: true,
          activeMenu: '/knowledge/dataset/index',
        }
      },
      {
        path: '/knowledge/dataset/importDoc',
        name: 'knowledgeDatasetImportDoc',
        component: () => import('@/views/knowledge/dataset/importDoc.vue'),
        meta: {
          title: '知识库详情',
          keepAlive: false,
          hidden: true,
          activeMenu: '/knowledge/dataset/index',
        }
      },
      {
        path: '/knowledge/dataset/viewParagraph',
        name: 'knowledgeDatasetViewParagraph',
        component: () => import('@/views/knowledge/dataset/viewParagraph.vue'),
        meta: {
          title: '查看分段',
          keepAlive: false,
          hidden: true,
          activeMenu: '/knowledge/dataset/index',
        }
      },
      {
        path: '/knowledge/dataset/traceabilityDetails',
        name: 'knowledgeDatasetTraceabilityDetails',
        component: () => import('@/views/knowledge/dataset/traceabilityDetails.vue'),
        meta: {
          title: '查看分段',
          keepAlive: false,
          hidden: true,
          activeMenu: '/knowledge/dataset/index',
        }
      },
      {
        path: '/knowledge/document/index',
        name: 'knowledgeDocument',
        component: () => import('@/views/knowledge/document/index.vue'),
        meta: {
          title: '文档管理',
          keepAlive: false
        }
      },
      {
        path: '/knowledge/document/uploadDoc',
        name: 'knowledgeUploadDoc',
        component: () => import('@/views/knowledge/document/uploadDoc.vue'),
        meta: {
          title: '上传文档',
          keepAlive: false,
          hidden: true,
          activeMenu: '/knowledge/document/index',
        }
      },
      {
        path: '/knowledge/document/reviewDoc',
        name: 'knowledgeReviewDoc',
        component: () => import('@/views/knowledge/document/reviewDoc.vue'),
        meta: {
          title: '预览文档',
          keepAlive: false,
          hidden: true,
          activeMenu: '/knowledge/document/index',
        }
      },
      {
        path: '/knowledge/tag/index',
        name: 'knowledgeTag',
        component: () => import('@/views/knowledge/tag/index.vue'),
        meta: {
          title: '标签管理',
          keepAlive: false
        }
      },
      {
        path: '/knowledge/tag/create',
        name: 'knowledgeTagCreate',
        component: () => import('@/views/knowledge/tag/create.vue'),
        meta: {
          title: '新建维度及标签',
          keepAlive: false,
          hidden: true,
          activeMenu: '/knowledge/tag/index',
        }
      },
      {
        path: '/knowledge/tag/viewTag',
        name: 'knowledgeViewTag',
        component: () => import('@/views/knowledge/tag/viewTag.vue'),
        meta: {
          title: '标签管理',
          keepAlive: false,
          hidden: true,
          activeMenu: '/knowledge/tag/index',
        }
      }
    ]
  },
  /**  Layout 动态路由 end */

  /** 智能写作-智能编辑 */
  {
    path: '/smart/writing/index',
    name: 'smartWritingEditor',
    component: () => import('@/views/smart/writing/index.vue'),
    meta: {
      title: '智能编辑',
      keepAlive: false,
      hidden: true
    }
  },
  /** 智能审核-智能审核 */
  {
    path: '/smart/review/audit',
    name: 'smartReviewAudit',
    meta: {
      title: '智能审核',
      keepAlive: false,
      hidden: true
    },
    component: () => import('@/views/smart/review/audit/index.vue')
  },
  /** 智能审核-文档抽取 */
  {
    path: '/smart/review/extraction',
    name: 'smartReviewExtraction',
    meta: {
      title: '文档抽取',
      keepAlive: false,
      hidden: true
    },
    component: () => import('@/views/smart/review/extraction/index.vue')
  },

   /** 智能体对话页面 */
   {
    path: '/chat/:chatid/index',
    name: 'AiChat',
    meta: {
      title: '智能体对话',
      keepAlive: false,
      hidden: true
    },
    component: () => import('@/views/chat/index.vue')
  },



  /** 登录 */
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index.vue')
  },
  /** 错误页面 */
  {
    path: '/:pathMatch(.*)*',
    name: '404',
    component: () => import('@/views/error/404.vue')
  }
]
