From eb967d7573a8297e493d455dfce2c77319215990 Mon Sep 17 00:00:00 2001
From: wuyouming666 <2265557248@qq.com>
Date: 星期三, 13 九月 2023 08:31:25 +0800
Subject: [PATCH] 注册页面中英文替换 修改电气管理顶部导航栏布局
---
CanadaMes-ui/src/views/Electrical/alarm.vue | 39 +++++++++++++++++++++++----------------
1 files changed, 23 insertions(+), 16 deletions(-)
diff --git a/CanadaMes-ui/src/views/Electrical/alarm.vue b/CanadaMes-ui/src/views/Electrical/alarm.vue
index c96986c..946a1e2 100644
--- a/CanadaMes-ui/src/views/Electrical/alarm.vue
+++ b/CanadaMes-ui/src/views/Electrical/alarm.vue
@@ -2,13 +2,11 @@
<div class="app">
<!--闈㈠寘灞戝鑸尯鍩�-->
<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">{{ $t('Electrical') }}</el-button>
- <router-link to="/Electrical/Parameter" tag="el-button" type="text">{{ $t('Parameter') }}</router-link>
- <router-link to="/Electrical/Action" tag="el-button" type="text">{{ $t('Action') }}</router-link>
- <router-link to="/Electrical/Sign" tag="el-button" type="text">{{ $t('Sign') }}</router-link>
- <router-link to="/Electrical/State" tag="el-button" type="text">{{ $t('State') }}</router-link>
- <router-link to="/Electrical/alarm" tag="el-button" type="text">{{ $t('Alarm') }}</router-link>
+ <router-link to="/Electrical/Parameter" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter') }}</router-link>
+ <router-link to="/Electrical/Action" tag="el-button" type="text" active-class="blue-button">{{ $t('Action') }}</router-link>
+ <router-link to="/Electrical/Sign" tag="el-button" type="text" active-class="blue-button">{{ $t('Sign') }}</router-link>
+ <router-link to="/Electrical/State" tag="el-button" type="text" active-class="blue-button">{{ $t('State') }}</router-link>
+ <router-link to="/Electrical/alarm" tag="el-button" type="text" active-class="blue-button">{{ $t('Alarm') }}</router-link>
</el-breadcrumb>
<div>Alarm</div>
<div class="block">
@@ -20,7 +18,8 @@
<el-date-picker v-model="shijian2" type="datetime" placeholder="閫夋嫨鏃ユ湡鏃堕棿" align="right"
:picker-options="pickerOptions">
</el-date-picker>
- <el-button type="primary" @click="selectTime()">鏌ヨ</el-button>
+
+ <el-button type="primary" @click="selectTime()">{{ $t('Search') }}</el-button>
</div>
<el-table :data="localizedRoles" style="width: 100%;" height="550">
@@ -48,6 +47,7 @@
mixins: [LanguageMixin],
data () {
return {
+ activeButton: '',
record: {
params: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
@@ -99,14 +99,22 @@
if (this.shijian1 == "" || this.shijian2 == "") {
+ //鏌ヨ褰撳ぉ鎶ヨ淇℃伅
this.load();
}
else {
+ //鏍规嵁鏃堕棿鏌ヨ鎶ヨ淇℃伅
this.selectTime();
}
},
methods: {
+ onButtonClick() {
+ this.isButtonClicked = true; // 灏嗘寜閽鑹茶缃负钃濊壊
+ setTimeout(() => {
+ this.isButtonClicked = false; // 閲嶇疆鎸夐挳棰滆壊
+ }, 500); // 杩欓噷鐨�500姣鏄牴鎹偍甯屾湜鎸夐挳棰滆壊鎸佺画澶氶暱鏃堕棿鏉ュ畾鐨勶紝鍙互鏍规嵁闇�姹傝繘琛岃皟鏁�
+ },
load () {
setAll().then(res => {
@@ -122,11 +130,13 @@
},
selectTime () {
+ //moment闇�瑕佸崟鐙畨杞緷璧栵紝npm install moment
let sj1 = moment(this.shijian1).format('YYYY-MM-DD%20HH:mm');
let sj2 = moment(this.shijian2).format('YYYY-MM-DD%20HH:mm')
-
+ //璋冪敤setTime鏂规硶缁檙oles璧嬪��
setTime(sj1, sj2).then(res => {
this.roles = res.data.list;
+ //table涓殑鍐呭杩涜璇█杞崲
const language = this.$i18n.locale;
if (language === 'zh-CN') {
this.replaceChineseWithEnglish();
@@ -135,7 +145,7 @@
}
});
},
-
+ //璇█杞崲
replaceChineseWithEnglish () {
const translation = this.$t('translation');
this.localizedRoles = this.roles.map(role => ({
@@ -165,8 +175,6 @@
};
// 娴忚鍣ㄧ鏀舵秷鎭紝鑾峰緱浠庢湇鍔$鍙戦�佽繃鏉ョ殑鏂囨湰娑堟伅
socket.onmessage = function (msg) {
-
- //console.log("鏀跺埌鏁版嵁====" + msg.data);
let obj = JSON.parse(msg.data);
this.record.params[0] = obj.arm;
@@ -190,10 +198,6 @@
}
},
- send () {
- this.messagepack.data = { taskname: "鍓嶇鍒板悗鍙�" };
- socket?.send(JSON.stringify(this.messagepack)); // 灏嗙粍瑁呭ソ鐨刯son鍙戦�佺粰鏈嶅姟绔紝鐢辨湇鍔$杩涜杞彂
- }
}
@@ -233,4 +237,7 @@
th div {
text-align: center;
}
+.blue-button {
+ background-color: skyblue;
+}
</style>
\ No newline at end of file
--
Gitblit v1.8.0