From 011217be1f04727ff60985bec0de1182400d2377 Mon Sep 17 00:00:00 2001
From: wuyouming666 <2265557248@qq.com>
Date: 星期日, 17 九月 2023 15:06:57 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes

---
 CanadaMes-ui/src/views/Electrical/alarm.vue |   70 +++++++++++++++++++----------------
 1 files changed, 38 insertions(+), 32 deletions(-)

diff --git a/CanadaMes-ui/src/views/Electrical/alarm.vue b/CanadaMes-ui/src/views/Electrical/alarm.vue
index c96986c..910046b 100644
--- a/CanadaMes-ui/src/views/Electrical/alarm.vue
+++ b/CanadaMes-ui/src/views/Electrical/alarm.vue
@@ -2,35 +2,36 @@
   <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/alarm" 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/Sign" tag="el-button" type="text" active-class="blue-button">{{ $t('Sign') }}</router-link>
+
     </el-breadcrumb>
-    <div>Alarm</div>
+    <div>{{ $t('Alarm') }}</div>
     <div class="block">
-      <span class="demonstration">鏃堕棿锛�</span>
-      <el-date-picker v-model="shijian1" type="datetime" placeholder="閫夋嫨鏃ユ湡鏃堕棿" align="right"
+      <span class="demonstration">{{ $t('shijian') }}锛�</span>
+      <el-date-picker v-model="shijian1" type="datetime" :placeholder="$t('Pick a day')" align="right"
         :picker-options="pickerOptions">
       </el-date-picker>
       ~
-      <el-date-picker v-model="shijian2" type="datetime" placeholder="閫夋嫨鏃ユ湡鏃堕棿" align="right"
+      <el-date-picker v-model="shijian2" type="datetime" :placeholder="$t('Pick a day')" align="right"
         :picker-options="pickerOptions">
       </el-date-picker>
-      <el-button type="primary" @click="selectTime()">鏌ヨ</el-button>
+      &nbsp;&nbsp;
+      <el-button type="primary" @click="selectTime()">{{ $t('Search') }}</el-button>
     </div>
 
     <el-table :data="localizedRoles" style="width: 100%;" height="550">
-      <el-table-column prop="id" label="id" width="80">
+      <el-table-column prop="id" :label="$t('alarmid')" width="80">
       </el-table-column>
-      <el-table-column prop="content" label="content">
+      <el-table-column prop="content" :label="$t('alacontent')">
       </el-table-column>
-      <el-table-column prop="timeon" label="time-on">
+      <el-table-column prop="timeon" :label="$t('time-on')">
       </el-table-column>
-      <el-table-column prop="endTime" label="End Time">
+      <el-table-column prop="endTime" :label="$t('End-Time')">
       </el-table-column>
     </el-table>
   </div>
@@ -66,27 +67,33 @@
         pageSize: 10
       },
       pickerOptions: {
+
+        disabledDate (time) {
+          return time.getTime() > Date.now();
+        },
         shortcuts: [{
-          text: '浠婂ぉ',
+
+          text: this.$t('today'),
           onClick (picker) {
             picker.$emit('pick', new Date());
           }
-        }, {
-          text: '鏄ㄥぉ',
+        },
+        {
+          text: this.$t('yesterday'),
           onClick (picker) {
             const date = new Date();
             date.setTime(date.getTime() - 3600 * 1000 * 24);
             picker.$emit('pick', date);
           }
-        }, {
-          text: '涓�鍛ㄥ墠',
+        },
+        {
+          text: this.$t('week'),
           onClick (picker) {
             const date = new Date();
             date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
             picker.$emit('pick', date);
           }
-        }],
-
+        }]
       },
       shijian1: "",
       shijian2: "",
@@ -99,9 +106,11 @@
 
 
     if (this.shijian1 == "" || this.shijian2 == "") {
+      //鏌ヨ褰撳ぉ鎶ヨ淇℃伅
       this.load();
     }
     else {
+      //鏍规嵁鏃堕棿鏌ヨ鎶ヨ淇℃伅
       this.selectTime();
     }
 
@@ -122,11 +131,14 @@
 
     },
     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 +147,7 @@
         }
       });
     },
-
+    //璇█杞崲
     replaceChineseWithEnglish () {
       const translation = this.$t('translation');
       this.localizedRoles = this.roles.map(role => ({
@@ -165,8 +177,6 @@
         };
         //  娴忚鍣ㄧ鏀舵秷鎭紝鑾峰緱浠庢湇鍔$鍙戦�佽繃鏉ョ殑鏂囨湰娑堟伅
         socket.onmessage = function (msg) {
-
-          //console.log("鏀跺埌鏁版嵁====" + msg.data);
           let obj = JSON.parse(msg.data);
 
           this.record.params[0] = obj.arm;
@@ -190,10 +200,6 @@
       }
 
     },
-    send () {
-      this.messagepack.data = { taskname: "鍓嶇鍒板悗鍙�" };
-      socket?.send(JSON.stringify(this.messagepack));  // 灏嗙粍瑁呭ソ鐨刯son鍙戦�佺粰鏈嶅姟绔紝鐢辨湇鍔$杩涜杞彂
-    }
 
   }
 
@@ -206,7 +212,7 @@
 </script>
 
 
-<style>
+<style >
 .kuai_div {
   /* width: 30%; */
   margin-bottom: 30px;

--
Gitblit v1.8.0