wu
2023-12-08 31101f632c27c05d15f30ca3084e3ed3da2a29af
CanadaMes-ui/src/views/Electrical/Action.vue
@@ -2,17 +2,17 @@
  <div class="app">
    <!--面包屑导航区域-->
    <el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
      <router-link to="/Electrical/alarm" tag="el-button" type="text" active-class="blue-button">{{ $t('Alarm')
      <router-link to="/Electrical/ServoManualone" tag="el-button" type="text" active-class="blue-button">{{ $t('Alarm')
      }}</router-link>
      <router-link to="/Electrical/State" tag="el-button" type="text" active-class="blue-button">{{ $t('State')
      }}</router-link>
      <router-link to="/Electrical/Action" tag="el-button" type="text" active-class="blue-button">{{ $t('Action')
      }}</router-link>
      <router-link to="/Electrical/Parameter" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter')
      }}</router-link>
      <!-- <router-link to="/Electrical/Parameter" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter')
      }}</router-link> -->
      <router-link to="/Electrical/Sign" tag="el-button" type="text" active-class="blue-button">{{ $t('Sign')
      }}</router-link>
       <router-link to="/Electrical/Servomanual" tag="el-button" type="text" active-class="blue-button">{{ $t('Servo Manual')
       <router-link to="/Electrical/Servomanual" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter')
      }}</router-link>
    </el-breadcrumb>
    
@@ -71,10 +71,10 @@
          'A02 SERVE TRAVEL POS',
          'B01 SERVE TRAVEL POS',
          'B02 SERVE TRAVEL POS',
          'B01 YV TURN',
          'B01 YV UP DOWN',
          'B02 YV TURN',
          'B02 YV UP DOWN',
          'B01 Solenoid TURN',
          'B01 Solenoid UP DOWN',
          'B02 Solenoid TURN',
          'B02 Solenoid UP DOWN',
        ],
        xyData: [
          { name: 'D01 VFD conveyor', value: "0" },
@@ -99,10 +99,10 @@
          { name: 'A02 SERVE TRAVEL POS', value: "0" },
          { name: 'B01 SERVE TRAVEL POS', value: "0" },
          { name: 'B02 SERVE TRAVEL POS', value: "0" },
          { name: 'B01 YV TURN', value: "0" },
          { name: 'B01 YV UP DOWN', value: "0" },
          { name: 'B02 YV TURN', value: "0" },
          { name: 'B02 YV UP DOWN', value: "0" },
          { name: 'B01 Solenoid TURN', value: "0" },
          { name: 'B01 Solenoid UP DOWN', value: "0" },
          { name: 'B02 Solenoid TURN', value: "0" },
          { name: 'B02 Solenoid UP DOWN', value: "0" },
        ]
        ,
      },
@@ -118,9 +118,13 @@
    }
  },
  created () {
  // created () {
  //   this.init();
  // },
  activated(){
    this.init();
  },
 },
  methods: {
    setActiveButton (buttonName) {
@@ -134,7 +138,7 @@
      } else {
        //console.log("您的浏览器支持WebSocket");
        let socketUrl = "ws://" + "localhost:8888" + "/springboot-vue3/api/talk/" + viewname;
        let socketUrl = "ws://" + this.$t('ip')+":8888" + "/springboot-vue3/api/talk/" + viewname;
        if (socket != null) {
          socket.close();
          socket = null;
@@ -179,6 +183,9 @@
        socket.onerror = function () {
          console.log("websocket发生了错误");
        }
        this.$router.afterEach(function(){
          socket.close();
        })
      }
    },