import {
  createRouter,
  createWebHistory,
  createWebHashHistory,
  type RouteRecordRaw
} from 'vue-router';

export const stairRouteNames: string[] = [
  'homeOverview', //全站总览
  'fireControlIndex', //消防系统
  'securityIndex', //安全防范
  'monitoringIndex', //在线监测
  'environmentIndex', //环境监控
  'lightingIndex', //照明控制
  'waterSupplyIndex' //给排水系统
];

export const constantRoutes: Readonly<RouteRecordRaw[]> = [
  {
    path: '/',
    // redirect: '/home/overall/overview'
    // redirect: '/home/overview?screen=homeOverview',
    redirect: '/edit',
    meta: { title: '编辑模式', hidden: true, treeHidden: true, bottomHidden: true }
  },
  {
    path: '/edit',
    name: 'edit',
    component: () => import('@/views/edit/index.vue'),
    meta: { title: '编辑模式', hidden: true, treeHidden: true, bottomHidden: true }
  },
  {
    path: '/preview',
    name: 'preview',
    component: () => import('@/views/preview/index.vue'),
    meta: { title: '预览模式', hidden: true, treeHidden: true, bottomHidden: true }
  },
  {
    path: '/test',
    name: 'test',
    component: () => import('@/layout/view_index.vue'),
    meta: { title: '测试页面', hidden: true, treeHidden: true, bottomHidden: true },
    children: [
      {
        path: '/test/overview',
        name: 'testOverview',
        component: () => import('@/views/preview/test/index.vue'),
        meta: { title: '测试页面', hidden: true, treeHidden: true, bottomHidden: true }
      }
    ]
  },

  {
    path: '/home',
    name: 'home',
    component: () => import('@/layout/view_index.vue'),
    meta: { title: '全站总览项目', hidden: false, treeHidden: false, bottomHidden: false },
    children: [
      {
        path: '/home/overview',
        name: 'homeOverview',
        component: () => import('@/views/preview/home/overview.vue'),
        meta: {
          title: '全站总览',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'Connection'
        }
      },
      {
        path: '/home/globalMessage',
        name: 'homeGlobalMessage',
        component: () => import('@/views/preview/home/globalMessage.vue'),
        meta: {
          title: '全站报文',
          hidden: true,
          treeHidden: false,
          bottomHidden: true,
          menuIcon: 'Connection'
        }
      },
      {
        path: '/home/exceedMessage',
        name: 'homeExceedMessage',
        component: () => import('@/views/preview/home/homeOverrunMessage.vue'),
        meta: { title: '越权信息', hidden: true, treeHidden: false, bottomHidden: true }
      },
      {
        path: '/home/exceptionFacility',
        name: 'homeExceptionFacility',
        component: () => import('@/views/preview/home/homeExceptionFacility.vue'),
        meta: { title: '异常设备', hidden: true, treeHidden: false, bottomHidden: true }
      }
    ]
  },
  {
    path: '/fireControl',
    name: 'fireControl',
    component: () => import('@/layout/view_index.vue'),
    meta: { title: '消防系统项目', hidden: false, treeHidden: false, bottomHidden: false },
    children: [
      {
        path: '/fireControl/index',
        name: 'fireControlIndex',
        component: () => import('@/views/preview/fireControl/index.vue'),
        meta: {
          title: '消防系统',
          hidden: true,
          treeHidden: false,
          bottomHidden: true,
          menuIcon: 'Discount'
        }
      },
      {
        path: '/fireControl/alarm',
        name: 'fireControlAlarm',
        meta: {
          title: '火警报警项目',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'Bell'
        },
        children: [
          {
            path: '/fireControl/alarm/index',
            name: 'fireControlAlarmIndex',
            component: () => import('@/views/preview/fireControl/alarm/index.vue'),
            meta: {
              title: '火灾报警',
              hidden: true,
              treeHidden: false,
              bottomHidden: true,
              menuIcon: 'Bell'
            }
          },
          {
            path: '/fireControl/alarm/host',
            name: 'fireControlAlarmHost',
            component: () => import('@/views/preview/fireControl/alarm/host.vue'),
            meta: {
              title: '火灾报警主机',
              hidden: false,
              treeHidden: false,
              bottomHidden: false,
              menuIcon: 'Crop'
            }
          },
          {
            path: '/fireControl/alarm/floor',
            name: 'fireControlAlarmFloor',
            component: () => import('@/views/preview/fireControl/alarm/floor.vue'),
            meta: {
              title: '生产综合楼 1 楼',
              hidden: false,
              treeHidden: false,
              bottomHidden: false,
              menuIcon: 'OfficeBuilding'
            }
          }
        ]
      },
      {
        path: '/fireControl/transformer',
        name: 'fireControlTransformer',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '变压器排油注氮灭火项目',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'MagicStick'
        },
        children: [
          {
            path: '/fireControl/transformer/index',
            name: 'fireControlTransformerIndex',
            component: () => import('@/views/edit/index.vue'),
            meta: {
              title: '变压器排油注氮灭火',
              hidden: true,
              treeHidden: false,
              bottomHidden: true,
              menuIcon: 'MagicStick'
            }
          },
          {
            path: '/fireFighting/transformer/host',
            name: 'fireFightingTransformerHost',
            component: () => import('@/views/edit/index.vue'),
            meta: {
              title: '主机',
              hidden: false,
              treeHidden: false,
              bottomHidden: false,
              menuIcon: 'Monitor'
            }
          },
          {
            path: '/fireFighting/transformer/floor',
            name: 'fireFightingTransformerFloor',
            component: () => import('@/views/edit/index.vue'),
            meta: {
              title: '2 号主变排油注氮灭火',
              hidden: false,
              treeHidden: false,
              bottomHidden: false,
              menuIcon: 'Brush'
            }
          }
        ]
      },
      {
        path: '/fireFighting/fireCock',
        name: 'fireFightingFireCock',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '消火栓系统',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'Place'
        }
      },
      {
        path: '/fireFighting/configuration',
        name: 'fireFightingConfiguration',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '灭火器配置',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'Files'
        }
      },
      {
        path: '/fireFighting/indicate',
        name: 'fireFightingIndicator',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '消防应急照明及疏散指示系统',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'Sunset'
        }
      }
    ]
  },
  {
    path: '/security',
    name: 'security',
    meta: { title: '安全防范项目', hidden: false, treeHidden: false, bottomHidden: false },
    children: [
      {
        path: '/security/index',
        name: 'securityIndex',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '安全防范',
          hidden: true,
          treeHidden: false,
          bottomHidden: true,
          menuIcon: 'CircleCheck'
        }
      },
      {
        path: '/security/perimeter',
        name: 'securityPerimeter',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '变电站周界',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'Money'
        }
      },
      {
        path: '/security/infrared',
        name: 'securityInfrared',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '室内红外双鉴',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'SetUp'
        }
      },
      {
        path: '/security/accessControl',
        name: 'accessControl',
        meta: { title: '门禁控制项目', hidden: false, treeHidden: false, bottomHidden: false },
        children: [
          {
            path: '/security/accessControl/index',
            name: 'securityAccessControlIndex',
            component: () => import('@/views/edit/index.vue'),
            meta: {
              title: '门禁控制',
              hidden: true,
              treeHidden: false,
              bottomHidden: true,
              menuIcon: 'Refrigerator'
            }
          },
          {
            path: '/security/accessControl/controller',
            name: 'productionBuildingFirstController',
            component: () => import('@/views/edit/index.vue'),
            meta: {
              title: '生产综合楼一楼门禁控制器 项目',
              hidden: false,
              treeHidden: false,
              bottomHidden: false,
              menuIcon: 'OfficeBuilding'
            }
          }
        ]
      },
      {
        path: '/security/accessRecords',
        name: 'accessRecords',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '门禁记录',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'Document'
        }
      }
    ]
  },
  {
    path: '/monitoring',
    name: 'monitoring',
    meta: { title: '在线监测项目', hidden: false, treeHidden: false, bottomHidden: false },
    children: [
      {
        path: '/monitoring/index',
        name: 'monitoringIndex',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '在线监测',
          hidden: true,
          treeHidden: false,
          bottomHidden: true,
          menuIcon: 'Notebook'
        }
      },
      {
        path: '/monitoring/oilChromatography',
        name: 'oilChromatographyOnline',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '油色谱在线监测项目',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'Postcard'
        },
        children: [
          {
            path: '/monitoring/oilChromatography/index',
            name: 'oilChromatographyIndex',
            component: () => import('@/views/edit/index.vue'),
            meta: {
              title: '油色谱在线监测',
              hidden: true,
              treeHidden: false,
              bottomHidden: true,
              menuIcon: 'Postcard'
            }
          },
          {
            path: '/monitoring/oilChromatography/no2',
            name: 'no2MainTransformerOilChromatography',
            component: () => import('@/views/edit/index.vue'),
            meta: {
              title: '2 号主变油色谱',
              hidden: false,
              treeHidden: false,
              bottomHidden: false,
              menuIcon: 'CollectionTag'
            }
          }
        ]
      },
      {
        path: '/monitoring/partialDischarge',
        name: 'mainTransformerPartialDischarge',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '主变局放在线监测项目',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'Reading'
        },
        children: [
          {
            path: '/monitoring/partialDischarge/index',
            name: 'monitoringPartialDischargeIndex',
            component: () => import('@/views/edit/index.vue'),
            meta: {
              title: '主变局放在线监测',
              hidden: true,
              treeHidden: false,
              bottomHidden: true,
              menuIcon: 'Filter'
            }
          },
          {
            path: '/monitoring/partialDischarge/no2',
            name: 'no2MainTransformerPartialDischarge',
            component: () => import('@/views/edit/index.vue'),
            meta: {
              title: '2 号主变局放',
              hidden: false,
              treeHidden: false,
              bottomHidden: false,
              menuIcon: 'CollectionTag'
            }
          }
        ]
      },
      {
        path: '/monitoring/gisDischarge',
        name: 'gisPartialDischarge',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: 'GIS局放在线监测项目',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'PieChart'
        },
        children: [
          {
            path: '/monitoring/gisDischarge/index',
            name: 'gisPartialDischargeIndex',
            component: () => import('@/views/edit/index.vue'),
            meta: {
              title: 'GIS局放在线监测',
              hidden: true,
              treeHidden: false,
              bottomHidden: true,
              menuIcon: 'Coin'
            }
          },
          {
            path: '/monitoring/gisDischarge/switch2215',
            name: 'switch2215Interval',
            component: () => import('@/views/edit/index.vue'),
            meta: {
              title: '2215 开关间隔',
              hidden: false,
              treeHidden: false,
              bottomHidden: false,
              menuIcon: 'CollectionTag'
            }
          }
        ]
      },
      {
        path: '/monitoring/arrester',
        name: 'arresterMonitoring',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '避雷器在线监测项目',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'Lightning'
        },
        children: [
          {
            path: '/monitoring/arrester/index',
            name: 'arresterMonitoringIndex',
            component: () => import('@/views/edit/index.vue'),
            meta: {
              title: '避雷器在线监测',
              hidden: true,
              treeHidden: false,
              bottomHidden: true,
              menuIcon: 'Lightning'
            }
          },
          {
            path: '/monitoring/arrester/220kv',
            name: 'arrester220kvMonitoring',
            component: () => import('@/views/edit/index.vue'),
            meta: {
              title: '220kV 避雷器在线监测',
              hidden: false,
              treeHidden: false,
              bottomHidden: false,
              menuIcon: 'CollectionTag'
            }
          }
        ]
      },
      {
        path: '/monitoring/sf6Pressure',
        name: 'gisSf6Pressure',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: 'GIS气室SF6 压力监测项目',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'ChatSquare'
        },
        children: [
          {
            path: '/monitoring/sf6Pressure/index',
            name: 'gisSf6PressureIndex',
            component: () => import('@/views/edit/index.vue'),
            meta: {
              title: 'GIS气室SF6 压力监测',
              hidden: true,
              treeHidden: false,
              bottomHidden: true,
              menuIcon: 'Finished'
            }
          },
          {
            path: '/monitoring/sf6Pressure/interval2245',
            name: 'interval2245',
            component: () => import('@/views/edit/index.vue'),
            meta: {
              title: '2245 甲母联间隔',
              hidden: false,
              treeHidden: false,
              bottomHidden: false,
              menuIcon: 'CollectionTag'
            }
          }
        ]
      },
      {
        path: '/monitoring/sf6Leakage',
        name: 'sf6Leakage',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '室内SF6 气体泄露监测',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'Film'
        }
      }
    ]
  },
  {
    path: '/environment',
    name: 'environment',
    meta: { title: '环境监控项目', hidden: false, treeHidden: false, bottomHidden: false },
    children: [
      {
        path: '/environment/index',
        name: 'environmentIndex',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '环境监控',
          hidden: true,
          treeHidden: false,
          bottomHidden: true,
          menuIcon: 'MagicStick'
        }
      },
      {
        path: '/environment/weather',
        name: 'substationWeather',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '站区气象监测',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'Cloudy'
        }
      },
      {
        path: '/environment/acHeating',
        name: 'buildingAcHeating',
        meta: {
          title: '生产综合楼空调暖通项目',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'Sunrise'
        },
        children: [
          {
            path: '/environment/acHeating/index',
            name: 'buildingAcHeatingIndex',
            component: () => import('@/views/edit/index.vue'),
            meta: {
              title: '生产综合楼空调暖通',
              hidden: true,
              treeHidden: false,
              bottomHidden: true,
              menuIcon: 'Sunrise'
            }
          },
          {
            path: '/environment/acHeating/building',
            name: 'productionBuilding',
            component: () => import('@/views/edit/index.vue'),
            meta: {
              title: '生产综合楼',
              hidden: false,
              treeHidden: false,
              bottomHidden: false,
              menuIcon: 'OfficeBuilding'
            }
          }
        ]
      },
      {
        path: '/environment/threshold',
        name: 'thresholdSetting',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '阈值设置',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'Operation'
        }
      }
    ]
  },
  {
    path: '/lighting',
    name: 'lighting',
    meta: { title: '照明控制项目', hidden: false, treeHidden: false, bottomHidden: false },
    children: [
      {
        path: '/lighting/index',
        name: 'lightingIndex',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '照明控制',
          hidden: true,
          treeHidden: false,
          bottomHidden: true,
          menuIcon: 'Sunny'
        }
      },
      {
        path: '/lighting/acHeating',
        name: 'buildingLightingAcHeating',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '生产综合楼1楼空调暖通',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'Sunset'
        }
      },
      {
        path: '/lighting/linkage',
        name: 'linkageConfiguration',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '联动配置',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'Operation'
        }
      }
    ]
  },
  {
    path: '/waterSupply',
    name: 'waterSupply',
    meta: {
      title: '给排水系统项目',
      hidden: false,
      treeHidden: false,
      bottomHidden: false,
      menuIcon: 'Operation'
    },
    children: [
      {
        path: '/waterSupply/index',
        name: 'waterSupplyIndex',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '给排水系统',
          hidden: true,
          treeHidden: false,
          bottomHidden: true,
          menuIcon: 'Pouring'
        }
      },
      {
        path: '/waterSupply/waterSupply',
        name: 'waterSupplySystem',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '给水系统',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'Place'
        }
      },
      {
        path: '/waterSupply/drainage',
        name: 'drainageSystem',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '排水系统',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'MapLocation'
        }
      },
      {
        path: '/waterSupply/threshold',
        name: 'waterThresholdSetting',
        component: () => import('@/views/edit/index.vue'),
        meta: {
          title: '阈值设置',
          hidden: false,
          treeHidden: false,
          bottomHidden: false,
          menuIcon: 'Setting'
        }
      }
    ]
  }
];

const router = createRouter({
  history: createWebHistory(), // hash模式：createWebHashHistory，history模式：createWebHistory
  routes: constantRoutes
});

export default router;
