From d92666002a0df37fa1c3f43e79aeb32aab41fb46 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期三, 23 八月 2023 10:48:49 +0800
Subject: [PATCH] 面板的时间实时更新 2023-8-23
---
src/views/visualization.vue | 26 +++++++++++++++-----------
1 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/src/views/visualization.vue b/src/views/visualization.vue
index e02f673..bd1552c 100644
--- a/src/views/visualization.vue
+++ b/src/views/visualization.vue
@@ -343,10 +343,10 @@
<div class="right-top-l">浣滀笟鐘舵��</div>
<div class="time">
<dl>
- <dd><span style="font-size: 32px">{{ formatDate3() }}</span></dd>
+ <dd><span style="font-size: 32px">{{ formatTime3 }}</span></dd>
<dd>
<span style="font-size: 12px; "
- >{{ formatDate2() }}</span
+ >{{ formatTime2 }}</span
>
<!--margin-right: 10px <span style="font-size: 14px">鏄熸湡鍥�</span> -->
</dd>
@@ -420,7 +420,7 @@
<div class="bg-title">
<img src="../../public/bg-title.png" />
<span class="bg-title-span">璁惧瀹炴椂鐢熶骇鐪嬫澘</span>
- <div class="bg-date"><span>{{ formatDate3() }}</span><br/>{{formatDate2()}}</div>
+ <div class="bg-date"><span>{{ formatTime3 }}</span><br/>{{formatTime2}}</div>
<span
class="font el-icon-setting set-title bg-set"
@click="setUrl"
@@ -467,6 +467,8 @@
production: 25, //鐢熶骇涓�
finishNumber: 0,
finishPercent: 0,
+ formatTime2:'',
+ formatTime3:'',
// 鍙充晶瀹屾垚
finishShow: false,
inputMaterials: [],
@@ -521,6 +523,10 @@
// this.passrate = this.getRandomNumber(1, 100);
// this.production = this.getRandomNumber(1, 100);
// }, 3000);
+ setInterval(()=>{
+ this.getDate3()
+ this.getDate2()
+ },5000)
this.getTaskInfo();
setInterval(() => {
this.getProgressInfo();
@@ -579,15 +585,13 @@
return "";
}
},
- formatDate3() {
- const now = new Date();
- let time = this.getDateObj(now, "hh:mm");
- return time;
+ getDate3(){
+ let now= new Date();
+ this.formatTime3 = this.getDateObj(now, "hh:mm");
},
- formatDate2(){
- const now = new Date();
- let time = this.getDateObj(now, "yyyy骞碝M鏈坉d鏃�");
- return time;
+ getDate2(){
+ let now = new Date();
+ this.formatTime2 = this.getDateObj(now, "yyyy骞碝M鏈坉d鏃�");
},
setInterCard(value, name) {
let height = 200;
--
Gitblit v1.8.0