import Vue from 'vue' import VueRouter from 'vue-router' import HomeView from '../views/HomeView.vue' import index from '../views/index.vue' import login from '../views/login.vue' import control from '../views/control.vue' import soil from '../views/soil.vue' Vue.use(VueRouter) const routes = [ { path: '/', name: 'login', component: login, }, { path: '/home', name: 'home', component: HomeView, redirect: '/status', children: [{ path: '/status', name: 'status', component: () => import('../views/page/status.vue') },] }, { path: '/largeScreen', name: 'largeScreen', component: () => import('../views/page/largeScreen.vue') }, { path: '/videoLive', name: 'videoLive', component: () => import('../views/videoLive.vue') }, { path: '/largeScreen1', name: 'largeScreen1', component: () => import('../views/page/largeScreen1.vue') }, { path: '/index', name: 'index', component: index, redirect: '/realTime', children: [{ path: '/realTime', name: 'realTime', component: () => import('../views/page/realTime.vue') },{ path: '/formula', name: 'formula', component: () => import('../views/page/formula.vue') },{ path: '/historyData', name: 'historyData', component: () => import('../views/page/historyData.vue') },{ path: '/imageData', name: 'imageData', component: () => import('../views/page/imageData.vue') },{ path: '/videoMonitoring', name: 'videoMonitoring', component: () => import('../views/page/videoMonitoring.vue') },{ path: '/irrigateSet', name: 'irrigateSet', component: () => import('../views/page/irrigateSet.vue') },{ path: '/PIDSet', name: 'PIDSet', component: () => import('../views/page/PIDSet.vue') },{ path: '/systemSet', name: 'systemSet', component: () => import('../views/page/systemSet.vue') },{ path: '/upload', name: 'upload', component: () => import('../views/page/upload.vue') },{ path: '/sensorSet', name: 'sensorSet', component: () => import('../views/page/sensorSet.vue') },{ path: '/history', name: 'history', component: () => import('../views/page/history.vue') },{ path: '/dataAnalysis', name: 'dataAnalysis', component: () => import('../views/page/dataAnalysis.vue') },{ path: '/systemManage', name: 'systemManage', component: () => import('../views/page/systemManage.vue') },{ path: '/manage', name: 'manage', component: () => import('../views/manage/index.vue'), redirect: '/deviceStatusSet', children:[{ path: '/deviceStatusSet', name: 'deviceStatusSet', component: () => import('../views/manage/deviceStatusSet.vue') },{ path: '/deviceSet', name: 'deviceSet', component: () => import('../views/manage/deviceSet.vue') },{ path: '/deviceInfoManage', name: 'deviceInfoManage', component: () => import('../views/manage/deviceInfoManage.vue') },{ path: '/weatherData', name: 'weatherData', component: () => import('../views/manage/weatherData.vue') },{ path: '/dataDevice', name: 'dataDevice', component: () => import('../views/manage/dataDevice.vue') },{ path: '/mobileControl', name: 'mobileControl', component: () => import('../views/manage/mobileControl.vue') },{ path: '/userInfoControl', name: 'userInfoControl', component: () => import('../views/manage/userInfoControl.vue') },{ path: '/deviceManage', name: 'deviceManage', component: () => import('../views/manage/deviceManage.vue') },{ path: '/videoManage', name: 'videoManage', component: () => import('../views/manage/videoManage.vue') },] }, { path: '/control', name: 'control', component: control, children: [{ path: '/fan', name: 'fan', component: () => import('../views/page/fan.vue') },{ path: '/CO2', name: 'CO2', component: () => import('../views/page/CO2.vue') },{ path: '/heatFan', name: 'heatFan', component: () => import('../views/page/heatFan.vue') },{ path: '/skylight', name: 'skylight', component: () => import('../views/page/skylight.vue') },{ path: '/upload-con', name: 'upload-con', component: () => import('../views/page/upload-con.vue') },{ path: '/sensorSet-con', name: 'sensorSet-con', component: () => import('../views/page/sensorSet-con.vue') },{ path: '/synthesis-con', name: 'synthesis-con', component: () => import('../views/page/synthesis-con.vue') },{ path: '/waterPump', name: 'waterPump', component: () => import('../views/wufang/waterPump.vue') },{ path: '/geothermalFan', name: 'geothermalFan', component: () => import('../views/wufang/geothermalFan.vue') },{ path: '/uptake', name: 'uptake', component: () => import('../views/wufang/uptake.vue') },{ path: '/downtake', name: 'downtake', component: () => import('../views/wufang/downtake.vue') },{ path: '/rollByRoll', name: 'rollByRoll', component: () => import('../views/wufang/rollByRoll.vue') },{ path: '/snowRemoval', name: 'snowRemoval', component: () => import('../views/wufang/snowRemoval.vue') },{ path: '/targetTemperature', name: 'targetTemperature', component: () => import('../views/page/targetTemperature.vue') },{ path: '/targetHumidity', name: 'targetHumidity', component: () => import('../views/page/targetHumidity.vue') },{ path: '/targetCo2', name: 'targetCo2', component: () => import('../views/page/targetCo2.vue') },{ path: '/sunroofControl', name: 'sunroofControl', component: () => import('../views/page/sunroofControl.vue') },{ path: '/outsizeSunshade', name: 'outsizeSunshade', component: () => import('../views/page/outsizeSunshade.vue') },{ path: '/insizeSunshade', name: 'insizeSunshade', component: () => import('../views/page/insizeSunshade.vue') },{ path: '/wetFan', name: 'wetFan', component: () => import('../views/page/wetFan.vue') },{ path: '/air-conditioning', name: 'air-conditioning', component: () => import('../views/page/air-conditioning.vue') },{ path: '/LED', name: 'LED', component: () => import('../views/page/LED.vue') },{ path: '/electromagneticControl', name: 'electromagneticControl', component: () => import('../views/page/electromagneticControl.vue') },{ path: '/coercionMist', name: 'coercionMist', component: () => import('../views/page/coercionMist.vue') },{ path: '/circulationCan', name: 'circulationCan', component: () => import('../views/page/circulationCan.vue') },{ path: '/internalInsulation', name: 'internalInsulation', component: () => import('../views/page/internalInsulation.vue') },{ path: '/forceOutput', name: 'forceOutput', component: () => import('../views/page/forceOutput.vue') },{ path: '/intrinsicParameter', name: 'intrinsicParameter', component: () => import('../views/page/intrinsicParameter.vue') },{ path: '/parameterSet', name: 'parameterSet', component: () => import('../views/page/parameterSet.vue') },{ path: '/alarmSettings', name: 'alarmSettings', component: () => import('../views/page/alarmSettings.vue') },{ path: '/exitSettings', name: 'exitSettings', component: () => import('../views/page/exitSettings.vue') },{ path: '/systemSet-con', name: 'systemSet-con', component: () => import('../views/page/systemSet-con.vue') },{ path: '/facadeInsulation', name: 'facadeInsulation', component: () => import('../views/page/facadeInsulation.vue') },] }, { path: '/soil', name: 'soil', component: soil, redirect: '/irrigateSet-soil', children: [{ path: '/irrigateSet-soil', name: 'irrigateSet-soil', component: () => import('../views/page/irrigateSet-soil.vue') },{ path: '/intrinsicParameter-soil', name: 'intrinsicParameter-soil', component: () => import('../views/page/intrinsicParameter-soil.vue') },{ path: '/systemSet-soil', name: 'systemSet-soil', component: () => import('../views/page/systemSet-soil.vue') },{ path: '/upload-soil', name: 'upload-soil', component: () => import('../views/page/upload-soil.vue') },{ path: '/sensorSet-soil', name: 'sensorSet-soil', component: () => import('../views/page/sensorSet-soil.vue') },{ path: '/status-soil', name: 'status-soil', component: () => import('../views/page/status-soil.vue') },] },] }, { path: '/vrcode', name: 'vrcode', component: () => import('../views/vrcode.vue'), redirect: '/plantingPlan', children: [{ path: '/plantingPlan', name: 'plantingPlan', component: () => import('../views/vrcode/plantingPlan.vue') }, { path: '/agricultural', name: 'agricultural', component: () => import('../views/vrcode/agricultural.vue') }, { path: '/sprayInsecticide', name: 'sprayInsecticide', component: () => import('../views/vrcode/sprayInsecticide.vue') }, { path: '/spreadManure', name: 'spreadManure', component: () => import('../views/vrcode/spreadManure.vue') }, { path: '/pickingRecords', name: 'pickingRecords', component: () => import('../views/vrcode/pickingRecords.vue') }, { path: '/productTraceability', name: 'productTraceability', component: () => import('../views/vrcode/productTraceability.vue') }, { path: '/setsuyuan', name: 'setsuyuan', component: () => import('../views/vrcode/setsuyuan.vue') },{ path: '/clearReport', name: 'clearReport', component: () => import('../views/vrcode/clearReport.vue') },{ path: '/pestManagement', name: 'pestManagement', component: () => import('../views/vrcode/pestManagement.vue') },{ path: '/suyuanBatch', name: 'suyuanBatch', component: () => import('../views/vrcode/suyuanBatch.vue') },{ path: '/reportLibrary', name: 'reportLibrary', component: () => import('../views/vrcode/reportLibrary.vue') },{ path: '/cropVarieties', name: 'cropVarieties', component: () => import('../views/vrcode/cropVarieties.vue') },{ path: '/croppingPattern', name: 'croppingPattern', component: () => import('../views/vrcode/croppingPattern.vue') },{ path: '/agriculturalProcess', name: 'agriculturalProcess', component: () => import('../views/vrcode/agriculturalProcess.vue') },{ path: '/staffManagement', name: 'staffManagement', component: () => import('../views/vrcode/staffManagement.vue') },{ path: '/supplierManage', name: 'supplierManage', component: () => import('../views/vrcode/supplierManage.vue') },{ path: '/informationManage', name: 'informationManage', component: () => import('../views/vrcode/informationManage.vue') },{ path: '/machineManagement', name: 'machineManagement', component: () => import('../views/vrcode/machineManagement.vue') },{ path: '/cropManagement', name: 'cropManagement', component: () => import('../views/vrcode/cropManagement.vue') },{ path: '/farmManage', name: 'farmManage', component: () => import('../views/vrcode/farmManage.vue') }, ] }, ] const router = new VueRouter({ mode: 'hash', base: process.env.BASE_URL, routes }) router.beforeEach(async (to,from,next) => { if (to.meta.title) { // 判断是否有标题 document.title = to.meta.title; }else{ document.title ='温室智慧云' } next(); }); export default router