10 changed files with 318 additions and 41 deletions
-
12public/echarts/echarts.min.js
-
3public/index.html
-
11src/router/index.js
-
6src/views/Home.vue
-
199src/views/newScheduledBoard.vue
-
102src/views/newTime.vue
-
4src/views/orderBoard.vue
-
4src/views/productOutBoard.vue
-
4src/views/reportAbnormal.vue
-
4src/views/scheduledBoard.vue
12
public/echarts/echarts.min.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,102 @@ |
|||||
|
<template> |
||||
|
<div style="font-size: 26px;float: right;color: #ffffff;height: 100%" v-html="clock"></div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
|
||||
|
export default { |
||||
|
name: 'newTime', |
||||
|
data() { |
||||
|
return { |
||||
|
clock: null, |
||||
|
status: 1 |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
getTime() { |
||||
|
|
||||
|
let that = this; |
||||
|
$.ajax({ |
||||
|
url: "/board/getTime", |
||||
|
type: "post", |
||||
|
dataType: "json", |
||||
|
data: {}, |
||||
|
async: false, |
||||
|
success: (data) => { |
||||
|
that.stringdate = data.rows; |
||||
|
|
||||
|
that.timer = window.setInterval(() => { |
||||
|
that.showRealTime() |
||||
|
}, 1000); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
showRealTime() { |
||||
|
if (this.currentDate == null) { |
||||
|
this.currentDate = new Date(this.stringdate); |
||||
|
} else { |
||||
|
this.currentDate = new Date(this.currentDate.getTime() + 1000); |
||||
|
} |
||||
|
|
||||
|
var c = this.currentDate; |
||||
|
var year = c.getFullYear(); |
||||
|
var month = c.getMonth() + 1; |
||||
|
var date = c.getDate(); |
||||
|
var days = new Array("日", "一", "二", "三", "四", "五", "六"); |
||||
|
var day = c.getDay(); |
||||
|
var hour = (c.getHours() < 10) ? ("0" + c.getHours()) : c.getHours(); |
||||
|
var min = (c.getMinutes() < 10) ? ("0" + c.getMinutes()) : c.getMinutes(); |
||||
|
var sec = (c.getSeconds() < 10) ? ("0" + c.getSeconds()) : c.getSeconds(); |
||||
|
var now = year + "年" + month + "月" + date + "日<br>星期" + days[day] + "<br>" + hour + ":" + min + ":" + sec; |
||||
|
|
||||
|
// if (hour>=10 && hour<12 && this.status==1){ |
||||
|
if (localStorage.getItem("status")==null){ |
||||
|
localStorage.setItem("status",1) |
||||
|
} |
||||
|
this.status = localStorage.getItem("status") |
||||
|
if (parseInt(hour) ==23 && this.status==1){ |
||||
|
$.ajax({ |
||||
|
url: "/board/kanKanYouMeiYouDiaoXian", |
||||
|
type: "post", |
||||
|
data: {}, |
||||
|
dataType: "json", |
||||
|
success: (data) => { |
||||
|
localStorage.setItem("status",2) |
||||
|
location.reload(); |
||||
|
} |
||||
|
}).fail(() => { |
||||
|
localStorage.setItem("status",3) |
||||
|
}) |
||||
|
} |
||||
|
// if ( hour>=12 && this.status==2){ |
||||
|
if ( parseInt(hour) ==1 && this.status==2){ |
||||
|
localStorage.setItem("status",1) |
||||
|
} |
||||
|
if(this.status==3 && parseInt(sec) ==59){ |
||||
|
$.ajax({ |
||||
|
url: "/board/kanKanYouMeiYouDiaoXian", |
||||
|
type: "post", |
||||
|
data: {}, |
||||
|
dataType: "json", |
||||
|
success: (data) => { |
||||
|
localStorage.setItem("status",2) |
||||
|
location.reload(); |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
this.clock = now; |
||||
|
}, |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.getTime(); |
||||
|
}, |
||||
|
beforeDestroy() { |
||||
|
|
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
|
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue