ZengTao
2023-12-27 50122609dfab86da64df82396a30a30455e5bd67
CanadaMes-ui/src/layout/index.vue
@@ -117,6 +117,7 @@
import { changePassword } from '../api/user'
import { removeToken } from "../utils/auth";
import LanguageMixin from '../lang/LanguageMixin'
import { MessageBox } from 'element-ui';
// import { mapState, mapMutations } from 'vuex';
// import Tag from '../layout/tag.vue';
// import store from '../store';
@@ -146,7 +147,7 @@
        pageNum: -1
      },
      dialogFormVisible2: false,
      dialogFormVisible3: true,
      dialogFormVisible3: false,
      alarm: [],
      alarm2: []
    }
@@ -175,6 +176,13 @@
  },
  methods: {
    toggleButtonValue(buttonNumber) {
      MessageBox.confirm(this.$t('Are you sure to perform this operation?'), this.$t('prompt'), {
    confirmButtonText: this.$t('confirm'),
    cancelButtonText: this.$t('cancel'),
    type: 'warning'
  }).then(() => {
    // 点击确认按钮后执行的操作
      if (buttonNumber === 1) {
        this.receivedData = this.receivedData === 0 ? 1 : 0;
      } else if (buttonNumber === 2) {
@@ -198,9 +206,13 @@
        const jsonString3 = JSON.stringify(jsonObject3);
        console.log("急停后中止/继续选择:", jsonString3);
        socket?.send(jsonString3);
        // setTimeout(()=>
        //   window.location.reload(),2000
        // )
        setTimeout(() => {
      this.dialogFormVisible3 = false;
    }, 1000); // 延迟时间为1秒(1000毫秒)
      }).catch(() => {
    // 点击取消按钮后执行的操作
  });
      
@@ -226,7 +238,9 @@
        socket.onmessage = function (msg) {
          //console.log("收到数据====" + msg.data);
          let obj = JSON.parse(msg.data);
          if(obj.alarmmg){
          if (obj.alarmmg[0].length > 0) {
            if (this.alarm.length > 0) {
              if (this.alarm[this.alarm.length - 1].id != obj.alarmmg[0][obj.alarmmg[0].length-1].id) {
@@ -237,23 +251,27 @@
              this.alarm = obj.alarmmg[0];
              this.dialogFormVisible2 = true;
            }
          }else{
              this.alarm = obj.alarmmg[0];
              this.dialogFormVisible2 = false;
          }
        }
          
          
          this.$forceUpdate();
if(obj.Abort){
          if (obj.Abort[0].length > 0) {
            this.receivedData=obj.Abort[0][0];
            this.receivedData2=obj.Abort[0][1];
            this.dialogFormVisible3 = true;
           this.dialogFormVisible3 = true;
          }
        }
        this.$forceUpdate();
        }.bind(this);
        //关闭事件