From 92dab966727b26c69a8a1d5839b064f7942895e8 Mon Sep 17 00:00:00 2001
From: wuyouming666 <2265557248@qq.com>
Date: 星期四, 09 五月 2024 09:20:33 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes
---
CanadaMes-ui/src/layout/index.vue | 187 +++++++++++++++++++++++++++++++---------------
1 files changed, 126 insertions(+), 61 deletions(-)
diff --git a/CanadaMes-ui/src/layout/index.vue b/CanadaMes-ui/src/layout/index.vue
index 7a0c9e5..c16840b 100644
--- a/CanadaMes-ui/src/layout/index.vue
+++ b/CanadaMes-ui/src/layout/index.vue
@@ -66,7 +66,7 @@
<el-menu-item index="1-1" @click="logout">{{ $t('exit') }}</el-menu-item>
<el-menu-item index="1-2" @click="showChangePasswordDialog">{{ $t('changePassword') }}</el-menu-item>
</el-submenu>
-
+
</template>
<template>
<el-dialog :title="$t('changePassword')" :visible.sync="dialogVisible" width="30%">
@@ -102,12 +102,20 @@
<el-table-column prop="timeons" :label="$t('timeon')"></el-table-column>
</el-table>
</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-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-dialog> -->
</el-container>
</template>
@@ -122,7 +130,7 @@
// import Tag from '../layout/tag.vue';
// import store from '../store';
let socket;
-
+let timer;
export default {
name: "Layout",
// store,
@@ -131,8 +139,8 @@
return {
activeTag: '', // 褰撳墠婵�娲荤殑鏍囩
dialogVisible: false,
- receivedData:0,
- receivedData2:0,
+ receivedData: 0,
+ receivedData2: 0,
formData: {
oldPassword: '',
newPassword: '',
@@ -149,7 +157,12 @@
dialogFormVisible2: false,
dialogFormVisible3: false,
alarm: [],
- alarm2: []
+ alarm2: [],
+ CountDowns: "0",
+ EmergencyStop: false,
+ PromptSize: 250,
+ dialogFormCountDown: false
+
}
},
// components: {
@@ -157,8 +170,8 @@
// },
created() {
-
-
+
+
selectList(this.menuListForm).then(res => {
this.menuList = res.data
@@ -178,25 +191,25 @@
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) {
- this.receivedData2 = this.receivedData2 === 0 ? 1 : 0;
- }
-console.log(this.receivedData,this.receivedData2)
+ 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) {
+ this.receivedData2 = this.receivedData2 === 0 ? 1 : 0;
+ }
+ console.log(this.receivedData, this.receivedData2)
const data3 = [];
- const resetButtonValues3 = [this.receivedData,this.receivedData2];
+ const resetButtonValues3 = [this.receivedData, this.receivedData2];
// 灏嗗緱鍒扮殑鍊兼坊鍔犲埌 data 鏁扮粍涓�
data3.push(resetButtonValues3.flat());
-
+
// 鍦� data3 鏁扮粍鍓嶉潰娣诲姞涓や釜绌烘暟缁�
// 鍒涘缓 jsonObject3 瀵硅薄锛屽苟娣诲姞 data3 灞炴��
@@ -207,18 +220,18 @@
console.log("鎬ュ仠鍚庝腑姝�/缁х画閫夋嫨:", jsonString3);
socket?.send(jsonString3);
setTimeout(() => {
- this.dialogFormVisible3 = false;
- }, 1000); // 寤惰繜鏃堕棿涓�1绉掞紙1000姣锛�
+ this.dialogFormVisible3 = false;
+ }, 1000); // 寤惰繜鏃堕棿涓�1绉掞紙1000姣锛�
}).catch(() => {
- // 鐐瑰嚮鍙栨秷鎸夐挳鍚庢墽琛岀殑鎿嶄綔
- });
-
-
+ // 鐐瑰嚮鍙栨秷鎸夐挳鍚庢墽琛岀殑鎿嶄綔
+ });
+
+
},
init() {
- let viewname = "Home";
+ let viewname = "Layout";
if (typeof (WebSocket) == "undefined") {
console.log("鎮ㄧ殑娴忚鍣ㄤ笉鏀寔WebSocket");
} else {
@@ -238,39 +251,56 @@
socket.onmessage = function (msg) {
//console.log("鏀跺埌鏁版嵁====" + msg.data);
let obj = JSON.parse(msg.data);
- if(obj.alarmmg){
+ 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) {
- this.alarm = obj.alarmmg[0];
- this.dialogFormVisible2 = true;
- }
- } else {
+ if( obj.alarmmg!=null){
this.alarm = obj.alarmmg[0];
- this.dialogFormVisible2 = true;
+ }
+
+ // 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) {
+ // this.alarm = obj.alarmmg[0];
+ // this.dialogFormVisible2 = true;
+ // }
+ // } else {
+ // this.alarm = obj.alarmmg[0];
+ // this.dialogFormVisible2 = true;
+ // }
+ // } else {
+ // this.alarm = obj.alarmmg[0];
+ // this.dialogFormVisible2 = false;
+ // }
+ // //鏄惁鎬ュ仠
+ // if (obj.emergencystop != null) {
+ // this.EmergencyStop = obj.emergencystop[0];
+ // }
+
+ // //澶嶄綅鍊掕鏃�
+ // 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];
+ // }
+ }
+
+
+
+
+ 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.$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;
- }
- }
}.bind(this);
//鍏抽棴浜嬩欢
@@ -281,6 +311,39 @@
socket.onerror = function () {
console.log("websocket鍙戠敓浜嗛敊璇�");
}
+ }
+ },
+ //60绉掑浣嶅�掓暟璁℃椂
+ CountDown() {
+ clearInterval(timer);
+ let count = 60;
+ 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--;
+ }
+ else {
+ this.PromptSize = 200;
+ this.CountDowns = "Waiting for reset";
+ if (this.reset == true) {
+ clearInterval(timer);
+ this.dialogFormCountDown = false;
+ }
+ }
+ }
+
+ },
+ 1000
+ );
+ if (this.reset == false && this.EmergencyStop != true) {
+ this.dialogFormCountDown = true;
}
},
logout: function () {
@@ -338,7 +401,7 @@
'鐢ㄦ埛鍒楄〃': 'UserList',
'璁惧绠$悊': 'DeviceManagement',
'鎶ヨ淇℃伅': 'Alarm',
- '鍙傛暟涓嬪彂': 'Parameter',
+ '鎵嬪姩/鑷姩': 'Manual/Automatic',
'寮�鍏虫帶鍒�': 'Action',
'IO鐘舵��': 'Sign',
'鏉冮檺绠$悊': 'PermissionManagement',
@@ -435,10 +498,12 @@
margin-left: 10px;
}
}
+
.blue-button {
background-color: green;
color: white;
}
+
.el-header {
background-color: #576574;
--
Gitblit v1.8.0