263 lines
7.4 KiB
JavaScript
263 lines
7.4 KiB
JavaScript
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'
|
|
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: '/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: '/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: '/control',
|
|
name: 'control',
|
|
component: control,
|
|
redirect: '/skylight',
|
|
children: [{
|
|
path: '/skylight',
|
|
name: 'skylight',
|
|
component: () => import('../views/page/skylight.vue')
|
|
},{
|
|
path: '/fan',
|
|
name: 'fan',
|
|
component: () => import('../views/page/fan.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: '/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: '/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')
|
|
}]
|
|
},
|
|
]
|
|
|
|
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
|