import { Navigate, createBrowserRouter, createHashRouter } from 'react-router-dom' import Login from '../pages/Login' import Index from '../pages/Layout' import { UserOutlined, AppstoreOutlined, SendOutlined, BellOutlined, FieldTimeOutlined, CheckCircleOutlined, EditOutlined, SwitcherOutlined, SearchOutlined, FormOutlined, ApiOutlined, UnorderedListOutlined, ApartmentOutlined, BarsOutlined, } from '@ant-design/icons'; import Error404 from '../pages/error/Error404' import TodoList from '../pages/workflow/TodoList' import { RequireAuth, LoginPageGuard } from './Guard'; export const menuRoutes = [ { path: '/wf', key: 'workflow', icon: , label: '基础功能', element: , redirect: '/wf/todo', children: [{ path: 'start', key: '/wf/start', icon: , label: '发起', async lazy() { const Start = (await import('../pages/workflow/Start')).default return { Component: Start } } }, { indexed: true, path: 'todo', key: '/wf/todo', icon: , label: '待办', element: }, { path: 'running', key: '/wf/running', icon: , label: '在途', async lazy() { const Running = (await import('../pages/workflow/Running')).default return { Component: Running } } }, { path: 'completed', key: '/wf/completed', icon: , label: '已完成', async lazy() { const Completed = (await import('../pages/workflow/Completed')).default return { Component: Completed } } }, { path: 'query', key: '/wf/query', icon: , label: '查询', scop: '2', async lazy() { const IntegratedQuery = (await import('../pages/workflow/IntegratedQuery')).default return { Component: IntegratedQuery } } }, { path: 'draft', key: '/wf/draft', icon: , label: '草稿', async lazy() { const Draft = (await import('../pages/workflow/Draft')).default return { Component: Draft } } }, { path: 'cc', key: '/wf/cc', icon: , label: '抄送', async lazy() { const Send = (await import('../pages/workflow/Send')).default return { Component: Send } } }, { path: 'batch', key: '/wf/batch', icon: , label: '批处理', async lazy() { const Batch = (await import('../pages/workflow/Batch')).default return { Component: Batch } } } ] }, { path: '/query', key: 'query', icon: , label: '流程查询', element: , redirect: '/query/start', children: [ { path: 'start', key: '/query/start', icon: , label: '我发起的', scop: '1',//查询范围 async lazy() { const IntegratedQuery = (await import('../pages/workflow/IntegratedQuery')).default return { Component: IntegratedQuery } } }, { path: 'participation', key: '/query/participation', icon: , label: '我参与的', scop: '0',//查询范围 async lazy() { const IntegratedQuery = (await import('../pages/workflow/IntegratedQuery')).default return { Component: IntegratedQuery } } } ] }, { path: '/functionCall', key: 'functionCall', icon: , label: '功能调用', meta: { icon: , label: '功能调用', }, element: , redirect: '/functionCall/FlowTree', children: [ { path: 'FlowTree', key: '/functionCall/FlowTree', icon: , label: '流程设计', async lazy() { const CallPort = (await import('../pages/functionCall/CallPort')).default return { Component: CallPort } } }, { path: 'FormTree', key: '/functionCall/FormTree', icon: , label: '表单设计', async lazy() { const CallPort = (await import('../pages/functionCall/CallPort')).default return { Component: CallPort } } } ] }, { path: '/apis', key: "Apis", icon: , label: 'API列表', redirect: '/apis/list', element: , children: [ { path: 'list', key: '/apis/list', icon: , label: '工具包接口', async lazy() { const List = (await import('../pages/api/List')).default return { Component: List } } } ] }, ] const staticRoutes = [ { path: "/", name: 'IndexRedirect', element: , }, { path: '/login', key: 'login', element: }, { path: '*', element: } ] const routes = [...menuRoutes, ...staticRoutes] export const router = createHashRouter(routes)