haoxuan
2023-08-23 d92666002a0df37fa1c3f43e79aeb32aab41fb46
面板的时间实时更新 2023-8-23
1个文件已修改
26 ■■■■■ 已修改文件
src/views/visualization.vue 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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年MM月dd日");
        return time;
    getDate2(){
      let now =  new Date();
      this.formatTime2 = this.getDateObj(now, "yyyy年MM月dd日");
    },
    setInterCard(value, name) {
      let height = 200;