jiazx0107@163.com
2023-11-04 43ce77a85d8297a53dc25430fff10ead57296167
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
var layer;
var bizCharts = {};
var pageDepot = 0;
var totalDepot = 1;
var pageGas = 1;
var totalGas = 1;
var grainIndex = 0;
var gasIndex = 0;
var timer;
var screen = true;
$(function () {
    layui.use(['layer', 'laydate', 'form'], function () {
        layer = layui.layer;
        // 初始页面
        init();
        $("body").dblclick(function () {
            if (screen) {
                requestFullScreen();
            } else {
                exitFullscreen();
            }
        });
    });
 
    // 初始化WebSocket
    initWS(deptId, bizType, bizTag, userId);
});
 
function init() {
    // 初始背景效果
    initBg();
    initTime();
    initDicSlogan();
    initWeather();
    // 初始化页面中7张echart图表
    bizCharts = initCharts();
    renderBasicInfo();
    renderDepot();
    renderGrain();
    reloadChartGas();
    reloadChartdepot();
    // renderEsChart();
    clearInterval(timer);
    timing();
    initInoutData();
}
 
// socket信息返回處理
function socketOnMessage(pocket) {
    //console.log(pocket);
    if (pocket.bizId == "slogan") {
        var data = pocket.data;
        dicSlogan = data;
        initDicSlogan();
    }
    if (pocket.bizId == "grain") {
        var data = pocket.data;
        mapGrain = data;
    }
    if (pocket.bizId == "gas") {
        var data = pocket.data;
        mapGas = data;
    }
    if (pocket.bizId == "weather") {
        weatherInfo = pocket.data;
        initWeather()
    }
    if (pocket.bizId == "depot") {
        listDepot = pocket.data;
        pageDepot = 0;
        renderDepot();
        reloadChartdepot();
    }
 
    if (pocket.bizId == "es") {//能耗信息推送
        esChart = pocket.data;
        renderEsChart();
    }
    if (pocket.bizId == "IN_OUT_SUMMARY") {
        inoutData = pocket.data;
        renderSumData(inoutData);
    }
};
 
function timing() {
    timer = setInterval(function () {
        dong();
        renderGrain();
        reloadChartGas();
    }, 15000);
}
 
/**
 * 渲染库区基本信息
 */
function renderBasicInfo() {
    if(deptInfo){
        $("#cityAndCounty").html(deptInfo.addr == null ? "":deptInfo.addr);
        $("#deptName").html(deptInfo.deptName == null ? "":deptInfo.deptName);
        $("#depotNum").html(deptInfo.depotNum == null ? "0":deptInfo.depotNum);
        $("#depotOilNum").html(deptInfo.depotOilNum == null ? "0":deptInfo.depotOilNum);
        $("#foodStorage").html(deptInfo.foodStorage == null ? "0":deptInfo.foodStorage);
        $("#oilStorage").html(deptInfo.oilStorage == null ? "0":deptInfo.oilStorage);
        $("#storage").html(deptInfo.storage == null ? "0":deptInfo.storage);
    }
}
 
function initCharts() {
    // var chartEnergy = initChartEnergy();
    var chartGasCO2 = initChartGasCO2();
    var chartGasPH3 = initChartGasPH3();
    var chartGasO2 = initChartGasO2();
    var chartFoodType = initChartFoodType();
    var chartFoodVariety = initChartFoodVariety();
    var chartFoodLevel = initChartFoodLevel();
    return {
        // "chartEnergy": chartEnergy,
        "chartGasCO2": chartGasCO2,
        "chartGasPH3": chartGasPH3,
        "chartGasO2": chartGasO2,
        "chartFoodType": chartFoodType,
        "chartFoodVariety": chartFoodVariety,
        "chartFoodLevel": chartFoodLevel
    };
}
 
/**
 * 初始标语数据
 */
function initDicSlogan() {
    if (dicSlogan) {
        if (dicSlogan.color == "red") {
            $("#sloganText").css({
                color: "#DE2910"
            });
        } else {
            $("#sloganText").css({
                color: "#7ddfff"
            });
        }
        $("#sloganText").text(dicSlogan.content);
    }
}
 
