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