ZengTao
2023-12-28 ec14c7c0b9a5d8240cfc3f2c80a48dfe1176f13e
CanadaMes-ui/src/layout/index.vue
@@ -102,10 +102,18 @@
        <el-table-column prop="timeons" :label="$t('timeon')"></el-table-column>
      </el-table>
    </el-dialog>
    <el-dialog :visible.sync="dialogFormCountDown" :title="$t('Approximately resettable time')" top="5vh">
            <div :style="'font-size: ' + PromptSize + 'px;text-align: center;'">
                <!-- {{ this.CountDowns }} -->
                {{ this.CountDowns }}
            </div>
        </el-dialog>
    <el-dialog :visible.sync="dialogFormVisible3" >
     
      <el-button :class="{ 'blue-button': receivedData === 1 }" @click="toggleButtonValue(1)">{{ $t('A01Abort/ResumeTasks') }}</el-button>
    <el-button :class="{ 'blue-button': receivedData2 === 1 }" @click="toggleButtonValue(2)">{{ $t('A02Abort/ResumeTasks') }}</el-button>
      <el-button :class="{ 'blue-button': receivedData === 1 }" @click="toggleButtonValue(1)">{{
        $t('A01Abort/ResumeTasks') }}</el-button>
      <el-button :class="{ 'blue-button': receivedData2 === 1 }" @click="toggleButtonValue(2)">{{
        $t('A02Abort/ResumeTasks') }}</el-button>
      
    </el-dialog>
@@ -149,7 +157,12 @@
      dialogFormVisible2: false,
      dialogFormVisible3: false,
      alarm: [],
      alarm2: []
      alarm2: [],
      CountDowns: "0",
      EmergencyStop: false,
      PromptSize: 250,
      dialogFormCountDown:false
    }
  },
  // components: {
@@ -255,6 +268,23 @@
              this.alarm = obj.alarmmg[0];
              this.dialogFormVisible2 = false;
          }
            //是否急停
            if (obj.emergencystop != null) {
              this.EmergencyStop = obj.emergencystop[0];
            }
            //复位倒计时
            console.log(obj.countdown);
            if (obj.countdown != null) {
              if ((obj.countdown[0] == true && this.CountDowns == 0) || this.EmergencyStop == true) {
                this.CountDown();
              }
            }
            //复位完成信号
            if (obj.reset != null) {
              this.reset = obj.reset[0];
            }
        }
@@ -283,6 +313,36 @@
          console.log("websocket发生了错误");
        }
      }
    },
    //45秒复位倒数计时
    CountDown() {
      let count = 45;
      let timer = setInterval(
        () => {
          if (this.EmergencyStop == true) {
            this.dialogFormCountDown = false;
            clearInterval(timer);
            this.CountDowns = "0";
          } else {
            if (count > 0) {
              this.PromptSize = 500;
              this.CountDowns = count;
              count--;
              this.dialogFormCountDown = true;
            }
            else {
              this.PromptSize = 200;
              this.CountDowns = "Waiting for reset";
              if (this.reset == true) {
                clearInterval(timer);
                this.dialogFormCountDown = false;
              }
            }
          }
        },
        1000
      );
    },
    logout: function () {
      removeToken()
@@ -436,10 +496,12 @@
    margin-left: 10px;
  }
}
.blue-button {
  background-color: green;
  color: white;
}
.el-header {
  background-color: #576574;