function initWeather() {
    if (weatherInfo) {
        // console.log(weatherInfo);
 
        var wendu = '';
        if (weatherInfo.temp) {
            wendu = weatherInfo.temp.replace("℃", "");
        }
        $("#weather_wendu").html("<span>" + wendu + "</span>℃");
 
 
        var shidu = '';
        if (weatherInfo.humidity) {
            shidu = weatherInfo.humidity.replace("%", "");
        }
        $("#weather_shidu").html("<span>" + shidu + "</span>%");
 
        var tianqi = '';
        if (weatherInfo.weather) {
            tianqi = weatherInfo.weather;
        }
        $("#weather_tianqi").html("<em>" + tianqi + "</em>");
 
        var windSpeed = '';
        if (weatherInfo.windSpeed) {
            windSpeed = weatherInfo.windSpeed;
        }
        $("#windSpeed").html("<span>" + windSpeed + "</span>");
 
        var fengxiang = '';
        if (weatherInfo.windDirection) {
            fengxiang = weatherInfo.windDirection;
        }
        $("#weather_fengxiang").html("<em>" + fengxiang + "</em>");
 
        var time = '';
        if (weatherInfo.updateTimeStr) {
            time = weatherInfo.updateTimeStr;
        }
        $("#weather_time").text("更新时间 : " + time);
    }
}
 
/**
 * 时间等
 */
function initTime() {
    setInterval(function () {
        var now = new Date();
        var time = now.toLocaleString('chinese', {
            hour12: false
        });
        $(".time-info").text(time);
    }, 1000);
}
 
/**
 * 通知后台推送一次出入库数据
 */
function initInoutData() {
    $.ajax({
        type: "POST",
        url: "../../basic/databoard/init-inout-data",
        dataType: "json",
        contentType: "application/json;charset=UTF-8",
        data: JSON.stringify({
            "deptId": deptId
        }),
        success: function (result) {
            console.log("初始成功!");
        },
        error: function (result) {
            console.log("初始失败!");
        }
    });
}
 
/**
 * 渲染出入库统计信息
 * @param sumData
 */
 
function renderSumData(sumData) {
    if (sumData) {
        $("#inCarNum").text((sumData.inSumNum != null ? sumData.inSumNum : 0));
        $("#inCompleteCarNum").text((sumData.inComplateNum != null ? sumData.inComplateNum : 0));
        $("#outCarNum").text((sumData.outSumNum != null ? sumData.outSumNum : 0));
        $("#outCompleteCarNum").text((sumData.outComplateNum != null ? sumData.outComplateNum : 0));
 
        $("#inPerDiv").animate({width: (sumData.perInComplate != null ? sumData.perInComplate : 0) + "%"}, "normal");
        $("#inPerSpan").text((sumData.perInComplate != null ? sumData.perInComplate : 0) + "%");
        $("#outPerDiv").animate({width: (sumData.perOutComplate != null ? sumData.perOutComplate : 0) + "%"}, "normal");
        $("#outPerSpan").text((sumData.perOutComplate != null ? sumData.perOutComplate : 0) + "%");
    }
};
 
// /**
//  * 渲染能耗信息
//  */
// function renderEsChart() {
//     if (!esChart) return;
//     var chartEnergy = bizCharts.chartEnergy;
//     chartEnergy.option.xAxis[0].data = esChart.xaxisData;
//     chartEnergy.option.series[0].data = esChart.series[0].data;
//     chartEnergy.chart.setOption(chartEnergy.option, true);
//
//     bizCharts.chartEnergy = chartEnergy;
// };
 
/**
 * 渲染仓库
 */
