大盘路由切换

This commit is contained in:
hh
2021-12-03 17:05:42 +08:00
parent fa1b1afb30
commit 7fac981048
6 changed files with 129 additions and 31 deletions

View File

@ -39,6 +39,11 @@ export const constantRoutes = [
component: (resolve) => require(['@/views/bigScreen/drivingCabin/index'], resolve), component: (resolve) => require(['@/views/bigScreen/drivingCabin/index'], resolve),
name: 'drivingCabin', name: 'drivingCabin',
}, },
{
path: 'scientific',
component: (resolve) => require(['@/views/bigScreen/scientific/index'], resolve),
name: 'scientific',
},
] ]
}, },
{ {

View File

@ -1,9 +1,85 @@
<template> <template>
<router-view /> <scalseBox>
<div class="digScreenLayout">
<div class="bg1"></div>
<bigScreenHead></bigScreenHead>
<router-view class="content"/>
</div>
</scalseBox>
</template> </template>
<script> <script>
import scalseBox from './components/scaleBox.vue'
import bigScreenHead from "./components/bigScreenHead/index.vue";
export default { export default {
name: 'BigScreenLayout', name: 'DigScreenLayout',
components: {
scalseBox,
bigScreenHead,
}
} }
</script> </script>
<style lang="scss" scoped>
.digScreenLayout {
position: relative;
width: 1920px;
height: 1080px;
background-color: #0D1049;
// background-image: url("../img/bg.png");
background-size: cover;
display: flex;
flex-direction: column;
.content {
flex: 1;
}
.bg1 {
position: absolute;
bottom: 0;
left: 0;
width: 1920px;
height: 485px;
background-image: url("./img/bg-1.png");
background-size: cover;
}
}
.left1 {
position: absolute;
top: 120px;
left: 24px;
}
.left2 {
position: absolute;
top: 345px;
left: 24px;
}
.center1 {
position: absolute;
top: 107px;
left: 578px;
}
.right1 {
position: absolute;
top: 120px;
right: 24px;
}
.right2 {
position: absolute;
top: 345px;
right: 24px;
}
.bottom1 {
position: absolute;
bottom: 16px;
left: 24px;
}
.bottom2 {
position: absolute;
bottom: 16px;
right: 24px;
}
</style>

View File

@ -1,23 +1,26 @@
<template> <template>
<div class="bigScreenBtn" :class="{selected:selected}"> <router-link :to="routerUrl">
<div>{{title}}</div> <div class="bigScreenBtn" :class="{selected:this.$route.path == routerUrl}">
</div> <div>{{title}}</div>
</div>
</router-link>
</template> </template>
<script> <script>
export default { export default {
name: 'BigScreenBtn', name: 'BigScreenBtn',
props: { props: {
routerUrl: {
type: String,
default: '',
},
title: { title: {
type: String, type: String,
default: '按钮', default: '按钮',
}, },
selected: {
type: Boolean,
default: false,
},
}, },
data () { data () {
return { return {
@ -44,7 +47,7 @@ export default {
background-image: url(./default.png); background-image: url(./default.png);
} }
.bigScreenBtn:hover { .bigScreenBtn:hover {
opacity: .8; opacity: 0.8;
} }
.bigScreenBtn.selected { .bigScreenBtn.selected {

View File

@ -7,13 +7,13 @@
<el-col :span="8"> <el-col :span="8">
<el-row style="padding: 0px 20px"> <el-row style="padding: 0px 20px">
<el-col :span="8"> <el-col :span="8">
<bigScreenBtn title="驾驶舱总览" :selected="true"></bigScreenBtn> <bigScreenBtn title="驾驶舱总览" routerUrl="/bigScreen/drivingCabin"></bigScreenBtn>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<bigScreenBtn title="科研生产" :selected="false"></bigScreenBtn> <bigScreenBtn title="科研生产" routerUrl="/bigScreen/scientific"></bigScreenBtn>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<bigScreenBtn title="经营管理" :selected="false"></bigScreenBtn> <bigScreenBtn title="经营管理"></bigScreenBtn>
</el-col> </el-col>
</el-row> </el-row>
</el-col> </el-col>
@ -22,13 +22,13 @@
<el-col :span="8"> <el-col :span="8">
<el-row style="padding: 0px 0 0 60px"> <el-row style="padding: 0px 0 0 60px">
<el-col :span="8"> <el-col :span="8">
<bigScreenBtn title="质量管理" :selected="false"></bigScreenBtn> <bigScreenBtn title="质量管理"></bigScreenBtn>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<bigScreenBtn title="安全管理" :selected="false"></bigScreenBtn> <bigScreenBtn title="安全管理"></bigScreenBtn>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<bigScreenBtn title="信息化管理" :selected="false"></bigScreenBtn> <bigScreenBtn title="信息化管理"></bigScreenBtn>
</el-col> </el-col>
</el-row> </el-row>
</el-col> </el-col>

View File

@ -1,8 +1,9 @@
<template> <template>
<scalseBox>
<div class="drivingCabin"> <div class="drivingCabin">
<div class="bg1"></div> <div class="left1">
<bigScreenHead></bigScreenHead> <left1></left1>
</div>
<!-- <div class="bg1"></div> -->
<div class="left1"> <div class="left1">
<left1></left1> <left1></left1>
@ -25,10 +26,7 @@
<div class="bottom2"> <div class="bottom2">
<bottom2></bottom2> <bottom2></bottom2>
</div> </div>
</div> </div>
</scalseBox>
</template> </template>
<script> <script>
@ -66,9 +64,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.drivingCabin { .drivingCabin {
position: relative; position: relative;
width: 1920px; width: 100%;
height: 1080px;
background-color: #0D1049;
// background-image: url("../img/bg.png"); // background-image: url("../img/bg.png");
background-size: cover; background-size: cover;
.bg1 { .bg1 {
@ -84,28 +80,28 @@ export default {
.left1 { .left1 {
position: absolute; position: absolute;
top: 120px; top: 20px;
left: 24px; left: 24px;
} }
.left2 { .left2 {
position: absolute; position: absolute;
top: 345px; top: 245px;
left: 24px; left: 24px;
} }
.center1 { .center1 {
position: absolute; position: absolute;
top: 107px; top: 7px;
left: 578px; left: 578px;
} }
.right1 { .right1 {
position: absolute; position: absolute;
top: 120px; top: 20px;
right: 24px; right: 24px;
} }
.right2 { .right2 {
position: absolute; position: absolute;
top: 345px; top: 245px;
right: 24px; right: 24px;
} }
.bottom1 { .bottom1 {

View File

@ -0,0 +1,18 @@
<template>
<div class="scientific">
科研生产
</div>
</template>
<script>
export default {
name: 'Scientific',
components: {
}
}
</script>
<style lang="scss" scoped>
</style>