<div class="panel-content">
    <div class="panel-title fluid">
        <div class="title-main d-flex justify-content-between">
            <div>
                <div class="d-inline-flex">
                    <ul class="nav nav-pills m-0">
                        <li class="nav-item">
                            <a class="nav-link <% if(status === undefined) { %>active<% } %>" href="/lib">全部</a>
                        </li>
                        <li class="nav-item">
                            <% if(parseInt(status) === libConst.status.pend) { %>
                            <a class="nav-link active" href="/lib?status=<%= libConst.status.pend %>"><%= libConst.statusString[libConst.status.pend] %> <span class="badge badge-light"><%= libStatus.pend %></span></a>
                            <% } else { %>
                            <a class="nav-link" href="/lib?status=<%= libConst.status.pend %>"><%= libConst.statusString[libConst.status.pend] %> <span class="badge badge-secondary"><%= libStatus.pend %></span></a>
                            <% } %>
                        </li>
                        <li class="nav-item">
                            <% if(parseInt(status) === libConst.status.enter) { %>
                            <a class="nav-link active" href="/lib?status=<%= libConst.status.enter %>"><%= libConst.statusString[libConst.status.enter] %> <span class="badge badge-light"><%= libStatus.enter %></span></a>
                            <% } else { %>
                            <a class="nav-link" href="/lib?status=<%= libConst.status.enter %>"><%= libConst.statusString[libConst.status.enter] %> <span class="badge badge-secondary"><%= libStatus.enter %></span></a>
                            <% } %>
                        </li>
                    </ul>
                </div>
            </div>
            <div>
                <a href="#upload" data-toggle="modal" data-target="#upload" class="btn btn-primary btn-sm pull-right">导入造价文件</a>
                <a href="#refresh" data-toggle="modal" data-target="#refresh" class="btn btn-info btn-sm pull-right"
                   id="refresh-btn" <% if (ctx.app.awaitRefresh && ctx.app.awaitRefresh.length > 0) { %>style="display: none"<% } %>>刷新指标数据</a>
                <div class="pull-right text-warning" id="refresh-hint" <% if (!ctx.app.awaitRefresh || ctx.app.awaitRefresh.length === 0) { %>style="display: none"<% } %>>
                    正在刷新全部造价文件，未刷新完成的造价文件，暂时无法查看(待刷新：<%- ctx.app.awaitRefresh ? ctx.app.awaitRefresh.length : 0 %>)
                </div>
            </div>
        </div>
    </div>
    <div class="content-wrap">
        <div class="c-header p-0 col-12"></div>
        <div class="c-body">
            <div class="sjs-height-1">
                <table class="table table-bordered">
                    <tr>
                        <th class="">造价文件名称</th>
                        <th class="">导入时间</th>
                        <th class=""></th>
                    </tr>
                    <% if(libList.length > 0) { %>
                    <% libList.forEach(function(lib) { %>
                    <tr <% if (lib.is_refresh) { %>class="table-active"<% } %> lib_id="<%- lib.id %>">
                        <td>
                            <a href="/lib/global/<%= lib.id %>"><%= lib.filename %></a>
                            <% if (lib.is_refresh && ctx.app.awaitRefresh.indexOf(lib.id) < 0) { %>
                            <a href="/lib/refresh?id=<%- lib.id %>" class="fa fa-refresh text-primary" title="再次刷新"></a>
                            <% } %>
                        </td>
                        <td><%= lib.create_time > 0 ? moment(lib.create_time * 1000).format('YYYY-MM-DD HH:mm:ss') : '-' %> </td>
                        <td><% if(lib.status === 1) { %><a href="/lib/global/<%= lib.id %>" class="btn btn-sm btn-outline-primary">填写参数</a> <% } else { %><%= lib.enter_time > 0 ? moment(lib.enter_time * 1000).format('YYYY-MM-DD HH:mm:ss') : '-' %> 入库<% } %></td>
                    </tr>
                    <% }) %>
                    <% } %>
                </table>
            </div>
        </div>
    </div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js"></script>
<script src="/public/js/lib_socket.js"></script>