|
|
@@ -49,7 +49,6 @@ angular.module('app.intelligent').controller("humitureDetectionModel", function
|
|
49
|
49
|
},
|
|
50
|
50
|
success: function (data) {
|
|
51
|
51
|
td_type_4 = data.data.length * 2; // 层数
|
|
52
|
|
- // console.log("层数: " + data.data.length);
|
|
53
|
52
|
}
|
|
54
|
53
|
});
|
|
55
|
54
|
// 行/列
|
|
|
@@ -67,13 +66,10 @@ angular.module('app.intelligent').controller("humitureDetectionModel", function
|
|
67
|
66
|
success: function (data) {
|
|
68
|
67
|
td_type_5 = Object.keys(data.data[0]).length; // 温度表格单行温度值的数量
|
|
69
|
68
|
td_type_5_d = data.data.length; // 温度表格行数总大小
|
|
70
|
|
- // console.log("表格总大小: " + data.data.length);
|
|
71
|
|
- // console.log("单行大小: " + Object.keys(data.data[0]).length);
|
|
72
|
69
|
}
|
|
73
|
70
|
});
|
|
74
|
71
|
// 获取最长列(td)
|
|
75
|
72
|
var max = Math.max(td_type_1, td_type_2, td_type_3, td_type_4, td_type_5);
|
|
76
|
|
- // console.log("max: " + max);
|
|
77
|
73
|
// 计算合并列
|
|
78
|
74
|
if (max > td_type_1) {
|
|
79
|
75
|
// +2 分配给两个td
|
|
|
@@ -103,7 +99,6 @@ angular.module('app.intelligent').controller("humitureDetectionModel", function
|
|
103
|
99
|
$scope.td_type_5_avg = td_type_5_t / td_type_5 + 1; // 平均分,加1把自己算上
|
|
104
|
100
|
// 放行标志
|
|
105
|
101
|
$scope.td_type_5_avg_true = true;
|
|
106
|
|
- // console.log('整除avg: ' + $scope.td_type_5_avg);
|
|
107
|
102
|
} else { // 不能整除
|
|
108
|
103
|
var td_type_5_d = td_type_5_t - td_type_5_r; // 减掉多余
|
|
109
|
104
|
$scope.td_type_5_avg = td_type_5_d / (td_type_5 - 1) + 1; // 减掉多余的在平均分(平均-1),少分一份
|
|
|
@@ -111,14 +106,11 @@ angular.module('app.intelligent').controller("humitureDetectionModel", function
|
|
111
|
106
|
// 放行标志
|
|
112
|
107
|
$scope.td_type_5_avg_true = true;
|
|
113
|
108
|
$scope.td_type_5_avg_p_true = true;
|
|
114
|
|
- /*console.log('不能整除avg: ' + $scope.td_type_5_avg);
|
|
115
|
|
- console.log('不能整除avg_p: ' + $scope.td_type_5_avg_p);*/
|
|
116
|
109
|
}
|
|
117
|
110
|
} else { // 不够分,直接plus
|
|
118
|
111
|
$scope.td_type_5_avg_p = td_type_5_r + 1; // 加的1为自己
|
|
119
|
112
|
// 放行标志
|
|
120
|
113
|
$scope.td_type_5_avg_p_true = true;
|
|
121
|
|
- // console.log('不够avg: ' + $scope.td_type_5_avg_p);
|
|
122
|
114
|
}
|
|
123
|
115
|
}
|
|
124
|
116
|
/**
|
|
|
@@ -151,11 +143,8 @@ angular.module('app.intelligent').controller("humitureDetectionModel", function
|
|
151
|
143
|
// 层均温动态表格
|
|
152
|
144
|
temperatureRecordService.findByHouseAndTime(items.vCfCode, items.time, items.id).then(function (data) {
|
|
153
|
145
|
var dataLayerList = data.data;
|
|
154
|
|
- // console.log(dataLayerList, "dataLayerList");
|
|
155
|
|
- // console.log(100 / (dataLayerList.length * 2) + '%');
|
|
156
|
146
|
//根据返回数据算出层均温这行单元格的个数
|
|
157
|
147
|
var eachTdWidth = 100 / (dataLayerList.length * 2) + '%';
|
|
158
|
|
- // console.log(eachTdWidth);
|
|
159
|
148
|
if (dataLayerList != null && dataLayerList.length > 0) {
|
|
160
|
149
|
// for (var layer in dataLayerList) {
|
|
161
|
150
|
var layernumber = 1;
|
|
|
@@ -179,7 +168,6 @@ angular.module('app.intelligent').controller("humitureDetectionModel", function
|
|
179
|
168
|
// 点温表格
|
|
180
|
169
|
temperatureRecordService.findByTempTable(items.id).then(function (data) {
|
|
181
|
170
|
var detailList = data.data;
|
|
182
|
|
- // console.log(detailList,"detailList");
|
|
183
|
171
|
var trNum = 0;
|
|
184
|
172
|
/**
|
|
185
|
173
|
* $scope.td_type_5_avg_true = true;
|
|
|
@@ -193,15 +181,11 @@ angular.module('app.intelligent').controller("humitureDetectionModel", function
|
|
193
|
181
|
var lowTemp = $rootScope.warningValueList[$scope.vCfCode] == undefined
|
|
194
|
182
|
? -274 : $rootScope.warningValueList[$scope.vCfCode].low == undefined
|
|
195
|
183
|
? -274 : $rootScope.warningValueList[$scope.vCfCode].low; // 绝对0度为-273.15℃
|
|
196
|
|
- /*console.log('tallTemp: ' + tallTemp);
|
|
197
|
|
- console.log('lowTemp: ' + lowTemp);*/
|
|
198
|
184
|
// 层
|
|
199
|
185
|
// for (var key_z in detailList) {
|
|
200
|
186
|
var key_z = 1;
|
|
201
|
|
- // console.log("length: ",Object.keys(detailList).length);
|
|
202
|
187
|
// 天津库要求1层为最底层最大层数.
|
|
203
|
188
|
for (var i =1;i<= Object.keys(detailList).length; i++) {
|
|
204
|
|
- console.log(i,'层数');
|
|
205
|
189
|
if ($scope.td_type_5_avg_true) {
|
|
206
|
190
|
$("#t_body tr").eq(trNum).append(
|
|
207
|
191
|
"<td colspan='" + $scope.td_type_5_avg + "' style=\"border: 1px solid #000;text-align: center;\">"
|
|
|
@@ -215,31 +199,13 @@ angular.module('app.intelligent').controller("humitureDetectionModel", function
|
|
215
|
199
|
}
|
|
216
|
200
|
// 行
|
|
217
|
201
|
for (var key_x in detailList[i]) {
|
|
218
|
|
- // console.log(key_x,"key_x");
|
|
219
|
202
|
if ($scope.td_type_5_avg_true) {
|
|
220
|
|
- // console.log(11111);
|
|
221
|
|
-
|
|
222
|
|
-
|
|
223
|
|
- // $("#t_body tr").eq(trNum + 1).append(
|
|
224
|
|
- // "<td colspan='" + $scope.td_type_5_avg + "' style=\"border: 1px solid #000;text-align: center;\">"
|
|
225
|
|
- // + key_x + "</td>"
|
|
226
|
|
- // );
|
|
227
|
|
-
|
|
228
|
|
-
|
|
229
|
203
|
//设置边框为none
|
|
230
|
204
|
$("#t_body tr").eq(trNum + 1).append(
|
|
231
|
205
|
"<td colspan='" + $scope.td_type_5_avg + "' style=\"border:1 solid #000;text-align: center;\">"
|
|
232
|
206
|
+ key_x + "</td>"
|
|
233
|
207
|
);
|
|
234
|
208
|
} else {
|
|
235
|
|
- // console.log(22221111);
|
|
236
|
|
-
|
|
237
|
|
- // $("#t_body tr").eq(trNum + 1).append(
|
|
238
|
|
- // "<td colspan='" + $scope.td_type_5_avg_p + "' style=\"border: 1px solid #000;text-align: center;\">"
|
|
239
|
|
- // + key_x + "</td>"
|
|
240
|
|
- // );
|
|
241
|
|
-
|
|
242
|
|
-
|
|
243
|
209
|
$("#t_body tr").eq(trNum + 1).append(
|
|
244
|
210
|
"<td colspan='" + $scope.td_type_5_avg_p + "' style=\"border:1 solid #000;text-align: center;\">"
|
|
245
|
211
|
+ key_x + "</td>"
|
|
|
@@ -248,9 +214,6 @@ angular.module('app.intelligent').controller("humitureDetectionModel", function
|
|
248
|
214
|
}
|
|
249
|
215
|
// 列
|
|
250
|
216
|
for (var key_y in detailList[i][key_x]) {
|
|
251
|
|
- // console.log(key_y,"key_y")
|
|
252
|
|
- // key_y = 100 / (key_y+1) + '%';
|
|
253
|
|
- // console.log(key_y)
|
|
254
|
217
|
// 判断只在第一行上方添加列
|
|
255
|
218
|
if ("1" === key_x) {
|
|
256
|
219
|
$("#t_body tr").eq(trNum).append(
|
|
|
@@ -312,12 +275,6 @@ angular.module('app.intelligent').controller("humitureDetectionModel", function
|
|
312
|
275
|
// 去除多余tr
|
|
313
|
276
|
$("#t_body").find("tr:last").remove();
|
|
314
|
277
|
$("#t_body").find("tr:last").remove();
|
|
315
|
|
-
|
|
316
|
|
- /*// 去除多余tr
|
|
317
|
|
- var max = $("#t_body tr:last").index();//获取最后一行的索引值
|
|
318
|
|
- //获取比上面索引值小三的行,删除就行
|
|
319
|
|
- var get = max - 4;//注意这里是减四
|
|
320
|
|
- $("#t_body tr:gt(" + get + ")").remove();*/
|
|
321
|
278
|
});
|
|
322
|
279
|
};
|
|
323
|
280
|
|
|
|
@@ -334,15 +291,14 @@ angular.module('app.intelligent').controller("humitureDetectionModel", function
|
|
334
|
291
|
var xIny = 12; // 每行多少列
|
|
335
|
292
|
var trNum = 0; // td位置初始化
|
|
336
|
293
|
var gs = 1; // 初始化每层数据量
|
|
337
|
|
- // console.log("detailMap->", detailMap);
|
|
|
294
|
+
|
|
338
|
295
|
var layerNumber = Object.keys(detailMap).length; // z层数
|
|
339
|
|
- // console.log("detailMapSize->", layerNumber);
|
|
340
|
|
- // var zr = layerNumber; // 初始获取层,倒叙获取数据
|
|
|
296
|
+
|
|
341
|
297
|
var yNumber = detailMap[1].length; // 单层大小(y列数)
|
|
342
|
|
- // console.log(yNumber);
|
|
|
298
|
+
|
|
343
|
299
|
// 计算分几列
|
|
344
|
300
|
var groups = Math.ceil(yNumber / xIny); // 向正无穷取整
|
|
345
|
|
- // console.log("groups->", groups);
|
|
|
301
|
+
|
|
346
|
302
|
var gs1 = 0; // 初始化每层数据数据
|
|
347
|
303
|
|
|
348
|
304
|
/**
|
|
|
@@ -416,41 +372,6 @@ angular.module('app.intelligent').controller("humitureDetectionModel", function
|
|
416
|
372
|
+ '层号' + "</td>"
|
|
417
|
373
|
);
|
|
418
|
374
|
|
|
419
|
|
- /*// 添加层编号
|
|
420
|
|
- var zr = layerNumber; // 初始获取层,倒叙获取数据
|
|
421
|
|
- for (var j = 1; j <= layerNumber; j++) { // 行
|
|
422
|
|
- // 行号
|
|
423
|
|
- if (trNum % xIny === 1) {
|
|
424
|
|
- trNum++; // 向下移一位
|
|
425
|
|
- $("#t_body tr").eq(trNum).append(
|
|
426
|
|
- "<td style=\"border: 1px solid #000;text-align: center;\">"
|
|
427
|
|
- + j + "</td>");
|
|
428
|
|
- } else {
|
|
429
|
|
- trNum++; // 向下移一位
|
|
430
|
|
- $("#t_body tr").eq(trNum).append(
|
|
431
|
|
- "<td style=\"border: 1px solid #000;text-align: center;\">"
|
|
432
|
|
- + j + "</td>");
|
|
433
|
|
- }
|
|
434
|
|
- zr--; // 定义倒叙取值
|
|
435
|
|
- for (var k = 1; k <= xIny; k++) { // 列
|
|
436
|
|
- console.log("trNum->",trNum);
|
|
437
|
|
- if (trNum % xIny === 1) { // 列号
|
|
438
|
|
- // var trT1 = trNum - 1;
|
|
439
|
|
- $("#t_body tr").eq(trNum).append(
|
|
440
|
|
- "<td style=\"border: 1px solid #000;text-align: center;\">"
|
|
441
|
|
- + k + "</td>");
|
|
442
|
|
- } else { // 列值
|
|
443
|
|
- trNum++;
|
|
444
|
|
- $("#t_body tr").eq(trNum).append(
|
|
445
|
|
- "<td style=\"border: 1px solid #000;text-align: center;\">"
|
|
446
|
|
- + 'k' + "</td>");
|
|
447
|
|
- }
|
|
448
|
|
- }
|
|
449
|
|
- trNum++;
|
|
450
|
|
-
|
|
451
|
|
- }*/
|
|
452
|
|
- // trNum++;
|
|
453
|
|
-
|
|
454
|
375
|
// 每列显示12条
|
|
455
|
376
|
for (var z = 0; z < xIny; z++) {
|
|
456
|
377
|
if (gs <= yNumber) { // 每层数据个数分散添加
|
|
|
@@ -480,13 +401,10 @@ angular.module('app.intelligent').controller("humitureDetectionModel", function
|
|
480
|
401
|
gs1 = i * xIny;
|
|
481
|
402
|
}
|
|
482
|
403
|
for (var k = 0; k < xIny; k++) {
|
|
483
|
|
- // console.log("zr,gs1->",zr,gs1);
|
|
|
404
|
+
|
|
484
|
405
|
if (gs1 < yNumber) {
|
|
485
|
406
|
var temp = detailMap[zr][gs1].temp;
|
|
486
|
|
- /*$("#t_body tr").eq(trNum).append(
|
|
487
|
|
- "<td style=\"border: 1px solid #000;text-align: center;\">"
|
|
488
|
|
- + zr + ':' + gs1 + "</td>"
|
|
489
|
|
- );*/
|
|
|
407
|
+
|
|
490
|
408
|
// 过滤高低温设备异常报警
|
|
491
|
409
|
if (temp == 250) { // 250设备异常
|
|
492
|
410
|
$("#t_body tr").eq(trNum).append(
|
|
|
@@ -551,7 +469,7 @@ angular.module('app.intelligent').controller("humitureDetectionModel", function
|
|
551
|
469
|
// 是否为浅圆仓
|
|
552
|
470
|
if (dictionaryId === 2973 && dictionaryName === '浅圆仓') // 是浅圆仓
|
|
553
|
471
|
{
|
|
554
|
|
- // console.log(dictionaryId, ": ", dictionaryName);
|
|
|
472
|
+
|
|
555
|
473
|
// 层温
|
|
556
|
474
|
$scope.layersAvgTemp();
|
|
557
|
475
|
// 浅圆仓点温 shallowCircular
|
|
|
@@ -643,7 +561,6 @@ angular.module('app.intelligent').controller("humitureDetectionModel", function
|
|
643
|
561
|
|
|
644
|
562
|
// 导出excel
|
|
645
|
563
|
$scope.exportToExcel = function (tableId) {
|
|
646
|
|
- // console.log("导出");
|
|
647
|
564
|
var excelTime = $filter('date')(new Date(), "yyyyMMddhhmmss");
|
|
648
|
565
|
var exportHref = Excel.tableToExcel(tableId, 'worksheetName');
|
|
649
|
566
|
$timeout(function () {
|