function renderDepot() {
    if (listDepot == null || listDepot.length <= 0)
        return;
    // 先清空,在渲染
    $("#depotShowDiv").html("");
    $("#depotTabDiv").html("");
    var pageNo = 1;
    // 计算总页数
    var total = listDepot.length / 4;
    if (!(listDepot.length % 4 == 0)) {
        total++;
    }
    var html = "<div class=\"i-tab-item show\">" + "<ul class=\"i-tab-list\">";
    var curDepot;
    for (var i = 1; i <= listDepot.length; i++) {
        curDepot = listDepot[i - 1];
        html += "<li>"
            + "<a href=\"#\">"
            + "<div class=\"i-tab-top\">"
            + "<h3>"
            + (curDepot.name == null ? "" : curDepot.name)
            + "</h3>"
            + "<p>仓储性质: "
            + (curDepot.foodTypeName == null ? "" : curDepot.foodTypeName)
            + "</p>"
            + "<p>保&nbsp;管&nbsp;员: "
            + (curDepot.storeKeeperName == null ? ""
                : curDepot.storeKeeperName) + "</p>" + "</div>"
            + "<div class=\"i-tab-bottom\">";
 
        // 仓库状态
        if (curDepot.depotStatus == DepotStatus.S_01) {
            html += "<i><img src=\"../../static/img/databoard/icon-kong.png\"/></i>";
            html += "<h4>空仓</h4>" + "<p>空置中</p>" + "</div>" + "</a>" + "</li>";
        } else if (curDepot.depotStatus == DepotStatus.S_02) {
            html += "<i><img src=\"../../static/img/databoard/icon-man.png\"/></i>";
            html += "<h4>满仓</h4>" + "<p>正常状态</p>" + "</div>" + "</a>" + "</li>";
        } else if (curDepot.depotStatus == DepotStatus.S_03) {
            html += "<i><img src=\"../../static/img/databoard/icon-ruku-big.png\"/></i>";
            html += "<h4>入库</h4>" + "<p>入库执行中</p>" + "</div>" + "</a>"
                + "</li>";
        } else if (curDepot.depotStatus == DepotStatus.S_04) {
            html += "<i><img src=\"../../static/img/databoard/icon-chuku-big.png\"/></i>";
            html += "<h4>出库</h4>" + "<p>出库执行中</p>" + "</div>" + "</a>"
                + "</li>";
        } else if (curDepot.depotStatus == DepotStatus.S_05) {
            html += "<i><img src=\"../../static/img/databoard/icon-qidiao.png\"/></i>";
            html += "<h4>气调</h4>" + "<p>不可执行通风等操作</p>" + "</div>" + "</a>"
                + "</li>";
        } else if (curDepot.depotStatus == DepotStatus.S_06) {
            html += "<i><img src=\"../../static/img/databoard/icon-zhengxun.png\"/></i>";
            html += "<h4>熏蒸</h4>" + "<p>请注意安全</p>" + "</div>" + "</a>"
                + "</li>";
        } else if (curDepot.depotStatus == DepotStatus.S_07) {
            html += "<i><img src=\"../../static/img/databoard/icon-tongfeng.png\"/></i>";
            html += "<h4>通风</h4>" + "<p>请注意雨水天气</p>" + "</div>" + "</a>"
                + "</li>";
        } else if (curDepot.depotStatus == DepotStatus.S_08) {
            html += "<i><img src=\"../../static/img/databoard/icon-weixiu.png\"/></i>";
            html += "<h4>维修</h4>" + "<p>仓库维修中</p>" + "</div>" + "</a>"
                + "</li>";
        } else {
            html += "<i><img src=\"../../static/img/databoard/icon-man.png\"/></i>";
            html += "<h4>满仓</h4>" + "<p>正常状态</p>" + "</div>" + "</a>" + "</li>";
        }
 
        if ((i % 4) == 0) {
            html += "</ul></div>";
            pageNo++;
            if (pageNo <= total) {
                html += "<div class=\"i-tab-item\"><ul class=\"i-tab-list\">";
            }
        }
        if (i == listDepot.length) {
            html += "</ul></div>";
        }
    }
    $("#depotShowDiv").html(html);
    var tabHtml = "";
    for (var k = 0; k < total; k++) {
        if (k == 0) {
            tabHtml += "<span class=\"active\"></span>";
        } else {
            tabHtml += "<span ></span>";
        }
    }
    $("#depotTabDiv").html(tabHtml);
    // 绑定切换事件
    totalDepot = $('.i-tab-hd span').length;
    pageDepot = 0;
    var $tabHd = $(".i-tab-hd span");
 
    $tabHd.hover(function (a) {
        clearInterval(timer);
        var $index = $tabHd.index(this);
        var $tabBd = $(".i-tab-bd .i-tab-item");
        i = $index;
        $(this).addClass("active").siblings().removeClass("active");
        $tabBd.eq($index).addClass("show").siblings().removeClass("show");
    }, function () {
        timer = setInterval(dong, 15000);
    });
}
 
