Authored by 鲁尚清

大屏及电子税务局页面样式修改,时间每秒刷新一次

... ... @@ -65,13 +65,13 @@ export default {
},
timelogoStyle () { // 左上角时间标志大小
return {
width: this.titleFontSize / 2.5 + 'px',
height: this.titleFontSize / 2.5 + 'px'
width: this.titleFontSize / 3 + 'px',
height: this.titleFontSize / 3 + 'px'
}
},
datetimeStyle () { // 左上角日期时间大小
return {
fontSize: this.titleFontSize / 3 + 'px',
fontSize: this.titleFontSize / 3.5 + 'px',
marginLeft: this.titleFontSize / 5 + 'px'
}
},
... ... @@ -102,13 +102,20 @@ export default {
// this.$refs.responseRef.getData();
// this.$refs.bandwidthRef.getData();
},
getDateTime(){
var that = this
// 获取当前系统时间
var myDate = new Date();
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() + '');
}
},
mounted () {
var that = this
// 获取当前系统时间
var myDate = new Date();
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() + '');
//定时器每秒调用一次fnDate()
setInterval(function(){
that.getDateTime();
},1000);
window.addEventListener('resize', this.screenAdapter)
this.screenAdapter()
... ...
... ... @@ -55,16 +55,24 @@ export default {
// 挂载完
Vue.onMounted(() => {
//定时器每秒调用一次fnDate()
setInterval(function(){
getDateTime();
},1000);
})
let getDateTime=()=>{
// 获取当前系统时间
let myDate = new Date();
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() + '');
})
}
return {
datetimeStyle,
timeFormat
timeFormat,
getDateTime
}
}
}
... ...