import {
  AppstoreOutlined,
  ContainerOutlined,
  DesktopOutlined,
  MailOutlined,
  MenuFoldOutlined,
  MenuUnfoldOutlined,
  PieChartOutlined,
} from '@ant-design/icons';
import { Navigate } from 'react-router-dom';
import AuthLayout from '@/layouts/AuthLayout';
import Container from '@/layouts/Container';
import Login from '@/pages/login';
import Page404 from '@/pages/404';
import Home from '@/pages/sample/home';
import BasicForm from '@/pages/sample/form';
import BasicTable from '@/pages/sample/table';
import GuaranteeTaskList from '@/pages/guaranteeTask';
import GuaranteeTaskEdit from '@/pages/guaranteeTask/Edit';
import GuaranteeTaskPrint from '@/pages/guaranteeTask/print';
import DishList from '@/pages/dish/list';
import DishEdit from '@/pages/dish/edit';
import PackageList from '@/pages/package/List';
import StockList from '@/pages/stock/list';
import StockEdit from '@/pages/stock/edit';
import StockInOut from '@/pages/stock/outAndIn';
import StockLog from '@/pages/stock/stockLog';
import StockClassificationList from '@/pages/stockClassification/list';
import StockClassificationEdit from '@/pages/stockClassification/edit';
import RotationChartList from '@/pages/rotationChart/list';
import RotationChartEdit from '@/pages/rotationChart/edit';

/**
 * meta 用来扩展自定义数据数据
 * {
 *    title: 用于页面或者菜单的标题, 没有此字段, 菜单不会显示
 *    hideInMenu: 布尔值, 如果为 false, 菜单不会显示
 * }
 */

export default [
  {
    path: '/',
    element: <AuthLayout />,
    children: [
      {
        index: true,
        element: <Home />,
      },
      {
        path: 'home',
        element: <Home />,
        meta: {
          title: '首页',
          icon: <DesktopOutlined />,
        },
      },
      {
        path: 'task',
        element: <Container />,
        meta: {
          title: '军供任务',
          icon: <AppstoreOutlined />,
        },
        children: [
          {
            index: true,
            element: <Navigate to='guaranteeTask' replace />,
          },
          {
            path: 'guaranteeTask',
            element: <GuaranteeTaskList />,
            meta: {
              title: '军供通报',
            },
          },
          {
            path: 'guaranteeTask/edit',
            element: <GuaranteeTaskEdit />,
            meta: {
              title: '任务配置',
            },
          },
          {
            path: 'guaranteeTask/print',
            element: <GuaranteeTaskPrint />,
            meta: {
              hideInMenu: true,
              title: '任务执行',
            },
          }
        ]
      },
      {
        path: 'material',
        element: <Container />,
        meta: {
          title: '物资管理',
          icon: <AppstoreOutlined />,
        },
        children: [
          {
            index: true,
            element: <Navigate to='dish/list' replace />,
          },
          {
            path: 'dish/list',
            element: <DishList />,
            meta: {
              title: '菜肴管理',
            },
          },
          {
            path: 'dish/edit',
            element: <DishEdit />,
            meta: {
              hideInMenu: true,
              title: '菜肴维护',
            },
          },
          {
            path: 'package/list',
            element: <PackageList />,
            meta: {
              title: '套餐管理',
            },
          },
        ]
      },
      {
        path: 'stock',
        element: <Container />,
        meta: {
          title: '库存管理',
          icon: <AppstoreOutlined />,
        },
        children: [
          {
            index: true,
            element: <Navigate to='list' replace />,
          },
          {
            path: 'list',
            element: <StockList />,
            meta: {
              title: '库存列表',
            },
          },
          {
            path: 'add',
            element: <StockEdit />,
            meta: {
              title: '库存维护',
            },
          },
          {
            path: 'log',
            element: <StockLog />,
            meta: {
              title: '库存日志',
            },
          },
        ],
      },
      {
        path: 'cms',
        element: <Container />,
        meta: {
          title: '公告文件',
        },
        children: [
          {
            index: true,
            element: <Navigate to='rotationChart/list' replace />,
          },
          {
            path: 'rotationChart/list',
            element: <RotationChartList />,
            meta: {
              title: '轮播图管理',
            },
          },
          {
            path: 'rotationChart/edit',
            element: <RotationChartEdit />,
            meta: {
              title: '轮播图维护',
            },
          }
        ],
      },
      {
        path: 'static',
        element: <Container />,
        meta: {
          title: '数据分析',
        },
      },
      {
        path: 'system',
        element: <Container />,
        meta: {
          title: '系统管理',
        },
        children: [
          {
            index: true,
            element: <Navigate to='stockClassification/list' replace />,
          },
          {
            path: 'stockClassification/list',
            element: <StockClassificationList />,
            meta: {
              title: '库存分类管理',
            },
          },
          {
            path: 'stockClassification/edit',
            element: <StockClassificationEdit />,
            meta: {
              title: '库存分类维护',
              hideInMenu: true,
            },
          }
        ],
      },
      {
        path: '*',
        element: <Page404 />
      }
    ],
  },
  {
    path: '/login',
    element: <Login />,
  },
  {
    path: '*',
    element: <Page404 />
  }
]
