<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sptg="http://www.thymeleaf.org">
    <head>
        <script th:replace="common/head"></script>
        <!-- 省市区样式 -->
        <link rel="stylesheet" th:href="@{'/layui/lay/mymodules/region.css'}">

        <style>
            .xm-toolbar .toolbar-tag {
                width: 100%;
                display: flex;
                justify-content: center;
                background-color: #1E9FFF!important;
                color: #fff!important;
            }
        </style>
    </head>
    <body style="position: absolute;top:0;bottom: 0;left:0;right: 0;">
        <input type="hidden" id="org_id" th:value="${onLineUser.orgId}" />
        <div class="layui-fluid">
            <!-- 下拉树 -->
            <div th:replace="common/org-tree"></div>
            <div class="x-body per-table">
                <div class="layui-card">
                    <div class="layui-form layui-card-header layuiadmin-card-header-auto" style="padding:0;">
                        <div class="layui-form-item border-b">
                            <div class="layui-inline">
                                <label class="layui-form-label">所属小区</label>
                                <div class="layui-input-block">
                                    <div id="residential_name"></div>
                                    <input id="residential_id" type="hidden" />
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">所属单元</label>
                                <div class="layui-input-block">
                                    <div id="unit_name"></div>
                                    <input id="unit_id" type="hidden" />
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">所属房间</label>
                                <div class="layui-input-block">
                                    <div id="room_name"></div>
                                    <input id="room_id" type="hidden" />
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">姓名</label>
                                <div class="layui-input-block">
                                    <input type="text" name="name" placeholder="请输入" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">联系方式</label>
                                <div class="layui-input-block">
                                    <input type="text" name="tel" placeholder="请输入" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">身份证</label>
                                <div class="layui-input-block">
                                    <input type="text" name="idCard" placeholder="请输入" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">人脸有效期</label>
                                <div class="layui-input-block">
                                    <input type="text"  class="layui-input date-icon" id="face_date"  placeholder="请选择" autocomplete="off">
                                    <input type="hidden" id="face_begin_date"  name="faceBeginDate"/>
                                    <input type="hidden" id="face_end_date"  name="faceEndDate" />
                                </div>
                            </div>
                            <!--<div class="layui-inline">
                                <label class="layui-form-label">卡号</label>
                                <div class="layui-input-block">
                                    <input type="text" name="cardNo" placeholder="请输入" autocomplete="off" class="layui-input">
                                </div>
                            </div>-->
                            <!--<div class="layui-inline">
                                <label class="layui-form-label">卡片有效期</label>
                                <div class="layui-input-block">
                                    <input type="text"  class="layui-input date-icon" id="card_date"  placeholder="请选择" autocomplete="off">
                                    <input type="hidden" id="card_begin_date"  name="faceBeginDate"/>
                                    <input type="hidden" id="card_end_date"  name="faceEndDate" />
                                </div>
                            </div>-->
                            <!--<div class="layui-inline">
                                <label class="layui-form-label" style="font-size: 13px">人脸审核状态</label>
                                <div class="layui-input-block">
                                    <select id="check_state" name="checkState" >
                                        <option value="">全部</option>
                                        <option value="0">待审核</option>
                                        <option value="1">审核通过</option>
                                        <option value="2">审核未通过</option>
                                        <option value="3">待上传</option>
                                    </select>
                                </div>
                            </div>-->
                            <div class="layui-inline">
                                <label class="layui-form-label" style="font-size: 13px">人脸状态</label>
                                <div class="layui-input-block">
                                    <select id="face_enable" name="faceEnable" >
                                        <option value="">全部</option>
                                        <option value="0">待审核</option>
                                        <option value="1">审核通过</option>
                                        <option value="2">审核未通过</option>
                                        <option value="-1">待上传</option>
                                        <option value="11">人脸不合格</option>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-inline" style="margin-left: 38px;">
                                <button class="layui-btn layuiadmin-btn-useradmin"  lay-submit lay-filter="query">查询</button>
                                <button class="layui-btn  layui-btn-primary"  lay-submit lay-filter="reset">重置</button>
                            </div>
                        </div>

                        <!-- 表格+头部按钮 -->
                        <div class="layui-card-body" id="layPhotosTbImg"  style="padding:0;">
                            <div style="padding-bottom: 10px;">
<!--                                <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="import" sptg:security="estate:access:import">记名门禁卡导入</button>-->
                                <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="faceIssueBatch" sptg:security="estate:access:fase:issue:batch">批量下发人脸</button>
<!--                                <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="cardEnableBatch" sptg:security="estate:access:card:enable:batch">批量启用门禁卡</button>-->
                                <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="export" sptg:security="estate:access:export">导出</button>
                                <button class="layui-btn layui-bg-black" lay-submit lay-filter="faceDeleteBatch" sptg:security="estate:access:fase:delete:batch">批量禁用人脸</button>
<!--                                <button class="layui-btn layui-bg-black" lay-submit lay-filter="cardDeleteBatch" sptg:security="estate:access:card:delete:batch">批量禁用门禁卡</button>-->
                            </div>
                            <table id="table_id" lay-filter="table_event"></table>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <script type="text/html" id="table-useradmin-webuser">
            <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="faceImageSet" sptg:security="estate:access:faceImageSet">人脸设置</a>
