<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>统计</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
    <link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
    <link href="../static/css/main/animate.min.css" th:href="@{/css/main/animate.min.css}" rel="stylesheet"/>
    <link href="../static/css/main/style.min862f.css" th:href="@{/css/main/style.min862f.css}" rel="stylesheet"/>

    <!-- bootstrap-table 表格插件样式 -->
    <!--    <link th:href="@{/ajax/libs/bootstrap-table/bootstrap-table.min.css?v=20210202}" rel="stylesheet"/>-->
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content">

    <div class="row">
        <div class="col-sm-4">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <span class="label label-success pull-right">周</span>
                    <div class="stat-percent text-success pull-right">[[*{startDate}]]到&nbsp;[[*{endDate}]]</div>
                    <h5>人员</h5>
                </div>
                <div class="ibox-content">
                    <div class="col-sm-4">
                        <h1 class="no-margins">[[${lastWeekSum.userCount}]]</h1>
                        <small>总人数</small>
                    </div>
                    <div class="col-sm-4">
                        <h1 class="no-margins">[[${lastWeekSum.reportedCount}]]</h1>
                        <small>已填报</small>
                    </div>
                    <div>
                        <h1 class="no-margins"
                            th:classappend="${lastWeekSum.userCount-lastWeekSum.reportedCount > 0 ? 'text-danger' : ''}"
                            th:styleappend="'cursor:pointer;'"
                            onclick="showNotReportList()">
                            <!--                            <a href="javascript:void(0)"-->
                            <!--                               onclick="showNotReportList();">-->
                            [[${lastWeekSum.userCount-lastWeekSum.reportedCount}]]
                            <!--                            </a>-->
                        </h1>
                        <small>待填报</small>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-4">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <span class="label label-success pull-right">周</span>
                    <div class="stat-percent text-success pull-right">[[*{startDate}]]到&nbsp;[[*{endDate}]]</div>
                    <h5>工时</h5>
                </div>
                <div class="ibox-content">
                    <div class="col-sm-6">
                        <h1 class="no-margins">[[${lastWeekSum.costAmount}]]</h1>
                        <small>总工时（h）</small>
                    </div>
                    <div>
                        <h1 class="no-margins"
                            th:classappend="${lastWeekSum.costAmount -lastWeekSum.twoWeeksAgoAmount > 0 ? 'text-danger' :
                            lastWeekSum.costAmount - lastWeekSum.twoWeeksAgoAmount == 0 ? 'text-success' : 'text-navy'}">
                            [[${lastWeekSum.costAmount - lastWeekSum.twoWeeksAgoAmount}]]
                            <i th:if="${lastWeekSum.costAmount - lastWeekSum.twoWeeksAgoAmount > 0}"
                               class="fa fa-long-arrow-up"></i>
                            <i th:if="${lastWeekSum.costAmount - lastWeekSum.twoWeeksAgoAmount == 0}" class="fa">-</i>
                            <i th:if="${lastWeekSum.costAmount - lastWeekSum.twoWeeksAgoAmount < 0}"
                               class="fa fa-long-arrow-down"></i>
                        </h1>
                        <small>比上周（h）</small>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-4">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <span class="label label-warning pull-right">总</span>
                    <h5>项目</h5>
                </div>
                <div class="ibox-content">
                    <div class="col-sm-3">
                        <h1 class="no-margins">[[${projectCount}]]</h1>
                        <small>总项目数</small>
                    </div>
                    <div th:each="dict,ls : ${indexProjectSum}"
                         th:classappend="${ls.last ? '':'col-sm-3'}">
                        <h1 class="no-margins" th:classappend="${dict.name.equals('正常') ? 'text-danger':''}">
                            [[${dict.count}]]</h1>
                        <small>[[${dict.name}]]</small>
                    </div>

                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-6">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <span class="label label-success pull-right">周</span>
                    <div class="stat-percent text-success pull-right">[[*{startDate}]]到&nbsp;[[*{endDate}]]</div>
                    <h5>项目工时排行</h5>
                </div>
                <div class="ibox-content">
                    <table class="table table-hover no-margins">
                        <thead>
                        <tr>
                            <th>项目名称</th>
                            <th>工时（h）</th>
                            <th>较上周（h）</th>
                        </tr>
                        </thead>
                        <tr th:each="sum,ls:${lastWeekProjectSum}">
                            <td>
                                [[${ls.index + 1}]].&nbsp&nbsp[[${sum.projectName}]]
                            </td>
                            <td>
                                [[${sum.costAmount}]]
                            </td>
                            <td>
                                [[${sum.costAmount - sum.twoWeeksAgoAmount}]]
                                <i th:if="${sum.costAmount - sum.twoWeeksAgoAmount > 0}"
                                   class="fa fa-long-arrow-up text-danger"></i>
                                <i th:if="${sum.costAmount - sum.twoWeeksAgoAmount == 0}" class="fa text-success">-</i>
                                <i th:if="${sum.costAmount - sum.twoWeeksAgoAmount < 0}"
                                   class="fa fa-long-arrow-down text-navy"></i>
                            </td>
                        </tr>
                        <tfoot>
                        <tr>
                            <th colspan="3" style="text-align: right">
                                <a class="btn btn-xs  btn-success" href="javascript:void(0)"
                                   onclick="showLastWeekDetail();">更多</a>
                            </th>
                        </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <span class="label label-warning pull-right">总</span>
                        <h5>项目工时排行</h5>
                    </div>
                    <div class="ibox-content">
                        <table class="table table-hover no-margins">
                            <thead>
                            <tr>
                                <th>项目名称</th>
                                <th>工时（h）</th>
                            </tr>
                            </thead>
                            <tr th:each="sum,ls:${projectSummary}">
                                <td>
                                    [[${ls.index + 1}]].&nbsp&nbsp[[${sum.projectName}]]
                                </td>
                                <td>
                                    [[${sum.costAmount}]]
                                </td>
                            </tr>
                            <tfoot>
                            <tr>
                                <th colspan="3" style="text-align: right">
                                    <a class="btn btn-xs  btn-success" href="javascript:void(0)"
                                       onclick="showProjectDetail();">更多</a>
                                </th>
                            </tr>
                            </tfoot>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<script th:src="@{/ajax/libs/flot/jquery.flot.js}"></script>
<!-- 遮罩层 -->
<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
<script th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script th:src="@{/ajax/libs/layui/layui.js}"></script>
<script th:src="@{/ruoyi/js/common.js?v=4.6.0}"></script>
<script th:src="@{/ruoyi/js/ry-ui.js?v=4.6.0}"></script>

<th:block th:include="include :: sparkline-js"/>
<script type="text/javascript">
    function showLastWeekDetail() {
        $.operate.currentOpenUrl('report/projectLastWeekSummary', '项目工时排行（周）');
    };

    function showProjectDetail() {
        $.operate.currentOpenUrl('report/projectSummary', '项目工时排行（总）');
    };

    function showNotReportList() {
        $.operate.currentOpenUrl('report/notReportUserList', '未填报人员');
    }
</script>
</body>
</html>
