| | |
| | |
|
| | | //渲染历史数据列表
|
| | | function renderRecordInfo(data) {
|
| | |
|
| | | var num = getWHNum();
|
| | | var div_body_x = false;
|
| | | var thead = "";
|
| | | thead += "<tr><th style='width: 100px'>ID</th>";
|
| | |
| | | var theadData = [];
|
| | |
|
| | | if (data != null && data.length > 0) {
|
| | | // $.each(data, function (index, item) {
|
| | | // html += "<tr><td>" + item.id + "</td>";
|
| | | // html += "<td>" + item.name + "</td>";
|
| | | // html += "<td>" + timeStr(item.time) + "</td>";
|
| | | // var tempData = eval(item.value);
|
| | | // var temp = '';
|
| | | // for (var i = 0; i < tempData.length; i++) {
|
| | | // if (i != 0) {
|
| | | // temp += ",";
|
| | | // }
|
| | | // temp += tempData[i].name + "=" + tempData[i].value;
|
| | | // }
|
| | | // html += "</tr>";
|
| | | // });
|
| | |
|
| | |
|
| | | //获取表头
|
| | | $.each(data, function (index, item) {
|
| | | var tempData = eval(item.value);
|
| | |
| | | });
|
| | | // console.log(theadData);
|
| | | for(var i=0;i<theadData.length;i++){
|
| | | if(i >= 5){
|
| | | if(i >= num){
|
| | | break;
|
| | | }
|
| | | thead += "<th style='width: 150px'>"+ theadData[i].name +"</th>";
|
| | | }
|
| | | thead += "<th style='width: 150px'>详情</th>";
|
| | | thead += "<th style=''>详情</th>";
|
| | | thead += "</tr>";
|
| | |
|
| | | $.each(data, function (index, item) {
|
| | |
| | | tbody += "<td>" + timeStr(item.time) + "</td>";
|
| | | var tempData = eval(item.value);
|
| | | for (var i = 0; i < theadData.length; i++) {
|
| | | if(i >= 5){
|
| | | if(i >= num){
|
| | | break;
|
| | | }
|
| | | if(i < tempData.length){
|
| | |
| | | dataMap[key] = tempData;
|
| | | });
|
| | | } else {
|
| | | thead += "<th style='width: 150px'>数据</th></tr>";
|
| | | thead += "<th style=''>数据</th></tr>";
|
| | | tbody += '<tr><td colspan="4">暂未查到数据</td></tr>';
|
| | | }
|
| | | $("#div-body").attr("style","height: 615px;");
|
| | | // $("#div-body").attr("style","height: 615px;");
|
| | | $("#thead").html(thead);
|
| | | $("#recordList").html(tbody);
|
| | | }
|
| | |
| | |
|
| | | //导出Excel点击事件
|
| | | function generateClick(){
|
| | | // var tableId = "record-his-list";
|
| | | var request = {};
|
| | | request.id = $("#deviceId").val();
|
| | | if(!request.id)
|
| | |
| | | }
|
| | |
|
| | | function getTable(data) {
|
| | |
|
| | | var thead = "";
|
| | | thead += "<tr><th style='width: 100px'>ID</th>";
|
| | | thead += "<th style='width: 180px'>设备名称</th>";
|
| | |
| | | });
|
| | |
|
| | | $("#tbody").html(html);
|
| | |
|
| | | var paramWH = getWH("detail");
|
| | | layer.open({
|
| | | skin: 'mypop',
|
| | | type: 1,
|
| | | title: false,
|
| | | area: ['40%', '65%'],
|
| | | // area: ['40%', '65%'],
|
| | | area: [paramWH.w, paramWH.h],
|
| | | closeBtn: 0,
|
| | | shade: 0,
|
| | | scrollbar: false,
|
| | |
| | |
|
| | |
|
| | |
|
| | |
|
| | | function getWH(tag) {
|
| | | var res = {
|
| | | w:"50%",
|
| | | h:"64%"
|
| | | };
|
| | | if(screen.width==1920 && screen.height==1080){
|
| | | res = {w:"80%",h:"64%"};
|
| | | if(tag == "batchHandle"){
|
| | | res = {w:"80%",h:"64%"};
|
| | | }
|
| | | }else if(screen.width==1280 && screen.height==1024){
|
| | | res = {w:"80%",h:"64%"};
|
| | | if(tag == "detail"){
|
| | | res = {w:"80%",h:"95%"};
|
| | | }
|
| | | if(tag == "batchHandle"){
|
| | | res = {w:"80%",h:"64%"};
|
| | | }
|
| | | }else if(screen.width==1280 && screen.height==800){
|
| | | res = {w:"80%",h:"64%"};
|
| | | if(tag == "detail"){
|
| | | res = {w:"80%",h:"95%"};
|
| | | }
|
| | | if(tag == "batchHandle"){
|
| | | res = {w:"80%",h:"64%"};
|
| | | }
|
| | | }
|
| | | return res;
|
| | | }
|
| | |
|
| | | function getWHNum() {
|
| | | var res = 5;
|
| | | if(screen.width==1920){
|
| | | res = 5;
|
| | | }else if(screen.width==1280){
|
| | | res = 1;
|
| | | }
|
| | | return res;
|
| | | }
|