<!--            <a class="layui-btn layui-bg-green layui-btn-xs" lay-event="cardSet" sptg:security="estate:access:cardSet">卡设置</a>-->
            <a class="layui-btn layui-btn-xs layui-bg-black" data-dropdown="#dropUser{{d.LAY_INDEX}}" lay-event="more" no-shade="true">
                更多<i class="layui-icon layui-icon-drop" style="font-size: 12px;margin-right: 0;"></i></a>
            <!-- 下拉菜单 -->
            <ul class="dropdown-menu-nav dropdown-bottom-right layui-hide" id="dropUser{{d.LAY_INDEX}}">
                <div class="dropdown-anchor"></div>
                <li><a  lay-event="showUserId" sptg:security="estate:access:showUserId">查看用户id</a></li>
                {{#  if(d.hasFace != null && d.hasFace){ }}
                <li><a  lay-event="log4face" sptg:security="estate:access:faceLog">人脸日志</a></li>
                {{# } }}
<!--                <li><a  lay-event="log4card" sptg:security="estate:access:cardLog">卡日志</a></li>-->
                <!--{{#  if(d.imageUri != null || d.accessCard != null){ }}-->
                    <!--<li><a  lay-event="specialSet" sptg:security="estate:access:specialPush">特殊门禁授权</a></li>-->
                <!--{{# } }}-->
                {{#  if(d.faceEnable != null && d.hasFace){ }}
                    {{#  if(d.faceEnable == 1){ }}
                        <li><a  lay-event="faceDisable" sptg:security="estate:access:faceImageSend">人脸禁用</a></li>
                    {{#  }else { }}
                        <li><a  lay-event="faceEnable" sptg:security="estate:access:faceImageSend">人脸启用</a></li>
                    {{# } }}
                {{# } }}
<!--                {{#  if(d.accessCard != null){ }}-->
<!--                    {{#  if(d.accessCard.cardEnable == 1){ }}-->
<!--                        <li><a  lay-event="cardDisable" sptg:security="estate:access:specialPush">门禁卡禁用</a></li>-->
<!--                    {{#  }else { }}-->
<!--                        <li><a  lay-event="cardEnable" sptg:security="estate:access:specialPush">门禁卡启用</a></li>-->
<!--                    {{# } }}-->
<!--                {{# } }}-->
                <!--<li><a  lay-event="faceEnable" sptg:security="estate:access:specialPush">人脸(启用/禁用)</a></li>-->
                <!--<li><a  lay-event="cardEnable" sptg:security="estate:access:specialPush">门禁卡(启用/禁用)</a></li>-->
                <!--&lt;!&ndash;<li><a  lay-event="accessDisable" sptg:security="estate:access:specialPush">门禁禁用</a></li>&ndash;&gt;-->
                <!--<li><a  lay-event="faceEnable" sptg:security="estate:access:specialPush">人脸(启用/禁用)</a></li>-->
                <!--<li><a  lay-event="cardEnable" sptg:security="estate:access:specialPush">门禁卡(启用/禁用)</a></li>-->
            </ul>
        </script>

        <!-- 住户类型 -->
        <script type="text/html" id="is_type">
            {{#  if(d.type == 0){ }}
            <span>业主</span>
            {{#  }else if(d.type == 1){ }}
            <span>成员</span>
            {{# }else { }}
            <span>租客</span>
            {{# } }}
        </script>

        <!-- 人脸审核状态 -->
        <script type="text/html" id="is_checkState">
            {{#  if(d.checkState == -1){ }}
            <span style="color: blue">未上传</span>
            {{#  }else if(d.checkState == 0){ }}
            <span style="color: blue">待审核</span>
            {{#  }else if(d.checkState == 1){ }}
            <span style="color: green">审核通过</span>
            {{# }else if(d.checkState == 2){ }}
            <span style="color: red">审核不通过</span>
            {{# } }}
        </script>
        <!-- 人脸启用状态 -->
        <script type="text/html" id="is_faceEnable">
            {{#  if(d.faceEnable == -1){ }}
                {{#  if(!d.hasFace){ }}
                    <span class="layui-badge layui-bg-orange">未上传</span>
                {{# } }}
                <!--{{#  if(!d.hasFaceCharge){ }}-->
                    <!--<span>无人脸套餐</span>-->
                <!--{{# } }}-->
            {{#  }else if(d.faceEnable == 0){ }}
            <span class="layui-badge layui-bg-black">未下发</span>
            {{#  }else if(d.faceEnable == 1){ }}
            <span class="layui-badge layui-bg-green">已下发</span>
            {{# }else if(d.faceEnable == 2){ }}
            <span class="layui-badge layui-bg-red">已禁用</span>
            {{# }else if(d.faceEnable == 11){ }}
            <span class="layui-badge layui-bg-red">人脸不合格</span>
            {{# } }}
        </script>
        <!-- 卡启用状态 -->
<!--        <script type="text/html" id="is_cardEnable">-->
<!--            {{#  if(d.accessCard.cardEnable == 0){ }}-->
<!--            <span style="color: blue">待启用</span>-->
<!--            {{#  }else if(d.accessCard.cardEnable == 1){ }}-->
<!--            <span style="color: green">已启用</span>-->
<!--            {{# }else { }}-->
<!--            <span style="color: red">已禁用</span>-->
<!--            {{# } }}-->
<!--        </script>-->

        <!-- 图片显示 -->
        <input type="hidden" id="fastDfsServer" th:value="${fastDfsServer}" />
        <script type="text/html" id="is_imageUri">
            {{# var fastDfsServer = document.getElementById("fastDfsServer").value;}}
            {{# if(d.imageUri != null && d.imageUri != ''){ }}
            <img src="{{fastDfsServer + d.imageUri}}" style="display: inline-block; width: 20%; height: 100%;cursor: zoom-in">
            {{# } }}
        </script>

        <!-- javascript -->
        <script th:src="@{'/layui/layui.js'}"></script>
        <script>
            layui.config({
                base: '/' //静态资源所在路径
            });
        </script>
        <script th:src="@{'/js/estate/access-manage.js'}"></script>
    </body>
</html>
