<!DOCTYPE html>
<html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">

<head>
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <meta charset="utf-8">
    <title></title>
    <!-- <link rel="stylesheet" type="text/css" media="screen"
        href="css/login.css"> -->
    <style type="text/css">
        table {
            max-width: 100%;
            margin-bottom: 18px;
            background-color: transparent;
            border-collapse: collapse;
            border-spacing: 0;
            display: table;
        }

        .table-bordered, .table-bordered>tbody>tr>td, .table-bordered>tbody>tr>th,
        .table-bordered>tfoot>tr>td, .table-bordered>tfoot>tr>th,
        .table-bordered>thead>tr>td, .table-bordered>thead>tr>th {
            border: 1px solid #ddd;
        }

        tbody {
            display: table-row-group;
            vertical-align: middle;
            border-color: inherit;
        }

        .table-striped>tbody>tr:nth-of-type(odd) {
            background-color: #f9f9f9;
        }

        tr {
            display: table-row;
            vertical-align: inherit;
            border-color: inherit;
        }

        .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th,
        .table>thead>tr>td, .table>thead>tr>th {
            padding: 8px 10px;
        }

        table.table-bordered tbody td, table.table-bordered tbody th {
            border-left-width: 0;
            border-bottom-width: 0;
        }

        .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th,
        .table>thead>tr>td, .table>thead>tr>th {
            line-height: 1.42857143;
            vertical-align: top;
        }

        td {
            display: table-cell;
        }
    </style>
