From c7ba1ce89a2a552eee9b5edadc9a302d8aafb05b Mon Sep 17 00:00:00 2001 From: YYC <1833023622@qq.com> Date: 星期二, 13 六月 2023 15:15:16 +0800 Subject: [PATCH] 细节修改 --- igds-app/js/admin/es-real-electric.js | 108 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 99 insertions(+), 9 deletions(-) diff --git a/igds-app/js/admin/es-real-electric.js b/igds-app/js/admin/es-real-electric.js index 561c668..07cdfc3 100644 --- a/igds-app/js/admin/es-real-electric.js +++ b/igds-app/js/admin/es-real-electric.js @@ -1,5 +1,6 @@ var url; var electricList; +var dateTime; var data = { "interfaceId": "5501", "outId": "10501", @@ -16,8 +17,27 @@ url = user.url + "/api-phone/v35/gateway"; data.tokenAuth = user.tokenAuth; data.data.deptId = selectDeptId; + dateTime = getDate(new Date()); getElectric(); } + +//鏃ユ湡鏍煎紡鍖杫yyy-MM-dd +function getDate(date) { + var year = date.getFullYear(); + var month, day,hour,minute; + month = date.getMonth() + 1; + if (month > 0 && month <= 9) { + month = "0" + month; + } + day = date.getDate() + if (day > 0 && day <= 9) { + day = "0" + day + } + hour = date.getHours(); + minute = date.getMinutes(); + return year + "-" + month + "-" + day + " "+ hour + ":" + minute +} + function getElectric() { mui.ajax(url, { type: "POST", @@ -39,6 +59,68 @@ mui.alert("绯荤粺绻佸繖,璇烽噸璇曪紒", "鎻愮ず", ["纭畾"], function() {}, "div") } }) + // electricList = [{ + // "depotId": "18", + // "depotName": "鍋氫竴鍑犲姞", + // "depotType": "02", + // "ua": 97, + // "ub": 43, + // "uc": 81, + // "ia": 85, + // "ib": 76, + // "ic": 43, + // "updateTime": "1982-03-19 23:26:43" + // }, + // { + // "depotId": "35", + // "depotName": "灞傝兘姣旂淮", + // "depotType": "01", + // "ua": 71, + // "ub": 60, + // "uc": 45, + // "ia": 22, + // "ib": 42, + // "ic": 12, + // "updateTime": "1980-11-10 20:35:36" + // }, + // { + // "depotId": "61", + // "depotName": "浠庡懆闃剁孩", + // "depotType": "02", + // "ua": 88, + // "ub": 94, + // "uc": 77, + // "ia": 33, + // "ib": 83, + // "ic": 67, + // "updateTime": "1972-03-23 06:15:44" + // }, + // { + // "depotId": "31", + // "depotName": "鐏簲鍐垫柉", + // "depotType": "03", + // "ua": 76, + // "ub": 76, + // "uc": 68, + // "ia": 80, + // "ib": 54, + // "ic": 2, + // "updateTime": "2010-02-02 15:07:12" + // }, + // { + // "depotId": "20", + // "depotName": "璇濈編涔︾潃鍏�", + // "depotType": "01", + // "ua": 96, + // "ub": 5, + // "uc": 83, + // "ia": 74, + // "ib": 49, + // "ic": 37, + // "updateTime": "2007-11-02 05:03:29" + // } + // ] + } //娓叉煋椤甸潰 function renderData() { @@ -46,18 +128,17 @@ if (electricList && electricList.length > 0) { $.each(electricList, function(index, item) { html += '<li><div class="con"><div class="tit"><div class="t1">'; - if (index % 3 == 0) { + if (item.depotType == '01') { html += '<span class="bg" style="background-image: url(images/d1.png);"></span>'; - } - if (index % 3 == 1) { + } else if (item.depotType == '02') { html += '<span class="bg" style="background-image: url(images/d2.png);"></span>' } - if (index % 3 == 2) { + if (item.depotType == '03') { html += '<span class="bg" style="background-image: url(images/d3.png);"></span>' } - html += '<span>' + item.depotName + '</span></div><span class="time">' + item.updateTime + - '</span></div>'; - html += '<div class="inner"><div class="info">鏈�杩戜竴灏忔椂鐢ㄨ兘: <span>10.0</span>KW-h</div>'; + html += '<span>' + item.depotName + '</span></div></div>'; + html += '<div class="inner"><div class="info">鏇存柊鏃堕棿: <span style="font-size:15px">' + item + .updateTime + '</span></div>'; html += '<div class="txt"><div class="num">' + item.ua + ' <span> V</span></div><div class="desc">A鐩哥數鍘�</div></div>'; html += '<div class="txt"><div class="num">' + item.ub + @@ -73,8 +154,17 @@ html += '</div></div></li>' }) } else { - html += - '<li><div class="con myfancy" style="text-align: center;font-size: 20px;color:#dd524d">鏆傛棤瀹炴椂閰嶇數淇℃伅</div></li>'; + html += '<li><div class="con"><div class="tit"><div class="t1">'; + html += '<span class="bg" style="background-image: url(images/d1.png);"></span>'; + html += '<span>鏆傛棤閰嶇數鏁版嵁</span></div></div>'; + html += '<div class="inner"><div class="info">鏇存柊鏃堕棿: <span style="font-size:15px">' + dateTime + '</span></div>'; + html += '<div class="txt"><div class="num">0<span> V</span></div><div class="desc">A鐩哥數鍘�</div></div>'; + html += '<div class="txt"><div class="num">0<span> V</span></div><div class="desc">B鐩哥數鍘�</div></div>'; + html += '<div class="txt"><div class="num">0<span> V</span></div><div class="desc">B鐩哥數鍘�</div></div>'; + html += '<div class="txt"><div class="num">0<span> V</span></div><div class="desc">A鐩哥數娴�</div></div>'; + html += '<div class="txt"><div class="num">0<span> V</span></div><div class="desc">B鐩哥數娴�</div></div>'; + html += '<div class="txt"><div class="num">0<span> V</span></div><div class="desc">C鐩哥數娴�</div></div>'; + html += '</div></div></li>' } $("#recordList").html(html); } -- Gitblit v1.9.3