function dong() {
    pageDepot++;
    if (pageDepot >= totalDepot) {
        pageDepot = 0;
    }
    selectimg(pageDepot);
}
 
function selectimg(i) {
    var $tabHd = $(".i-tab-hd span");
    $tabHd.eq(i).addClass("active").siblings().removeClass("active");
    $(".i-tab-bd .i-tab-item").eq(i).addClass("show").siblings(".i-tab-item")
        .removeClass("show");
}
 
/**
 * 渲染粮情,参数为页码
 *
 * @param pageNoGrain
 */
function renderGrain() {
    if (listDepot == null || listDepot.length <= 0)
        return;
    // 先清空,在渲染
 
    var html = "";
    var dateStr;
    if (mapGrain) {
        var count = 0;
        for (var i = grainIndex; i < listDepot.length; i++, grainIndex++) {
            var grain = mapGrain[listDepot[grainIndex].id];
            if (grain) {
                html += "<dl class=\"i-m1-dl\">" + "<dt><a href=\"#\">"
                    + (listDepot[grainIndex].name == null ? "" : listDepot[grainIndex].name)
                    + "</a></dt>";
                dateStr = grain.receiveDate;
                if (dateStr) {
                    var d = new Date(dateStr);
                    dateStr = (d.getMonth() + 1) + "-" + d.getDate();
                } else {
                    dateStr = "";
                }
 
                html += "<dd>" + (grain.tempMax == null ? "-" : (grain.tempMax == "-100" ? "备用":grain.tempMax.toFixed(1))) + "</dd>";
                html += "<dd>" + (grain.tempMin == null ? "-" : (grain.tempMin == "-100" ? "备用":grain.tempMin.toFixed(1))) + "</dd>";
                html += "<dd>" + (grain.tempAve == null ? "-" : (grain.tempAve == "-100" ? "备用":grain.tempAve.toFixed(1))) + "</dd>";
                html += "<dd>" + (grain.tempIn == null ? "-" : (grain.tempIn == "-100" ? "备用":grain.tempIn.toFixed(1))) + "</dd>";
                html += "<dd>" + (grain.humidityIn == null ? "-" : (grain.humidityIn == "-100" ? "备用":grain.humidityIn.toFixed(1))) + "</dd>";
                html += "<dd>" + dateStr + "</dd>" + "</dl>";
 
                count++;
            }
            if (grainIndex == (listDepot.length - 1)) {
                grainIndex = 0;
                break;
            }
            if (count == 10) {
                grainIndex++;
                break;
            }
        }
    } else {
        console.log("粮情信息为空!");
    }
    if (html) {
        $("#grainShowDiv").html("");
        $("#grainShowDiv").html(html);
    }
}
 
/**
 * 渲染气体图表
 *
 * @param index
 */
