From 9382a00fe89139663216673a1a8e8ddb8761a14d Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期二, 06 六月 2023 20:13:19 +0800
Subject: [PATCH] 无数据时的页面
---
igds-app/js/admin/es-read-meter.js | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 50 insertions(+), 6 deletions(-)
diff --git a/igds-app/js/admin/es-read-meter.js b/igds-app/js/admin/es-read-meter.js
index 5f78e17..b14cd7b 100644
--- a/igds-app/js/admin/es-read-meter.js
+++ b/igds-app/js/admin/es-read-meter.js
@@ -23,6 +23,7 @@
getMeterList();
}
+//鏃ユ湡鏍煎紡鍖杫yyy-MM-dd
function getDate(date) {
var year = date.getFullYear();
var month, day;
@@ -50,7 +51,7 @@
getMeterList();
})
}
-
+//鍔犲噺鏃ユ湡锛堝ぉ鏁帮級
function addAndReduceDay(tag) {
var date = new Date(dateTime);
date = date.setDate(date.getDate() + tag);
@@ -61,9 +62,9 @@
}
-//
+//娓叉煋椤甸潰
function getMeterList() {
- //
+ //璧嬪�煎弬鏁扮殑鏃ユ湡
data.data.dataTime = dateTime
mui.ajax(url, {
type: "POST",
@@ -85,18 +86,61 @@
mui.alert("绯荤粺绻佸繖,璇烽噸璇曪紒", "鎻愮ず", ["纭畾"], function() {}, "div")
}
})
+ meterList = [{
+ "depotId": "40",
+ "depotName": "閲屾秷绗鍔℃剰蹇�",
+ "epSum": 36,
+ "eqSum": 51,
+ "updateTime": "2004-04-04 17:19:14",
+ "esSum": 13
+ },
+ {
+ "depotId": "84",
+ "depotName": "鐭宠�佹潈鍙婂湴鍦�",
+ "epSum": 48,
+ "eqSum": 57,
+ "updateTime": "1973-05-07 03:38:11",
+ "esSum": 7
+ },
+ {
+ "depotId": "39",
+ "depotName": "鍐冲惉鍐涚粡鏍煎瀷鍛�",
+ "epSum": 36,
+ "eqSum": 3,
+ "updateTime": "2003-09-19 06:57:50",
+ "esSum": 72
+ },
+ {
+ "depotId": "77",
+ "depotName": "闄粈鏈熺敱淇¤嚜鑸�",
+ "epSum": 44,
+ "eqSum": 59,
+ "updateTime": "1984-02-29 20:11:43",
+ "esSum": 92
+ },
+ {
+ "depotId": "21",
+ "depotName": "鎶ュ�欒仈鏈�",
+ "epSum": 40,
+ "eqSum": 15,
+ "updateTime": "2016-03-20 19:38:43",
+ "esSum": ""
+ }
+ ]
}
//娓叉煋椤甸潰
function renderData() {
var html = ''
if (meterList && meterList.length > 0) {
$.each(meterList, function(index, item) {
- html += '<div class="m-ck-cont"><div class="g-titck1">' + item.depotName + ' <span class="right">鏇存柊鏃堕棿: ' + item.updateTime + '</span></div>';
+ html += '<div class="m-ck-cont"><div class="g-titck1">' + item.depotName +
+ ' <span class="right">鏇存柊鏃堕棿: ' + item.updateTime + '</span></div>';
html += '<div class="m-energy2"><ul class="ul-txtliste1"><li><div class="con">';
- html += '<div class="num">' + item.epSum + ' <span>KWh</span></div><div class="desc">鏈夊姛鐢佃兘</div></div></li>';
+ html += '<div class="num">' + item.epSum +
+ ' <span>KWh</span></div><div class="desc">鏈夊姛鐢佃兘</div></div></li>';
html += '<li><div class="con"><div class="num">' + item.eqSum + ' <span>KWh</span></div>'
html += '<div class="desc">鏃犲姛鐢佃兘</div></div></li>';
- html += '<li><div class="con"><div class="num">' + item.esSum + ' <span>KWh</span></div>';
+ html += '<li><div class="con"><div class="num">' + (item.esSum == null || item.esSum == "" ? "--" : item.esSum) + ' <span>KWh</span></div>';
html += '<div class="desc">鎬荤數鑳�</div></div></li>'
html += '</ul></div></div>';
})
--
Gitblit v1.9.3