import layout from '@/views/app/layout/layout.vue'
import redirect from '@/views/app/redirect/index.vue'
const home = () => import('@/views/app/Home')

export default [
  {
    path: '/',
    component: layout,
    redirect: '/home',
    name: 'home',
    meta: {
      title: '主页',
      icon: 'icon-zhuye',
      affix: true
    },
    children: [
      {
        path: '/home',
        name: 'home-page',
        component: home,
        meta: {
          title: '主页',
          icon: 'icon-zhuye'
        }
      }
    ]
  },
  {
    path: '/knowledge',
    name: 'knowledge',
    component: layout,
    redirect: '/knowledge/list',
    meta: {
      title: 'AI知识库',
      icon: 'el-icon-s-home',
      affix: true
    },
    children: [
      {
        path: '/knowledge/list',
        name: 'knowledge-list',
        component: redirect,
        // redirect: '/knowledge/list',
        meta: {
          title: '知识库',
          icon: 'icon-dengpao1',
          affix: true
        },
        children: [
          {
            path: '/knowledge/list',
            name: 'knowledge-home',
            component: () => import('@/views/knowledge/index.vue'),
            meta: {
              breadcrumb: false,
              title: '知识库',
              icon: 'el-icon-s-home'
            }
          },
          {
            path: '/knowledge/detail',
            name: 'knowledge-detail',
            component: redirect,
            redirect: '/knowledge/detail',
            hidden: true,
            meta: {
              title: '知识库详情',
              icon: 'el-icon-s-home'
            },
            children: [
              {
                path: '/knowledge/knowledge-create',
                name: 'knowledge-create',
                component: () =>
                  import('@/views/knowledge/detail/components/knowledgeForm.vue'),
                meta: {
                  breadcrumb: false,
                  title: '知识库详情',
                  icon: 'el-icon-s-home'
                }
              },

              {
                path: '/knowledge/detail',
                name: 'knowledge-detail-page',
                component: () => import('@/views/knowledge/detail/index.vue'),
                meta: {
                  breadcrumb: false,
                  title: '知识库详情',
                  icon: 'el-icon-s-home'
                }
              },
              {
                path: '/knowledge/detail/create',
                name: 'knowledge-create-page',
                component: () => import('@/views/knowledge/detail/create.vue'),
                meta: {
                  title: '知识库新增',
                  icon: 'el-icon-s-home'
                }
              },

              {
                path: '/knowledge/reviewKnowledge',
                name: 'knowledge-review-knowledge',
                component: () =>
                  import('@/views/knowledge/detail/reviewKnowledge.vue'),
                meta: {
                  title: '直接上传至知识库',
                  icon: 'el-icon-s-home'
                }
              },

              {
                path: '/knowledge/detail/segments',
                name: 'knowledge-segments',
                component: () =>
                  import('@/views/knowledge/detail/components/viewSegments/index.vue'),
                meta: {
                  title: '分段查看',
                  icon: 'el-icon-s-home'
                }
              }
            ]
          }
        ]
      },
      {
        path: '/knowledge/track',
        name: 'knowledge-track',
        component: redirect,
        redirect: '/knowledge/track',
        meta: {
          title: '任务轨迹',
          icon: 'icon-dingwei',
          affix: true
        },
        children: [
          {
            path: '/knowledge/track',
            name: 'track-page',
            component: () => import('@/views/track/Index.vue'),

            meta: {
              breadcrumb: false,
              title: '任务轨迹',
              icon: 'icon-dingwei'
            }
          },
          {
            path: '/rules',
            name: 'rules-page',
            component: () => import('@/views/rules/Index.vue'),
            hidden: true,
            meta: {
              title: '规则管理',

              icon: 'el-icon-s-home'
            }
          }
        ]
      },
      {
        path: '/knowledge/rule',
        name: 'knowledge-rule',
        component: redirect,
        redirect: '/knowledge/rule',
        meta: {
          title: '规则管理',
          icon: 'icon-guizeshezhi',
          affix: true
        },
        children: [
          {
            path: '/knowledge/rule',
            name: 'rule-page',
            component: () => import('@/views/rules/Index.vue'),
            meta: {
              title: '规则管理',
              icon: 'el-icon-s-home'
            }
          }
        ]
      }
    ]
  },
  // 智能体详情
  {
    path: '/agent',
    name: 'agent',
    component: layout,
    redirect: '/agent/:thirdAppId/workflow',
    meta: {
      title: '智能体',
      icon: 'icon-notebook',
      affix: true
    },
    children: [
      {
        path: '/agent/:thirdAppId/workflow',
        name: 'agent-workflow',
        component: () => import('@/views/agent/views/workflow/index.vue'),
        meta: {
          title: 'agent',
          icon: 'icon-notebook'
        }
      }
    ]
  },
  {
    path: '/system',
    name: 'system',
    component: layout,
    redirect: '/system/user',
    meta: {
      title: '系统管理',
      icon: 'el-icon-setting',
      affix: true
    },
    children: [
      {
        path: '/system/user',
        name: 'system-user',
        component: () => import('@/views/system/user/index.vue'),
        meta: {
          title: '用户管理',
          icon: 'el-icon-user'
        }
      },
      {
        path: '/system/menu',
        name: 'system-menu',
        component: () => import('@/views/system/menu/index.vue'),
        meta: {
          title: '菜单管理',
          icon: 'el-icon-s-tools'
        }
      },
      {
        path: '/system/role',
        name: 'system-role',
        component: () => import('@/views/system/role/index.vue'),
        meta: {
          title: '角色管理',
          icon: 'el-icon-s-custom'
        }
      }
    ]
  },

  {
    path: '/intelligentAgent',
    name: 'intelligentAgent',
    component: layout,
    redirect: '/intelligentAgent/list',
    meta: {
      title: 'AI智能体',
      icon: 'icon-notebook',
      affix: true
    },
    children: [
      {
        path: '/intelligentAgent/list',
        name: 'intelligentAgent-list',
        component: () => import('@/views/intelligent-agent/index.vue'),
        meta: {
          title: 'AI智能体',
          icon: 'icon-notebook',
          accessToken: '',
          refreshToken: ''
        }
      },
      {
        path: '/intelligentAgent/logs-overview',
        name: 'intelligentAgent-logs-overview',
        component: () =>
          import('@/views/intelligent-agent/children/Logs&overview/index.vue'),
        hidden: true,
        meta: {
          title: '日志与监测',
          icon: 'icon-notebook',
          accessToken: '',
          refreshToken: ''
        }
      }
    ]
  }
]