function reloadChartGas() {
    var chartGasCO2 = bizCharts.chartGasCO2;
    var chartGasPH3 = bizCharts.chartGasPH3;
    var chartGasO2 = bizCharts.chartGasO2;
    if (mapGas) {
        if (gasIndex == (listDepot.length)) {
            gasIndex = 0;
        }
        var gas = mapGas[listDepot[gasIndex].id];
        var depot = listDepot[gasIndex];
        $("#gasDepotName").text((depot.name == null ? "" : depot.name));
        if (gas) {
            var dateStr = gas.receiveDate;
            if (dateStr) {
                var d = new Date(dateStr);
                dateStr = (d.getMonth() + 1) + "-" + d.getDate();
            } else {
                dateStr = "";
            }
            $("#gasCheckTime").text("检测时间: " + dateStr);
            chartGasCO2.option.series[0].data[0].value = (gas.perCo2 == null ? 0
                : gas.perCo2);
            chartGasCO2.chart.setOption(chartGasCO2.option, true);
            chartGasPH3.option.series[0].data[0].value = (gas.perPh3 == null ? 0
                : gas.perPh3);
            chartGasPH3.chart.setOption(chartGasPH3.option, true);
            chartGasO2.option.series[0].data[0].value = (gas.perO2 == null ? 0
                : gas.perO2);
            chartGasO2.chart.setOption(chartGasO2.option, true);
        }else {
            $("#gasCheckTime").text("检测时间: 00-00");
            chartGasCO2.option.series[0].data[0].value = 0;
            chartGasCO2.chart.setOption(chartGasCO2.option, true);
            chartGasPH3.option.series[0].data[0].value = 0;
            chartGasPH3.chart.setOption(chartGasPH3.option, true);
            chartGasO2.option.series[0].data[0].value = 0;
            chartGasO2.chart.setOption(chartGasO2.option, true);
        }
        gasIndex++;
    } else {
        $("#gasDepotName").text("仓库");
        $("#gasCheckTime").text("检测时间: 00-00");
        chartGasCO2.option.series[0].data[0].value = 0;
        chartGasCO2.chart.setOption(chartGasCO2.option, true);
        chartGasPH3.option.series[0].data[0].value = 0;
        chartGasPH3.chart.setOption(chartGasPH3.option, true);
        chartGasO2.option.series[0].data[0].value = 0;
        chartGasO2.chart.setOption(chartGasO2.option, true);
        console.log("气体数据为空,显示默认数据")
    }
    bizCharts.chartGasCO2 = chartGasCO2;
    bizCharts.chartGasPH3 = chartGasPH3;
    bizCharts.chartGasO2 = chartGasO2;
}
// function reloadChartGas() {
//     var chartGasCO2 = bizCharts.chartGasCO2;
//     var chartGasPH3 = bizCharts.chartGasPH3;
//     var chartGasO2 = bizCharts.chartGasO2;
//     if (mapGas) {
//         var count = 0;
//         for (var i = gasIndex; i < listDepot.length; i++, gasIndex++) {
//             var gas = mapGas[listDepot[gasIndex].id];
//             if (gas) {
//                 var depot = listDepot[gasIndex];
//
//                 $("#gasDepotName").text((depot.name == null ? "" : depot.name));
//                 var dateStr = gas.receiveDate;
//                 if (dateStr) {
//                     var d = new Date(dateStr);
//                     dateStr = (d.getMonth() + 1) + "-" + d.getDate();
//                 } else {
//                     dateStr = "";
//                 }
//                 $("#gasCheckTime").text("检测时间: " + dateStr);
//                 chartGasCO2.option.series[0].data[0].value = (gas.perCo2 == null ? 0
//                     : gas.perCo2);
//                 chartGasCO2.chart.setOption(chartGasCO2.option, true);
//                 chartGasPH3.option.series[0].data[0].value = (gas.perPh3 == null ? 0
//                     : gas.perPh3);
//                 chartGasPH3.chart.setOption(chartGasPH3.option, true);
//                 chartGasO2.option.series[0].data[0].value = (gas.perO2 == null ? 0
//                     : gas.perO2);
//                 chartGasO2.chart.setOption(chartGasO2.option, true);
//                 count++;
//             }
//             if (gasIndex == (listDepot.length - 1)) {
//                 gasIndex = 0;
//                 reloadChartGas();
//             }
//             if (count == 1) {
//                 gasIndex++;
//                 break;
//             }
//         }
//     } else {
//         $("#gasDepotName").text("仓库");
//         $("#gasCheckTime").text("检测时间: 00-00");
//         chartGasCO2.option.series[0].data[0].value = 0;
//         chartGasCO2.chart.setOption(chartGasCO2.option, true);
//         chartGasPH3.option.series[0].data[0].value = 0;
//         chartGasPH3.chart.setOption(chartGasPH3.option, true);
//         chartGasO2.option.series[0].data[0].value = 0;
//         chartGasO2.chart.setOption(chartGasO2.option, true);
//         console.log("气体数据为空,显示默认数据")
//     }
//     bizCharts.chartGasCO2 = chartGasCO2;
//     bizCharts.chartGasPH3 = chartGasPH3;
//     bizCharts.chartGasO2 = chartGasO2;
// }
 