</head>
<body>
<div class="modal-content" style="width: 85%; margin: 0 auto;">
    <div id="print" style="width: 100%; margin: 0 auto">
        <div style="width: 100%;">
				<span
                        style="font-size: 25px; display: block; width: 100%; float: left; text-align: center"
                        onclick="printCon()" class="ng-binding">中央储备粮新港直属库有限公司</span>
        </div>
        <hr style="height: 3px; border: none; border-top: 3px double #000;">
        <div style="width: 100%; margin-top: -25px;">
				<span
                        style="font-style: italic; display: block; text-align: center;; float: left; padding-top: 5px"
                        class="ng-binding">高大平房仓  25号仓粮情检测报告单</span>
            <button onclick="daochu()">导出信息</button>
            <span
                style="font-style: italic; display: block; text-align: center; float: right; padding-top: 5px"
                class="ng-binding" th:text="检测时间：+${#dates.format(report.detectionDate,'yyyy-MM-dd HH:mm:ss')}"></span>
        </div>
        <table class="table table-striped table-bordered table-hover"
               border="1" style="width: 100%; margin-top: 10px;">


            <tbody>
            <tr>
                <td style="text-align: center">仓房类型：</td>
                <td style="text-align: center" class="ng-binding">YC</td>
                <td style="text-align: center">设计仓容(t)：</td>
                <td style="text-align: center" class="ng-binding">8700</td>
                <td style="text-align: center">入库时间：</td>
                <td style="text-align: center" class="ng-binding">2019</td>
            </tr>
            <tr>
                <td style="text-align: center">粮食品种：</td>
                <td style="text-align: center" class="ng-binding">大豆</td>
                <td style="text-align: center">粮食性质：</td>
                <td style="text-align: center" class="ng-binding">一次性存储</td>
                <td style="text-align: center">粮食等级：</td>
                <td style="text-align: center" class="ng-binding">3级</td>
            </tr>
            <tr>
                <td style="text-align: center">实际储量(kg)：</td>
                <td style="text-align: center" class="ng-binding">8387680</td>
                <td style="text-align: center">收获年度：</td>
                <td style="text-align: center" class="ng-binding">2020</td>
                <td style="text-align: center">保管员：</td>
                <td style="text-align: center" class="ng-binding">王星</td>
            </tr>
            </tbody>
        </table>

        <table id="table_5" border="1" style="width: 100%; margin-top: 10px;">
            <tbody>
            <tr>
                <td style="border: 1px solid #000; text-align: center;">温\层</td>
                <td style="border: 1px solid #000; text-align: center;">整仓</td>
                <td style="border: 1px solid #000; text-align: center;">1层</td>
                <td style="border: 1px solid #000; text-align: center;">2层</td>
                <td style="border: 1px solid #000; text-align: center;">3层</td>
            </tr>
            <tr>
                <td style="border: 1px solid #000; text-align: center;">平均温度</td>
                <td style="border: 1px solid #000; text-align: center;"
                    class="ng-binding" th:text="${report.statisticsVO.avgTemperature}"></td>
                <td style="border: 1px solid #000; text-align: center;" th:text="${report.statisticsVO.avgTemperature1}"></td>
                <td style="border: 1px solid #000; text-align: center;" th:text="${report.statisticsVO.avgTemperature2}"></td>
                <td style="border: 1px solid #000; text-align: center;" th:text="${report.statisticsVO.avgTemperature3}"></td>

            </tr>
            <tr>
                <td style="border: 1px solid #000; text-align: center;">最高温度</td>
                <td style="border: 1px solid #000; text-align: center;">

                    <div ng-if="max < warningValueList[vCfCode].high"
                         class="ng-scope" style="">
                        <span class="ng-binding" th:text="${report.statisticsVO.maxTemperature}"></span>
                    </div>
                    <!-- end ngIf: max < warningValueList[vCfCode].high --> <!-- ngIf: warningValueList[vCfCode].high == null -->
                    <!--高温预警-->
                </td>
                <td style="border: 1px solid #000; text-align: center;" th:text="${report.statisticsVO.maxTemperature1}"></td>
                <td style="border: 1px solid #000; text-align: center;" th:text="${report.statisticsVO.maxTemperature2}"></td>
                <td style="border: 1px solid #000; text-align: center;" th:text="${report.statisticsVO.maxTemperature3}"></td>

            </tr>
            <tr>
                <td style="border: 1px solid #000; text-align: center;">最低温度</td>
                <td style="border: 1px solid #000; text-align: center;">
                    <!--低温报警--> <!-- ngIf: min <= warningValueList[vCfCode].low -->
                    <div ng-if="min <= warningValueList[vCfCode].low"
                         class="ng-scope" style="">
                        <span  class="ng-binding" th:text="${report.statisticsVO.minTemperature}"></span>
                    </div>
                    <!-- end ngIf: min <= warningValueList[vCfCode].low --> <!-- ngIf: min > warningValueList[vCfCode].low -->
                    <!-- ngIf: warningValueList[vCfCode].low == null --> <!--低温预警-->
                </td>
                <td style="border: 1px solid #000; text-align: center;"><span th:text="${report.statisticsVO.minTemperature1}"></span></td>
                <td style="border: 1px solid #000; text-align: center;" ><span th:text="${report.statisticsVO.minTemperature2}"></span></td>
                <td style="border: 1px solid #000; text-align: center;"><span th:text="${report.statisticsVO.minTemperature3}"></span></td>

                <!-- <td style="border: 1px solid #000; text-align: center;"><acronym
                    title="粮温低限报警为: 10℃"><span style="color: red;" th:text="${report.statisticsVO.minTemperature3}">0</span></acronym></td> -->

            </tr>
            <tr>
                <td style="border: 1px solid #000; text-align: center;">平均水分</td>
                <td style="border: 1px solid #000; text-align: center;"
                    class="ng-binding" th:text="${report.statisticsVO.avgHumidity}"></td>
                <td style="border: 1px solid #000; text-align: center;" th:text="${report.statisticsVO.avgHumidity1}"></td>
                <td style="border: 1px solid #000; text-align: center;" th:text="${report.statisticsVO.avgHumidity2}"></td>
                <td style="border: 1px solid #000; text-align: center;" th:text="${report.statisticsVO.avgHumidity3}"></td>

            </tr>
            <tr>
                <td style="border: 1px solid #000; text-align: center;">最高水分</td>
                <td style="border: 1px solid #000; text-align: center;"
                    class="ng-binding" th:text="${report.statisticsVO.maxHumidity}"></td>
                <td style="border: 1px solid #000; text-align: center;" th:text="${report.statisticsVO.maxHumidity1}"></td>
                <td style="border: 1px solid #000; text-align: center;" th:text="${report.statisticsVO.maxHumidity2}"></td>
                <td style="border: 1px solid #000; text-align: center;" th:text="${report.statisticsVO.maxHumidity3}"></td>

            </tr>
            <tr>
                <td style="border: 1px solid #000; text-align: center;">最低水分</td>
                <td style="border: 1px solid #000; text-align: center;"
                    class="ng-binding" th:text="${report.statisticsVO.minHumidity}"></td>
                <td style="border: 1px solid #000; text-align: center;" th:text="${report.statisticsVO.minHumidity1}"></td>
                <td style="border: 1px solid #000; text-align: center;" th:text="${report.statisticsVO.minHumidity2}"></td>
                <td style="border: 1px solid #000; text-align: center;" th:text="${report.statisticsVO.minHumidity3}"></td>

            </tr>
            </tbody>
        </table>

        <table id="table_6" border="1" style="width: 100%; margin-top: 10px;">
            <thead style="width: 100%; border: 1px solid #000">

            <tr id="report_title">
                <th style="border: 1px solid #000; text-align: center;">电缆号</th>
                <th style="border: 1px solid #000; text-align: center;">层数</th>
                <th style="border: 1px solid #000; text-align: center;">第1组</th>
                <th style="border: 1px solid #000; text-align: center;">第2组</th>
                <th style="border: 1px solid #000; text-align: center;">第3组</th>
                <!-- <th style="border: 1px solid #000; text-align: center;">第4组</th>
                <th style="border: 1px solid #000; text-align: center;">第5组</th>
                <th style="border: 1px solid #000; text-align: center;">第6组</th>
                <th style="border: 1px solid #000; text-align: center;">第7组</th> -->
            </tr>
            </thead>
            <tbody  id="curTbodyCon">

            </tbody>
        </table>
        <div style="width: 100%; margin-top: -10px;">
				<span
                        style="font-style: italic; display: block; text-align: center; color: red; float: left; padding-top: 20px">注:
					温度单位:(℃)</span> <span
                style="font-style: italic; display: block; text-align: center; color: red; float: left; padding-top: 20px">;
					湿度单位:(%RH)</span> <span style="color: red; float: left; padding-top: 20px">;
					标红数值表示不在合理范围或设备异常.</span> <span
                style="font-style: italic; display: block; text-align: center; float: right; padding-top: 20px"
                class="ng-binding">制表时间:2019-09-11 09:33:45</span>
        </div>
        <table class="table table-striped table-bordered table-hover">

        </table>
    </div>
