import { createRouter, createWebHistory } from 'vue-router'
import Layout from './Layout.vue'

export const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      component: Layout,
      children: [
        { path: '', component: () => import('./pages/Dashboard.vue') },
        { path: 'models', component: () => import('./pages/DeviceModelManagement.vue') },
        { path: 'devices', component: () => import('./pages/DeviceList.vue') },
        { path: 'devices/:id', component: () => import('./pages/DeviceDetail.vue') },
        { path: 'registration', component: () => import('./pages/DeviceRegistration.vue') },
        { path: 'boards', component: () => import('./pages/BoardManagement.vue') },
        { path: 'licenses', component: () => import('./pages/LicenseManagement.vue') },
        { path: 'calibration', component: () => import('./pages/CalibrationRecords.vue') },
        { path: 'repair', component: () => import('./pages/RepairOrders.vue') },
        { path: 'repair/stats', component: () => import('./pages/RepairStats.vue') },
        { path: 'repair/:orderId', component: () => import('./pages/RepairOrderDetail.vue') },
        { path: 'scrap', component: () => import('./pages/ScrapManagement.vue') },
        { path: 'firmware', component: () => import('./pages/FirmwareLibrary.vue') },
        { path: 'config-files', component: () => import('./pages/ConfigFileManagement.vue') },
        { path: 'config-files/:configId', component: () => import('./pages/ParameterConfiguration.vue') },
        { path: 'reports', component: () => import('./pages/PlaceholderPage.vue'), props: { title: '数据报表' } },
        { path: 'logs', component: () => import('./pages/PlaceholderPage.vue'), props: { title: '操作日志' } },
        { path: 'settings', component: () => import('./pages/PlaceholderPage.vue'), props: { title: '系统设置' } },
        { path: ':pathMatch(.*)*', component: () => import('./pages/PlaceholderPage.vue'), props: { title: '页面未找到' } },
      ],
    },
  ],
})
