大屏及电子税务局页面样式修改,时间每秒刷新一次
Showing
2 changed files
with
23 additions
and
8 deletions
@@ -65,13 +65,13 @@ export default { | @@ -65,13 +65,13 @@ export default { | ||
65 | }, | 65 | }, |
66 | timelogoStyle () { // 左上角时间标志大小 | 66 | timelogoStyle () { // 左上角时间标志大小 |
67 | return { | 67 | return { |
68 | - width: this.titleFontSize / 2.5 + 'px', | ||
69 | - height: this.titleFontSize / 2.5 + 'px' | 68 | + width: this.titleFontSize / 3 + 'px', |
69 | + height: this.titleFontSize / 3 + 'px' | ||
70 | } | 70 | } |
71 | }, | 71 | }, |
72 | datetimeStyle () { // 左上角日期时间大小 | 72 | datetimeStyle () { // 左上角日期时间大小 |
73 | return { | 73 | return { |
74 | - fontSize: this.titleFontSize / 3 + 'px', | 74 | + fontSize: this.titleFontSize / 3.5 + 'px', |
75 | marginLeft: this.titleFontSize / 5 + 'px' | 75 | marginLeft: this.titleFontSize / 5 + 'px' |
76 | } | 76 | } |
77 | }, | 77 | }, |
@@ -102,13 +102,20 @@ export default { | @@ -102,13 +102,20 @@ export default { | ||
102 | // this.$refs.responseRef.getData(); | 102 | // this.$refs.responseRef.getData(); |
103 | // this.$refs.bandwidthRef.getData(); | 103 | // this.$refs.bandwidthRef.getData(); |
104 | 104 | ||
105 | + }, | ||
106 | + getDateTime(){ | ||
107 | + var that = this | ||
108 | + // 获取当前系统时间 | ||
109 | + var myDate = new Date(); | ||
110 | + that.dateTime = myDate.getFullYear() + '-' + that.timeFormat(myDate.getMonth() + 1 + '') + '-' + that.timeFormat(myDate.getDate() + '') + ' ' + that.timeFormat(myDate.getHours() + '') + ':' + that.timeFormat(myDate.getMinutes() + '') + ':' + that.timeFormat(myDate.getSeconds() + ''); | ||
105 | } | 111 | } |
106 | }, | 112 | }, |
107 | mounted () { | 113 | mounted () { |
108 | var that = this | 114 | var that = this |
109 | - // 获取当前系统时间 | ||
110 | - var myDate = new Date(); | ||
111 | - that.dateTime = myDate.getFullYear() + '-' + that.timeFormat(myDate.getMonth() + 1 + '') + '-' + that.timeFormat(myDate.getDate() + '') // + ' ' + that.timeFormat(myDate.getHours() + '') + ':' + that.timeFormat(myDate.getMinutes() + '') + ':' + that.timeFormat(myDate.getSeconds() + ''); | 115 | + //定时器每秒调用一次fnDate() |
116 | + setInterval(function(){ | ||
117 | + that.getDateTime(); | ||
118 | + },1000); | ||
112 | 119 | ||
113 | window.addEventListener('resize', this.screenAdapter) | 120 | window.addEventListener('resize', this.screenAdapter) |
114 | this.screenAdapter() | 121 | this.screenAdapter() |
@@ -55,16 +55,24 @@ export default { | @@ -55,16 +55,24 @@ export default { | ||
55 | 55 | ||
56 | // 挂载完 | 56 | // 挂载完 |
57 | Vue.onMounted(() => { | 57 | Vue.onMounted(() => { |
58 | + //定时器每秒调用一次fnDate() | ||
59 | + setInterval(function(){ | ||
60 | + getDateTime(); | ||
61 | + },1000); | ||
62 | + | ||
63 | + }) | ||
64 | + let getDateTime=()=>{ | ||
58 | // 获取当前系统时间 | 65 | // 获取当前系统时间 |
59 | let myDate = new Date(); | 66 | let myDate = new Date(); |
60 | proxy.dateTime = myDate.getFullYear() + '-' + proxy.timeFormat(myDate.getMonth() + 1 + '') + '-' + proxy.timeFormat(myDate.getDate() + '') + ' ' + proxy.timeFormat(myDate.getHours() + '') + ':' + proxy.timeFormat(myDate.getMinutes() + '') + ':' + proxy.timeFormat(myDate.getSeconds() + ''); | 67 | proxy.dateTime = myDate.getFullYear() + '-' + proxy.timeFormat(myDate.getMonth() + 1 + '') + '-' + proxy.timeFormat(myDate.getDate() + '') + ' ' + proxy.timeFormat(myDate.getHours() + '') + ':' + proxy.timeFormat(myDate.getMinutes() + '') + ':' + proxy.timeFormat(myDate.getSeconds() + ''); |
61 | 68 | ||
62 | - }) | 69 | + } |
63 | 70 | ||
64 | 71 | ||
65 | return { | 72 | return { |
66 | datetimeStyle, | 73 | datetimeStyle, |
67 | - timeFormat | 74 | + timeFormat, |
75 | + getDateTime | ||
68 | } | 76 | } |
69 | } | 77 | } |
70 | } | 78 | } |
-
Please register or login to post a comment