</div>
</body>
</html>
<script type="text/javascript">
    function printCon() {
        window.print();
    }
</script>

<script th:inline="javascript">


    function GetQueryString(name)
    {
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);//search,查询？后面的参数，并匹配正则
          if(r!=null)return  unescape(r[2]); return null;
    }

    function daochu() {
        var historyid = GetQueryString("historyId");
        window.location.href = '/detection/water/impots/911202236794497949001001/'+historyid;
        //window.location.href = '/detection/water/impots/9112022367944979490871/'+historyid;
    }


    var curTbodyCon = document.getElementById('curTbodyCon');

    var content ='';

    var reports = [[${reportDatas}]];
    console.log(reports);
    reports.forEach(function(item){
        console.log(item);
        var waterDatas = item.datas;

        content += '<tr>'+
            '<td rowspan="2" style="border: 1px solid #000; text-align: center;">第'+item.cableName+'缆</td>'+
            '<td style="border: 1px solid #000; text-align: center;">温度</td>'+
            '<td style="border: 1px solid #000; text-align: center;">'+waterDatas[0].temperature+'</td>'+
            '<td style="border: 1px solid #000; text-align: center;">'+waterDatas[1].temperature+'</td>'+
            '<td style="border: 1px solid #000; text-align: center;">'+waterDatas[2].temperature+'</td>'+
            '</tr>'+
            '<tr>'+
            '<td style="border: 1px solid #000; text-align: center;">水分</td>'+
            '<td style="border: 1px solid #000; text-align: center;">'+waterDatas[0].humidity+'</td>'+
            '<td style="border: 1px solid #000; text-align: center;">'+waterDatas[1].humidity+'</td>'+
            '<td style="border: 1px solid #000; text-align: center;">'+waterDatas[2].humidity+'</td>'+
            '</tr>';


    })

    curTbodyCon.innerHTML = content;

</script>
