import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
const layout = () => import("@/layout/index.vue");

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    redirect: "/login"
  },
  {
    path: "/login",
    name: "login",
    component: () => import("@/views/login/index.vue")
  },
  {
    path: "/InformationFilling",
    name: "InformationFilling",
    redirect: "/InformationFilling/outWarehouseInfo",
    component: layout,
    children: [
      {
        path: "outWarehouseInfo",
        name: "outWarehouseInfo",
        component: () => import("@/views/InformationFilling/outWarehouseInfo/index.vue")
      },
      {
        path: "enterWarehouseInfo",
        name: "enterWarehouseInfo",
        component: () => import("@/views/InformationFilling/enterWarehouseInfo/index.vue")
      }
    ]
  },
  {
    path: "/InformationAudit",
    name: "InformationAudit",
    component: layout,
    children: [
      {
        path: "outWarehouseAudit",
        name: "outWarehouseAudit",
        component: () => import("@/views/InformationAudit/outWarehouseAudit/index.vue")
      },
      {
        path: "enterWarehouseAudit",
        name: "enterWarehouseAudit",
        component: () => import("@/views/InformationAudit/enterWarehouseAudit/index.vue")
      }
    ]
  },
  {
    path: "/dataStatistics",
    name: "dataStatistics",
    component: layout,
    children: [
      {
        path: "reliefMaterial",
        name: "reliefMaterial",
        component: () => import("@/views/dataStatistics/reliefMaterial/index.vue")
      },
      {
        path: "floodPrevention",
        name: "floodPrevention",
        component: () => import("@/views/dataStatistics/floodPrevention/index.vue")
      },
      {
        path: "droughtResistant",
        name: "droughtResistant",
        component: () => import("@/views/dataStatistics/droughtResistant/index.vue")
      },
      {
        path: "emergencySupplies",
        name: "emergencySupplies",
        component: () => import("@/views/dataStatistics/emergencySupplies/index.vue")
      }
    ]
  }
];

const router = createRouter({
  history: createWebHashHistory(),
  routes
});

export default router;
