Files
screen-hl-one/src/pages/HomeScreen.vue

85 lines
1.9 KiB
Vue
Raw Normal View History

2022-07-29 18:41:53 +08:00
<template>
<section class="box">
2022-08-01 11:16:17 +08:00
<t-header :title="title1">
<p class="p1" @click="toJump">{{title2}}</p>
</t-header>
2022-07-29 18:41:53 +08:00
<Monitoring-Screen v-if="page === 'two'"></Monitoring-Screen>
<Device-Screen v-if="page === 'one'"></Device-Screen>
2022-08-01 12:28:31 +08:00
<section class="bottom"></section>
2022-07-29 18:41:53 +08:00
</section>
</template>
<script>
2022-08-01 11:16:17 +08:00
import THeader from '@components/header.vue'
2022-07-29 18:41:53 +08:00
import MonitoringScreen from './MonitoringScreen.vue'
import DeviceScreen from './DeviceScreen.vue'
export default {
name: 'HomeScreen',
components: {
2022-08-01 11:16:17 +08:00
THeader,
2022-07-29 18:41:53 +08:00
MonitoringScreen,
DeviceScreen
},
data () {
return {
page: 'one',
2022-07-29 18:45:27 +08:00
timer: null,
iTime: this.$store.getters.setTime1
2022-07-29 18:41:53 +08:00
}
},
2022-08-01 11:16:17 +08:00
computed: {
title1 () {
let t = ''
t = this.page === 'one' ? '海亮铜管智能车间设备监控中心' : '海亮铜管智能车间生产监控中心'
return t
},
title2 () {
let t = ''
t = this.page === 'two' ? '海亮铜管智能车间设备监控中心' : '海亮铜管智能车间生产监控中心'
return t
}
},
2022-07-29 18:41:53 +08:00
mounted () {
this.swipePage()
},
2022-08-01 11:16:17 +08:00
beforeDestroy () {
this.$once('hook:beforeDestroy', () => {
clearInterval(this.timer)
})
},
2022-07-29 18:41:53 +08:00
methods: {
swipePage () {
this.timer = setInterval(() => {
this.page = this.page === 'one' ? 'two' : 'one'
2022-07-29 18:45:27 +08:00
}, this.iTime)
2022-08-01 11:16:17 +08:00
},
toJump () {
2022-08-01 11:32:39 +08:00
clearInterval(this.timer)
2022-08-01 11:16:17 +08:00
this.page = this.page === 'one' ? 'two' : 'one'
setTimeout(() => {
this.swipePage()
}, 2000)
2022-07-29 18:41:53 +08:00
}
}
}
</script>
<style lang="stylus" scoped>
@import '~@css/mixin'
.box
_wh(100%, 100%)
overflow hidden
2022-08-01 11:16:17 +08:00
.p1
position absolute
display block
cursor pointer
left .2509rem
top .22rem
font-family "SourceHanSansCN"
_font(.18rem, .30rem, #fff, 700,)
letter-spacing .01rem
2022-08-01 12:28:31 +08:00
.bottom
_wh(100%, .38rem)
background center bottom / 19.06rem 100% url(../assets/images/screen1/bottom.png) no-repeat
2022-07-29 18:41:53 +08:00
</style>