Commit 2743b7d6 authored by 车宾's avatar 车宾

feat(led工位级大屏):时间,轮播功能。功能联调(10%)

parent 4bda7ea6
...@@ -22,7 +22,8 @@ import formValidator from '@/utils/formValidator/index'; ...@@ -22,7 +22,8 @@ import formValidator from '@/utils/formValidator/index';
// if (process.env.NODE_ENV === 'development') { require('./mock') } // mock // if (process.env.NODE_ENV === 'development') { require('./mock') } // mock
import Authority from '../src/utils/authority'; import Authority from '../src/utils/authority';
import vueSwiper from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css' //引入样式
Vue.prototype._ = lodash; Vue.prototype._ = lodash;
Vue.prototype.formValidator = formValidator; Vue.prototype.formValidator = formValidator;
Vue.config.productionTip = false Vue.config.productionTip = false
...@@ -40,6 +41,7 @@ new Vue({ ...@@ -40,6 +41,7 @@ new Vue({
router, router,
store, store,
i18n, i18n,
vueSwiper,
render: h => h(App) render: h => h(App)
}) })
<template> <template>
<div class="page-pack"> <div class="page-pack">
<div class="container"> <div class="container" :style="{transform: zoom}" style="transform-origin: 0 0">
<!-- 设备利用率 --> <!-- 设备利用率 -->
<MachineUtilizationRate></MachineUtilizationRate> <MachineUtilizationRate></MachineUtilizationRate>
<!-- 设备故障率 --> <!-- 设备故障率 -->
...@@ -39,7 +39,18 @@ ...@@ -39,7 +39,18 @@
MachineWarning MachineWarning
}, },
data () { data () {
return {} return {
zoom: 'scale(0)',
width: 0,
height: 0
}
},
mounted () {
this.width = document.body.offsetWidth
this.height = document.body.offsetHeight
this.zoom = `scale(${this.width / 2550},${this.height / 1140})`
console.log(this.zoom)
console.log(this.width)
} }
} }
</script> </script>
...@@ -58,4 +69,4 @@ ...@@ -58,4 +69,4 @@
position: relative; position: relative;
} }
} }
</style> </style>
\ No newline at end of file
<template> <template>
<div class="page-pack"> <div class="page-pack" :style="{transform: zoom}" style="transform-origin: 0 0">
<div class="title-pack">中涂人工</div> <div class="title-pack">中涂人工</div>
<div class="table-pack"> <div class="table-pack">
<div class="tr"> <div class="tr">
...@@ -16,18 +16,37 @@ ...@@ -16,18 +16,37 @@
</div> </div>
<div class="info"> <div class="info">
设备报警信息: 设备报警信息:
<div>&nbsp;</div>
<swiper :options="swiperOption" ref="mySwiper" @someSwiperEvent="callback">
<swiper-slide>I'mSlide14455555555555 58866666666666666555589</swiper-slide>
<swiper-slide>I'55589</swiper-slide>
<swiper-slide>I'mSlide144556666666666666555589</swiper-slide>
</swiper>
</div> </div>
<div class="time">时间:2019-08-29 09:00:00</div> <div class="time">时间:{{ timeNow }}</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { swiper, swiperSlide } from 'vue-awesome-swiper'
export default { export default {
components: {
swiper,
swiperSlide
},
data () { data () {
return { return {
width: 0, width: 0,
height: 0 height: 0,
zoom: 'scale(0)',
timeNow: '',
timer: '',
swiperOption: {
autoplay: {
delay: 5000
}
}
} }
}, },
methods: {}, methods: {},
...@@ -35,6 +54,7 @@ ...@@ -35,6 +54,7 @@
setTimeout(() => { setTimeout(() => {
this.width = document.body.offsetWidth this.width = document.body.offsetWidth
this.height = document.body.offsetHeight this.height = document.body.offsetHeight
this.zoom = `scale(${this.width / 1710})`
}, 3000) }, 3000)
} }
} }
......
...@@ -12,37 +12,77 @@ ...@@ -12,37 +12,77 @@
</div> </div>
<div class="info"> <div class="info">
设备报警信息: 设备报警信息:
<div>&nbsp;</div>
<swiper :options="swiperOption" ref="mySwiper">
<swiper-slide>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I'mSlide14455555555555 58866666666666666555589</swiper-slide>
<swiper-slide>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I'55589</swiper-slide>
<swiper-slide>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I'mSlide144556666666666666555589</swiper-slide>
</swiper>
</div> </div>
<div class="time">时间:2019-08-29 09:00:00</div> <div class="time">时间:{{ formatTime(timeNow,'YYYY-MM-DD HH:mm:ss') }}</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { swiper, swiperSlide } from 'vue-awesome-swiper' import { swiper, swiperSlide } from 'vue-awesome-swiper'
import Moment from 'moment'
export default { export default {
// components: { components: {
// Empty, swiper,
// ProjectList, swiperSlide
// swiper, },
// swiperSlide
// },
data () { data () {
return { return {
width: 0, width: 0,
height: 0, height: 0,
zoom: 'scale(0)' zoom: 'scale(0)',
timeNow: '',
timer: '',
// minLength: null,
// minutes: null,
// secondsLength: null,
// seconds: null,
swiperOption: {
autoplay: {
delay: 5000
}
}
}
},
methods: {
// 时间日期格式化
formatTime (time, format) {
if (time !== null && time !== '') {
return Moment(time).format(format)
} else {
return '暂无'
}
},
getData () {
this.$fetch('led-controller/ledInfo-get', {ledNo: '1'}).then(res => {
console.log(res)
})
} }
}, },
methods: {},
mounted () { mounted () {
this.getData()
let vm = this
this.timer = setInterval(() => {
vm.timeNow = this.formatTime()
// console.log(this.timeNow)
}, 1000)
setTimeout(() => { setTimeout(() => {
this.width = document.body.offsetWidth this.width = document.body.offsetWidth
this.height = document.body.offsetHeight this.height = document.body.offsetHeight
this.zoom = `scale(${this.width / 1710})` this.zoom = `scale(${this.width / 1710})`
console.log(this.zoom) console.log(this.zoom)
}, 0) }, 0)
},
beforeDestroy () {
if (this.timer) {
clearInterval(this.timer); //在Vue实例销毁前,清除定时器
}
} }
} }
</script> </script>
......
<template> <template>
<div class="page-pack"> <div class="page-pack" :style="{transform: zoom}" style="transform-origin: 0 0">
<div class="title-pack">中涂机器人</div> <div class="title-pack">中涂机器人</div>
<div class="table-pack"> <div class="table-pack">
<div class="tr"> <div class="tr">
...@@ -27,7 +27,8 @@ ...@@ -27,7 +27,8 @@
data () { data () {
return { return {
width: 0, width: 0,
height: 0 height: 0,
zoom: 'scale(0)'
} }
}, },
methods: {}, methods: {},
...@@ -35,6 +36,7 @@ ...@@ -35,6 +36,7 @@
setTimeout(() => { setTimeout(() => {
this.width = document.body.offsetWidth this.width = document.body.offsetWidth
this.height = document.body.offsetHeight this.height = document.body.offsetHeight
this.zoom = `scale(${this.width / 1710})`
}, 3000) }, 3000)
} }
} }
......
<template> <template>
<div class="page-pack"> <div class="page-pack" :style="{transform: zoom}" style="transform-origin: 0 0;">
<div class="title-pack">隔热防腐</div> <div class="title-pack">隔热防腐</div>
<div class="table-pack"> <div class="table-pack">
<div class="tr"> <div class="tr">
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
data () { data () {
return { return {
width: 0, width: 0,
height: 0 height: 0,
zoom: 'scale(0)'
} }
}, },
methods: {}, methods: {},
...@@ -31,6 +32,8 @@ ...@@ -31,6 +32,8 @@
setTimeout(() => { setTimeout(() => {
this.width = document.body.offsetWidth this.width = document.body.offsetWidth
this.height = document.body.offsetHeight this.height = document.body.offsetHeight
this.zoom = `scale(${this.width / 1710})`
console.log(`scale(${this.width / 1710})`)
}, 3000) }, 3000)
} }
} }
......
<template> <template>
<div class="page-pack"> <div class="page-pack" :style="{transform: zoom}" style="transform-origin: 0 0">
<div class="title-pack">腻子</div> <div class="title-pack">腻子</div>
<div class="table-pack"> <div class="table-pack">
<div class="tr"> <div class="tr">
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
data () { data () {
return { return {
width: 0, width: 0,
height: 0 height: 0,
zoom: 'scale(0)'
} }
}, },
methods: {}, methods: {},
...@@ -31,6 +32,7 @@ ...@@ -31,6 +32,7 @@
setTimeout(() => { setTimeout(() => {
this.width = document.body.offsetWidth this.width = document.body.offsetWidth
this.height = document.body.offsetHeight this.height = document.body.offsetHeight
this.zoom = `scale(${this.width / 1710})`
}, 3000) }, 3000)
} }
} }
......
<template> <template>
<div class="page-pack"> <div class="page-pack" :style="{transform: zoom}" style="transform-origin: 0 0">
<div class="title-pack">喷漆室、烘干室</div> <div class="title-pack">喷漆室、烘干室</div>
<div class="table-pack"> <div class="table-pack">
<div class="tr clear-float"> <div class="tr clear-float">
...@@ -87,7 +87,8 @@ ...@@ -87,7 +87,8 @@
data () { data () {
return { return {
width: 0, width: 0,
height: 0 height: 0,
zoom: 'scale(0)'
} }
}, },
methods: {}, methods: {},
...@@ -95,6 +96,7 @@ ...@@ -95,6 +96,7 @@
setTimeout(() => { setTimeout(() => {
this.width = document.body.offsetWidth this.width = document.body.offsetWidth
this.height = document.body.offsetHeight this.height = document.body.offsetHeight
this.zoom = `scale(${this.width / 1710})`
}, 3000) }, 3000)
} }
} }
......
<template> <template>
<div class="page-pack"> <div class="page-pack" :style="{transform: zoom}" style="transform-origin: 0 0">
<div class="title-pack">面/清漆</div> <div class="title-pack">面/清漆</div>
<div class="table-pack"> <div class="table-pack">
<div class="tr"> <div class="tr">
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
data () { data () {
return { return {
width: 0, width: 0,
height: 0 height: 0,
zoom: 'scale(0)'
} }
}, },
methods: {}, methods: {},
...@@ -31,6 +32,7 @@ ...@@ -31,6 +32,7 @@
setTimeout(() => { setTimeout(() => {
this.width = document.body.offsetWidth this.width = document.body.offsetWidth
this.height = document.body.offsetHeight this.height = document.body.offsetHeight
this.zoom = `scale(${this.width / 1710})`
}, 3000) }, 3000)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment