import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: () => import('../views/Home.vue'),
    meta: {
      title: '首页',
      breadcrumb: true
    }
  },
  {
    path: '/cockpit',
    name: 'Cockpit',
    meta: {
      title: '驾驶舱',
      screen: true,
      breadcrumb: true
    },
    component: () => import('../views/cockpit/index.vue')
  },
  {
    path: '/yhz',
    name: 'yhz',
    component: () => import('../views/ServiceStationManagePage/index.vue'),
    meta: {
      title: '养护站管理',
      breadcrumb: true
    }
  },
  {
    path: '/yhzsb/:data?',
    name: 'yhzsb',
    component: () => import('../views/EquipmentManagement/index.vue'),
    meta: {
      title: '养护站设备',
      breadcrumb: true
    }
  },
  {
    path: '/yhzwz/:data?',
    name: 'yhzwz',
    component: () => import('../views/MaterialManagement/index.vue'),
    meta: {
      title: '养护站物资',
      breadcrumb: true
    }
  },
  {
    path: '/yhzevent',
    name: 'yhzevent',
    component: () => import('../views/SnowEventManagement/index.vue'),
    meta: {
      title: '雪情事件管理',
      breadcrumb: true
    }
  },
  {
    path: '/airSkyLand',
    name: 'airskyland',
    meta: {
      title: '空天地一体化',
      screen: true,
      breadcrumb: true
    },
    component: () => import('../views/airSkyLand/AirSkyLand.vue')
  },
  {
    path: '/3DSituationalAwareness',
    name: '3DSituationalAwareness',
    meta: {
      title: '三维态势感知',
      screen: true,
      skipInitialCameraView: true, // 跳过MapViewport的自动初始视图，由页面自己控制相机
      breadcrumb: true
    },
    component: () => import('../views/3DSituationalAwarenessRefactor/index.vue')
  },
  {
    path: '/riskWarning',
    name: 'RiskWarning',
    meta: {
      title: '风险预警',
      screen: true,
      breadcrumb: false
    },
    component: () => import('../views/RiskWarning/index.vue')
  },
  {
    path: '/regulationsDivision',
    name: 'RegulationsDivision',
    meta: {
      title: '法规分工',
      screen: true,
      breadcrumb: true
    },
    component: () => import('../views/RegulationsDivision/RegulationsDivision.vue')
  },
  {
    path: '/warningCounty',
    name: 'WarningCounty',
    meta: {
      title: '区县预警',
      screen: true,
      breadcrumb: true
    },
    component: () => import('../views/warningCounty/warningCounty.vue')
  },
  {
    path: '/constructionDepartment',
    name: 'ConstructionDepartment',
    meta: {
      title: '建设部门',
      screen: true,
      breadcrumb: true
    },
    component: () => import('../views/ConstructionDepartment/ConstructionDepartment.vue')
  },
  // 响应预警 - 建设处
  {
    path: '/warningManagement',
    name: 'warningManagement',
    component: () => import('../views/WarningManagement/construction/index.vue'),
    meta: {
      title: '响应预警',
      breadcrumb: true
    }
  },
  // 驻地台账 - 建设处
  {
    path: '/ledgerManagement',
    name: 'ledgerManagement',
    component: () => import('../views/LedgerManagement/index.vue'),
    meta: {
      title: '驻地台账',
      breadcrumb: true,
      parentRoute: 'warningManagement'
    }
  },
  // 响应预警 - 区县级
  {
    path: '/warningManagement2',
    name: 'warningManagement2',
    component: () => import('../views/WarningManagement/district/index.vue'),
    meta: {
      title: '响应预警',
      breadcrumb: true
    }
  },
  // 驻地台账 - 区县级
  {
    path: '/ledgerManagement2',
    name: 'ledgerManagement2',
    component: () => import('../views/LedgerManagement/index.vue'),
    meta: {
      title: '驻地台账',
      breadcrumb: true,
      parentRoute: 'warningManagement2'
    }
  },
  // 响应预警 - 法规处
  {
    path: '/warningManagement3',
    name: 'warningManagement3',
    component: () => import('../views/WarningManagement/law/index.vue'),
    meta: {
      title: '响应预警',
      breadcrumb: true
    }
  },
  // 线下帮扶台账 - 法规处
  {
    path: '/ledgerManagement3',
    name: 'ledgerManagement3',
    component: () => import('../views/LedgerManagement/helpLedger/index.vue'),
    meta: {
      title: '线下帮扶台账',
      breadcrumb: true,
      parentRoute: 'warningManagement3'
    }
  },
  {
    path: '/dutyManagement',
    name: 'dutyManagement',
    component: () => import('../views/WarningManagement/law/dutyManagement/index.vue'),
    meta: {
      title: '值班管理',
      breadcrumb: true,
      parentRoute: 'warningManagement3'
    }
  },

  // 项目管理 - 区县
  {
    path: '/projectManagement',
    name: 'projectManagement',
    component: () => import('../views/ProjectManagement_Rebuild/district/index.vue'),
    meta: {
      title: '项目管理',
      breadcrumb: true
    }
  },
  {
    path: '/projectAdd/:data?/:mode?',
    name: 'projectAdd',
    component: () => import('../views/ProjectManagement_Rebuild/district/projectAddPage.vue'),
    meta: {
      title: '项目填报',
      breadcrumb: true,
      parentRoute: 'projectManagement'
    }
  },
  // 项目详情 - 区县版本
  {
    path: '/projectDetail/:data?',
    name: 'projectDetail',
    component: () => import('../views/ProjectManagement_Rebuild/district/projectDetailPage.vue'),
    meta: {
      title: '项目详情',
      breadcrumb: true,
      parentRoute: 'projectManagement'
    }
  },
  // 项目管理 - 业务部门
  {
    path: '/projectManagement2',
    name: 'projectManagement2',
    component: () => import('../views/ProjectManagement_Rebuild/business/index.vue'),
    meta: {
      title: '项目管理',
      breadcrumb: true
    }
  },
  // 项目详情 - 业务部门版本
  {
    path: '/projectDetail2/:data?',
    name: 'projectDetail2',
    component: () => import('../views/ProjectManagement_Rebuild/business/projectDetailPage.vue'),
    meta: {
      title: '项目详情',
      breadcrumb: true,
      parentRoute: 'projectManagement2'
    }
  },

  {
    path: '/disasterManagement',
    name: 'disasterManagement',
    component: () => import('../views/DisasterManagement/DisasterManagementPC.vue'),
    meta: {
      title: '灾害巡检事件',
      breadcrumb: true
    }
  },
  {
    path: '/iceDisasterReport',
    component: () => import('../views/DisasterManagement/IceDisasterReport/IceDisasterReportPC.vue'),
    meta: {
      title: '冰雪灾害上报',
      parentRoute: 'disasterManagement',
      breadcrumb: true
    }
  },
  {
    path: '/iceDisasterDetail',
    component: () => import('../views/DisasterManagement/IceDisasterDetail/IceDisasterDetailPC.vue'),
    meta: {
      title: '冰雪灾害详情',
      parentRoute: 'disasterManagement',
      breadcrumb: true
    }
  },
  {
    path: '/waterDisasterReport',
    component: () => import('../views/DisasterManagement/WaterDisasterReport/WaterDisasterReportPC.vue'),
    meta: {
      title: '水毁灾害上报',
      parentRoute: 'disasterManagement',
      breadcrumb: true
    }
  },
  {
    path: '/waterDisasterDetail',
    name: 'WaterDisasterDetail',
    component: () => import('../views/DisasterManagement/WaterDisasterDetail/WaterDisasterDetailPC.vue'),
    meta: {
      title: '水毁事件详情',
      parentRoute: 'disasterManagement',
      breadcrumb: true
    }
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default router
