change
This commit is contained in:
@@ -1,16 +1,21 @@
|
||||
<template>
|
||||
<section class="box">
|
||||
<t-header :title="title1">
|
||||
<p class="p1" @click="toJump">{{title2}}</p>
|
||||
</t-header>
|
||||
<Monitoring-Screen v-if="page === 'two'"></Monitoring-Screen>
|
||||
<Device-Screen v-if="page === 'one'"></Device-Screen>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import THeader from '@components/header.vue'
|
||||
import MonitoringScreen from './MonitoringScreen.vue'
|
||||
import DeviceScreen from './DeviceScreen.vue'
|
||||
export default {
|
||||
name: 'HomeScreen',
|
||||
components: {
|
||||
THeader,
|
||||
MonitoringScreen,
|
||||
DeviceScreen
|
||||
},
|
||||
@@ -21,14 +26,38 @@ export default {
|
||||
iTime: this.$store.getters.setTime1
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title1 () {
|
||||
let t = ''
|
||||
t = this.page === 'one' ? '海亮铜管智能车间设备监控中心' : '海亮铜管智能车间生产监控中心'
|
||||
return t
|
||||
},
|
||||
title2 () {
|
||||
let t = ''
|
||||
t = this.page === 'two' ? '海亮铜管智能车间设备监控中心' : '海亮铜管智能车间生产监控中心'
|
||||
return t
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.swipePage()
|
||||
},
|
||||
beforeDestroy () {
|
||||
this.$once('hook:beforeDestroy', () => {
|
||||
clearInterval(this.timer)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
swipePage () {
|
||||
this.timer = setInterval(() => {
|
||||
this.page = this.page === 'one' ? 'two' : 'one'
|
||||
}, this.iTime)
|
||||
},
|
||||
toJump () {
|
||||
window.clearInterval(this.timer)
|
||||
this.page = this.page === 'one' ? 'two' : 'one'
|
||||
setTimeout(() => {
|
||||
this.swipePage()
|
||||
}, 2000)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,4 +68,13 @@ export default {
|
||||
.box
|
||||
_wh(100%, 100%)
|
||||
overflow hidden
|
||||
.p1
|
||||
position absolute
|
||||
display block
|
||||
cursor pointer
|
||||
left .2509rem
|
||||
top .22rem
|
||||
font-family "SourceHanSansCN"
|
||||
_font(.18rem, .30rem, #fff, 700,)
|
||||
letter-spacing .01rem
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user