Explorar o código

autotime 5000

Changpeng Duan %!s(int64=5) %!d(string=hai) anos
pai
achega
c2210690df

+ 11 - 0
src/Global.js

@@ -50,6 +50,17 @@ globalfmtDate = function (datetime, length) {
     return (datetime != null) ? datetime.substr(0, length) : '';
 };
 
+// 去掉T格式化时间,截取制定长度
+globalfmtDate2 = function (datetime,start,length) {
+    if ((datetime == '') || (datetime == undefined))
+        return '';
+    if ((datetime == '1900-01-01') || (datetime == '1900-01-01 00:00:00.000'))
+        return '';
+    var new_date = new Date(+new Date(datetime) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '')
+    length = !length ? 10 : length;//缺省参数
+    return new_date.substr(start, length);
+};
+
 // 获取当前时间
 globalcurrent = function () {
     let date = new Date();

+ 3 - 3
src/components/HistoryRecord.vue

@@ -6,7 +6,7 @@
             <div class="image-border image-border3"></div>
             <div class="image-border image-border4"></div>
             <div class="other-people-title">
-                实时监测详情
+                历史监测详情
             </div>
             <el-table
                     :data="tableData"
@@ -30,7 +30,7 @@
                 </el-table-column>
                 <el-table-column
                         prop="Ctime"
-                        label="日期"
+                        label="时间"
                         sortable
                         :formatter="filterFmtDate"
                 >
@@ -150,7 +150,7 @@
             // 过滤时间
             filterFmtDate(value, row, column) {
                 let that = this;
-                return globalfmtDate(column, 10);
+                return globalfmtDate2(column,11,8);
             },
             // 过滤金额
         }

+ 1 - 1
src/components/SingleEquipInfo.vue

@@ -73,7 +73,7 @@
         watch: {
             totalRs: function (val) {
                 let that = this;
-                that.state = val.DetRs.WarnString == '检测安全';
+                that.state = val.BoolSafe == 0 ? true : false;
                 // that.time = val.DetRs.Dettime;
                 that.dangerItem = val.DetRs.WarnNum;
             },

+ 1 - 1
src/components/Watching.vue

@@ -46,7 +46,7 @@
                     that.safeNow = false;
                     for (var i = 0; i < word.length; i++) {
                         that.list.unshift(word[i]);
-                        if (that.list.length > 18) {
+                        if (that.list.length > 200) {
                             that.list.pop()
                         }
                     }

+ 11 - 7
src/views/Main.vue

@@ -147,11 +147,15 @@
         mounted() {
             let that = this;
             that.loadingState = false;
-            if (!localStorage.Start) {
-                localStorage.Start = 0;
-            } else {
-                // localStorage.Start = 0;
-            }
+
+            localStorage.Start = 0;
+            //
+            // if (!localStorage.Start) {
+            //     localStorage.Start = 0;
+            // } else {
+            //     // localStorage.Start = parseInt(localStorage.Start);
+            //     localStorage.Start = 0;
+            // }
 
             // 获取数据
             that.getDate();
@@ -274,7 +278,7 @@
                     let json = res;
                     if (json.Code == 0) {
                         that.historyRs = json;
-                        localStorage.Start = json.LastId;
+                        // localStorage.Start = json.LastId;
                     } else {
                         that.$message.error(json.Memo);
                     }
@@ -287,7 +291,7 @@
                     let json = res;
                     if (json.Code == 0) {
                         that.historyRs = json;
-                        localStorage.Start = json.LastId;
+                        // localStorage.Start = json.LastId;
                     } else {
                         that.$message.error(json.Memo);
                     }

+ 1 - 1
src/views/PhoneSign.vue

@@ -223,7 +223,7 @@
                 that.loading = true;
                 let param = {
                     token: localStorage.token,
-                    detectorId: that.panel.detidstr + ',',//探测器id列表
+                    detectorId: that.panel.detidstr,//探测器id列表
                     channel: that.panel.channel,//信道
                     bt: globaltime2String(that.panel.time1[0]) + ' 00:00:01',//开始时间
                     et: globaltime2String(that.panel.time1[1]) + ' 23:59:59',//结束时间