<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('评估师工作台')" />
    <style type="text/css">
        .workbench-stat .ibox-content { min-height: 132px; }
        .workbench-stat h1 { font-size: 34px; margin: 8px 0 4px; }
        .quick-entry .btn { margin-right: 10px; margin-bottom: 10px; }
        .mini-table { margin-bottom: 0; }
        .mini-table > thead > tr > th,
        .mini-table > tbody > tr > td { padding: 10px 8px; vertical-align: middle; }
    </style>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row workbench-stat">
        <div class="col-sm-3">
            <div class="ibox">
                <div class="ibox-title">
                    <span class="label label-primary pull-right">项目</span>
                    <h5>在途项目</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins" th:text="${summary.activeProjects}">0</h1>
                    <div class="stat-percent font-bold text-primary">总计 <span th:text="${summary.totalProjects}">0</span></div>
                    <small>当前处于立项、评估、复核阶段的项目</small>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="ibox">
                <div class="ibox-title">
                    <span class="label label-warning pull-right">报告</span>
                    <h5>待处理报告</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins" th:text="${summary.pendingReports}">0</h1>
                    <div class="stat-percent font-bold text-warning">草稿/审核中</div>
                    <small>需要推进审核或发布的报告数量</small>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="ibox">
                <div class="ibox-title">
                    <span class="label label-info pull-right">资料</span>
                    <h5>待收集资料</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins" th:text="${summary.pendingMaterials}">0</h1>
                    <div class="stat-percent font-bold text-info">跟进中</div>
                    <small>待收集或待补充的项目资料数量</small>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="ibox">
                <div class="ibox-title">
                    <span class="label label-success pull-right">模板</span>
                    <h5>已发布模板</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins" th:text="${summary.publishedTemplates}">0</h1>
                    <div class="stat-percent font-bold text-success">可直接复用</div>
                    <small>当前已可供项目复用的模板资产</small>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-sm-12">
            <div class="ibox quick-entry">
                <div class="ibox-title">
                    <h5>快捷入口</h5>
                </div>
                <div class="ibox-content">
                    <a class="btn btn-outline btn-primary" th:href="@{/risk/project}"><i class="fa fa-folder-open"></i> 项目台账</a>
                    <a class="btn btn-outline btn-warning" th:href="@{/risk/report}"><i class="fa fa-file-text-o"></i> 报告管理</a>
                    <a class="btn btn-outline btn-info" th:href="@{/risk/material}"><i class="fa fa-archive"></i> 资料管理</a>
                    <a class="btn btn-outline btn-success" th:href="@{/risk/template}"><i class="fa fa-clone"></i> 模板管理</a>
                    <a class="btn btn-outline btn-default" th:href="@{/risk/org}"><i class="fa fa-sitemap"></i> 组织机构</a>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-sm-4">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>临期项目</h5>
                </div>
                <div class="ibox-content">
                    <table class="table table-hover mini-table">
                        <thead>
                        <tr>
                            <th>项目</th>
                            <th>评估师</th>
                            <th>截止日期</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="item : ${dueProjects}">
                            <td th:text="${item.projectName}">项目名称</td>
                            <td th:text="${item.assessor}">评估师</td>
                            <td th:text="${item.dueDate != null ? #dates.format(item.dueDate, 'yyyy-MM-dd') : '-'}">2026-04-14</td>
                        </tr>
                        <tr th:if="${#lists.isEmpty(dueProjects)}">
                            <td colspan="3" class="text-center text-muted">暂无临期项目</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <div class="col-sm-4">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>待审核报告</h5>
                </div>
                <div class="ibox-content">
                    <table class="table table-hover mini-table">
                        <thead>
                        <tr>
                            <th>报告</th>
                            <th>项目</th>
                            <th>状态</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="item : ${pendingReports}">
                            <td th:text="${item.reportName}">报告名称</td>
                            <td th:text="${item.projectName}">所属项目</td>
                            <td th:text="${item.reportStatus == '0' ? '草稿' : (item.reportStatus == '1' ? '审核中' : (item.reportStatus == '2' ? '已发布' : '已归档'))}">审核中</td>
                        </tr>
                        <tr th:if="${#lists.isEmpty(pendingReports)}">
                            <td colspan="3" class="text-center text-muted">暂无待审核报告</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <div class="col-sm-4">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>资料跟进清单</h5>
                </div>
                <div class="ibox-content">
                    <table class="table table-hover mini-table">
                        <thead>
                        <tr>
                            <th>资料</th>
                            <th>项目</th>
                            <th>负责人</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="item : ${pendingMaterials}">
                            <td th:text="${item.materialName}">资料名称</td>
                            <td th:text="${item.projectName}">所属项目</td>
                            <td th:text="${item.ownerName}">负责人</td>
                        </tr>
                        <tr th:if="${#lists.isEmpty(pendingMaterials)}">
                            <td colspan="3" class="text-center text-muted">暂无待跟进资料</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
</body>
</html>
