index.js 1.63 KB
import { createRouter, createWebHashHistory } from 'vue-router'  // 改用 Hash 模式

const routes = [
  {
    path: '/',
    redirect: '/smart-light'
  },
  {
    path: '/h5',
    redirect: '/smart-light-h5'
  },
  {
    path: '/smart-light',
    name: 'SmartLight',
    component: () => import('../views/SmartLight.vue'),
    meta: { title: '动态监控' }
  },
  {
    path: '/smart-light-h5',
    name: 'SmartLightH5',
    component: () => import('../views/SmartLightH5.vue'),
    meta: { title: '智能灯', h5: true }
  },
  {
    path: '/smart-light-h5/oee',
    name: 'SmartLightH5Oee',
    component: () => import('../views/SmartLightH5Oee.vue'),
    meta: { title: 'OEE时序', h5: true }
  },
  {
    path: '/smart-light-h5/utilization',
    name: 'SmartLightH5Utilization',
    component: () => import('../views/SmartLightH5Utilization.vue'),
    meta: { title: '稼动率', h5: true }
  },
  {
    path: '/energy-h5',
    name: 'EnergyH5',
    component: () => import('../views/EnergyH5.vue'),
    meta: { title: '能耗', h5: true }
  },
  {
    path: '/energy-h5/run-status',
    name: 'EnergyH5RunStatus',
    component: () => import('../views/EnergyH5RunStatus.vue'),
    meta: { title: '运行状态', h5: true }
  },
  {
    path: '/energy-h5/usage',
    name: 'EnergyH5Usage',
    component: () => import('../views/EnergyH5Usage.vue'),
    meta: { title: '用时用电', h5: true }
  },
  {
    path: '/energy',
    name: 'Energy',
    component: () => import('../views/Energy.vue'),
    meta: { title: '能耗' }
  }
]

const router = createRouter({
  history: createWebHashHistory('/iot/'),  // 使用 Hash 模式
  routes
})

export default router