From 3ed50045139eb39c6cbe860f475905b38691ad3c Mon Sep 17 00:00:00 2001
From: clll <1320612696@qq.com>
Date: 星期五, 08 九月 2023 17:10:27 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.150:10101/r/CanadaMes
---
CanadaMes-ui/src/views/Electrical/Parameter.vue | 48 ++++++++++++++++++++++++++++--------------------
1 files changed, 28 insertions(+), 20 deletions(-)
diff --git a/CanadaMes-ui/src/views/Electrical/Parameter.vue b/CanadaMes-ui/src/views/Electrical/Parameter.vue
index e9be395..d30361f 100644
--- a/CanadaMes-ui/src/views/Electrical/Parameter.vue
+++ b/CanadaMes-ui/src/views/Electrical/Parameter.vue
@@ -3,7 +3,7 @@
<!-- 闈㈠寘灞戝鑸尯鍩� -->
<el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
<router-link to="/home" tag="el-button" type="text">{{ $t('langHome') }}</router-link>
- <el-button type="text">璁惧绠$悊</el-button>
+ <el-button type="text">Electrical</el-button>
<router-link to="/Electrical/Parameter" tag="el-button" type="text">Parameter</router-link>
<router-link to="/Electrical/Action" tag="el-button" type="text">Action</router-link>
<router-link to="/Electrical/Sign" tag="el-button" type="text">Sign</router-link>
@@ -15,7 +15,8 @@
<el-form label-width="100px" style="display: flex; flex-wrap: wrap;" :model="messagepack.data">
<div id="btn_div">
- <el-button type="primary" @click="send()">涓嬪彂鍙傛暟</el-button>
+ <el-button type="primary" @click="send()" id="xiafa" :disabled="isButtonDisabled">涓嬪彂鍙傛暟</el-button>
+
</div>
<div class="kuai_div" v-for="(item, index) in record.xyData" :key="index">
<el-input style="width: 280px; border:none;" class="in_mc" v-model="item.name" readonly></el-input>
@@ -65,6 +66,7 @@
created() {
this.initWebSocket();
+ this.isButtonDisabled = true;
},
methods: {
initWebSocket() {
@@ -90,24 +92,30 @@
// 鏀跺埌娑堟伅
socket.onmessage = (msg) => {
- if (!msg.data) {
- return; // 濡傛灉鏀跺埌绌烘暟鎹紝鍒欑洿鎺ヨ繑鍥烇紝涓嶆墽琛屽悗缁�昏緫
- }
-
- let obj = JSON.parse(msg.data);
- this.record.params[0] = obj.params[0];
-
- for (let a = 0; a <= this.record.params[0].length - 1; a++) {
- if (!this.record.xyData[a]) {
- this.record.xyData[a] = { name: this.record.canshu[a], value: this.record.params[0][a] };
- } else {
- this.record.xyData[a].value = this.record.params[0][a];
- }
- }
-
- console.log(this.record.xyData);
- this.$forceUpdate();
- };
+ if (!msg.data) {
+ return; // 濡傛灉鏀跺埌绌烘暟鎹紝鍒欑洿鎺ヨ繑鍥烇紝涓嶆墽琛屽悗缁�昏緫
+ }
+
+ let obj = JSON.parse(msg.data);
+ this.record.params[0] = obj.params[0];
+ this.record.state = obj.state[0];
+
+ let isButtonDisabled = this.record.state.includes(1);
+ // 鍒ゆ柇state涓槸鍚﹀瓨鍦�1
+ console.log(isButtonDisabled)
+ this.isButtonDisabled = isButtonDisabled; // 灏嗗垽鏂粨鏋滀繚瀛樺埌鍙橀噺isButtonDisabled涓�
+
+ for (let a = 0; a <= this.record.params[0].length - 1; a++) {
+ if (!this.record.xyData[a]) {
+ this.record.xyData[a] = { name: this.record.canshu[a], value: this.record.params[0][a] };
+ } else {
+ this.record.xyData[a].value = this.record.params[0][a];
+ }
+ }
+
+ console.log(this.record.xyData);
+ this.$forceUpdate();
+};
// 鍏抽棴浜嬩欢
socket.onclose = function () {
--
Gitblit v1.8.0