| | |
| | | getMeterList(); |
| | | } |
| | | |
| | | //日期格式化yyyy-MM-dd |
| | | function getDate(date) { |
| | | var year = date.getFullYear(); |
| | | var month, day; |
| | |
| | | getMeterList(); |
| | | }) |
| | | } |
| | | |
| | | //加减日期(天数) |
| | | function addAndReduceDay(tag) { |
| | | var date = new Date(dateTime); |
| | | date = date.setDate(date.getDate() + tag); |
| | |
| | | |
| | | } |
| | | |
| | | // |
| | | //渲染页面 |
| | | function getMeterList() { |
| | | // |
| | | //赋值参数的日期 |
| | | data.data.dataTime = dateTime |
| | | mui.ajax(url, { |
| | | type: "POST", |
| | |
| | | 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>'; |
| | | }) |