修改看板工位登陆状态弹窗弹出时间
This commit is contained in:
@@ -37,6 +37,12 @@
|
||||
<script>
|
||||
export default {
|
||||
name: 'OpLoginStatusOverlay',
|
||||
props: {
|
||||
currentTimeTick: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
opLoginBoxShowStartTime: '',
|
||||
@@ -46,9 +52,7 @@ export default {
|
||||
stationRows: [],
|
||||
refreshTimer: null,
|
||||
configTimer: null,
|
||||
clockTimer: null,
|
||||
refreshing: false,
|
||||
nowTick: Date.now()
|
||||
refreshing: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -82,10 +86,10 @@ export default {
|
||||
isInShowWindow() {
|
||||
const start = this.parseTimeToSeconds(this.opLoginBoxShowStartTime)
|
||||
const end = this.parseTimeToSeconds(this.opLoginBoxShowEndTime)
|
||||
if (start === null || end === null) {
|
||||
if (start === null || end === null || !this.currentTimeTick) {
|
||||
return false
|
||||
}
|
||||
const now = new Date(this.nowTick)
|
||||
const now = new Date(this.currentTimeTick)
|
||||
const nowSec = now.getHours() * 3600 + now.getMinutes() * 60 + now.getSeconds()
|
||||
if (start <= end) {
|
||||
return nowSec >= start && nowSec <= end
|
||||
@@ -105,9 +109,6 @@ export default {
|
||||
this.configTimer = setInterval(() => {
|
||||
this.loadOverlayTimeWindow()
|
||||
}, 2 * 60 * 1000)
|
||||
this.clockTimer = setInterval(() => {
|
||||
this.nowTick = Date.now()
|
||||
}, 1000)
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.refreshTimer) {
|
||||
@@ -118,10 +119,6 @@ export default {
|
||||
clearInterval(this.configTimer)
|
||||
this.configTimer = null
|
||||
}
|
||||
if (this.clockTimer) {
|
||||
clearInterval(this.clockTimer)
|
||||
this.clockTimer = null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
displayStationStatus(item) {
|
||||
|
||||
@@ -211,7 +211,7 @@
|
||||
<div class="bottom">
|
||||
<div class="slogan">{{ slogan }}</div>
|
||||
</div>
|
||||
<OpLoginStatusOverlay />
|
||||
<OpLoginStatusOverlay :current-time-tick="currentTimeTick" />
|
||||
<div
|
||||
v-if="machineStopCall.length > 0"
|
||||
class="machineStop"
|
||||
@@ -331,6 +331,7 @@ export default {
|
||||
timer2: '',
|
||||
dbTimeBase: null,
|
||||
dbTimeBaseTick: 0,
|
||||
currentTimeTick: 0,
|
||||
year: '',
|
||||
time: '',
|
||||
week: '',
|
||||
@@ -635,6 +636,7 @@ export default {
|
||||
const date = this.dbTimeBase
|
||||
? new Date(this.dbTimeBase.getTime() + Date.now() - this.dbTimeBaseTick)
|
||||
: new Date()
|
||||
this.currentTimeTick = date.getTime()
|
||||
const month = this.zeroFill(date.getMonth() + 1)
|
||||
const day = this.zeroFill(date.getDate())
|
||||
const hour = this.zeroFill(date.getHours())
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
<div class="bottom">
|
||||
<div class="slogan">{{ slogan }}</div>
|
||||
</div>
|
||||
<OpLoginStatusOverlay />
|
||||
<OpLoginStatusOverlay :current-time-tick="currentTimeTick" />
|
||||
<div v-if="machineStopCall.length > 0" class="machineStop" :style="getMachineStopCallColor()">
|
||||
<!-- 只有一条数据时:铺满显示,字体放大 -->
|
||||
<div v-if="machineStopCall.length === 1" class="machineStop-single">
|
||||
@@ -242,6 +242,7 @@ export default {
|
||||
timer2: '',
|
||||
dbTimeBase: null,
|
||||
dbTimeBaseTick: 0,
|
||||
currentTimeTick: 0,
|
||||
year: '',
|
||||
time: '',
|
||||
week: '',
|
||||
@@ -481,6 +482,7 @@ export default {
|
||||
getNowTime() {
|
||||
const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
|
||||
const date = this.dbTimeBase ? new Date(this.dbTimeBase.getTime() + Date.now() - this.dbTimeBaseTick) : new Date()
|
||||
this.currentTimeTick = date.getTime()
|
||||
const month = this.zeroFill(date.getMonth() + 1)
|
||||
const day = this.zeroFill(date.getDate())
|
||||
const hour = this.zeroFill(date.getHours())
|
||||
|
||||
Reference in New Issue
Block a user