//从缓存中获取当前仓库
function gtDepotById(depotId) {
    $.each(listDepot, function (i, item) {
        if (item.id == depotId) return item;
    });
}
 
/**
 * 仓储统计
 */
function reloadChartdepot() {
    if (listDepot == null || listDepot.length <= 0) {
        return;
    }
    var foodTypeMap = new Map();
    var foodType = null;
    var foodVarietyMap = new Map();
    var foodVariety = null;
    var foodLevelMap = new Map();
    var foodLevel = null;
    var depot = null;
    var value = 0.0;
    for (var i = 1; i <= listDepot.length; i++) {
        depot = listDepot[i - 1];
        value = 0.0;
        // 粮食性质
        foodType = depot.foodType;
        if (foodType) {
            if (foodTypeMap.has(foodType)) {
                value = foodTypeMap.get(foodType).value + depot.storageReal;
            } else {
                value = depot.storageReal;
            }
            foodTypeMap.set(foodType, {
                "name": depot.foodTypeName,
                "value": value
            });
        }
 
        // 粮食等级
        foodLevel = depot.foodLevel;
        if (foodLevel) {
            if (foodLevelMap.has(foodLevel)) {
                value = foodLevelMap.get(foodLevel).value + depot.storageReal;
            } else {
                value = depot.storageReal;
            }
            foodLevelMap.set(foodLevel, {
                "name": depot.foodLevelName,
                "value": value
            });
        }
 
        // 粮食品种
        foodVariety = depot.foodVariety;
        if (foodVariety) {
            if (foodVarietyMap.has(foodVariety)) {
                value = foodVarietyMap.get(foodVariety).value
                    + depot.storageReal;
            } else {
                value = depot.storageReal;
            }
            foodVarietyMap.set(foodVariety, {
                "name": depot.foodVarietyName,
                "value": value
            });
        }
    }
    var chartFoodTypeData = new Array();
    var chartFoodVarietyData = new Array();
    var chartFoodLevelData = new Array();
    foodVarietyMap.forEach(function (value, key) {
        chartFoodVarietyData.push(value);
    });
    foodTypeMap.forEach(function (value, key) {
        chartFoodTypeData.push(value);
    });
    foodLevelMap.forEach(function (value, key) {
        chartFoodLevelData.push(value);
    });
    var chartFoodLevel = bizCharts.chartFoodLevel;
    var chartFoodVariety = bizCharts.chartFoodVariety;
    var chartFoodType = bizCharts.chartFoodType;
    chartFoodLevel.option.series[0].data = chartFoodLevelData;
    chartFoodLevel.chart.setOption(chartFoodLevel.option, true);
 
    chartFoodType.option.series[0].data = chartFoodTypeData;
    chartFoodType.chart.setOption(chartFoodType.option, true);
    chartFoodVariety.option.series[0].data = chartFoodVarietyData;
    chartFoodVariety.chart.setOption(chartFoodVariety.option, true);
    bizCharts.chartFoodLevel = chartFoodLevel;
    bizCharts.chartFoodType = chartFoodType;
    bizCharts.chartFoodVariety = chartFoodVariety;
}
 
// 退出全屏
function exitFullscreen() {
    var de = document;
    if (de.exitFullscreen) {
        de.exitFullscreen();
    } else if (de.mozCancelFullScreen) {
        de.mozCancelFullScreen();
    } else if (de.webkitCancelFullScreen) {
        de.webkitCancelFullScreen();
    }
    screen = true;
}
 
// 进入全屏
function requestFullScreen() {
    var de = document.documentElement;
    if (de.requestFullscreen) {
        de.requestFullscreen();
    } else if (de.mozRequestFullScreen) {
        de.mozRequestFullScreen();
    } else if (de.webkitRequestFullScreen) {
        de.webkitRequestFullScreen();
    }
    screen = false;
}