<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sptg="http://www.thymeleaf.org">
    <head>
        <script th:replace="common/head"></script>
        <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}" />
        <input type="hidden" id="residentialId" th:value="${residentialId}" />
        <div class="layui-fluid">
            <div class="x-body">
                <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="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" style="width: auto;">人脸状态</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">创建时间</label>
                                <div class="layui-input-block">
                                    <input type="text"  class="layui-input date-icon" id="create_date"  placeholder="请选择" autocomplete="off">
                                    <input type="hidden" id="begin_date"  name="beginDate"/>
                                    <input type="hidden" id="end_date"  name="endDate" />
                                </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" style="padding:0;" id="layPhotosTbImg">
                            <div style="padding-bottom: 10px;">
                                <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="add" sptg:security="estate:user:add">添加住户</button>
                                <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="batchdel" sptg:security="estate:user:delete">批量删除</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="edit" sptg:security="estate:user:update">修改</a>
            <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del" sptg:security="estate:user:delete">删除</a>
            <a class="layui-btn layui-btn-xs" 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="detail">详情</a></li>
                <li> <a lay-event="faceImageSet" sptg:security="estate:access:faceImageSet">人脸设置</a></li>
                <li> <a lay-event="cardSet" sptg:security="estate:access:cardSet">卡设置</a></li>
                <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){ }}
                {{#  if(d.faceEnable == 1 && d.checkState == 1 && d.imageUri != null){ }}
                <li><a  lay-event="faceDisable" sptg:security="estate:access:specialPush">人脸禁用</a></li>
                {{#  }else if(d.faceEnable == 0&&d.checkState == 1 && d.imageUri != null|| d.faceEnable == 2&&d.checkState == 1 && d.imageUri != null){ }}
                <li><a  lay-event="faceEnable" sptg:security="estate:access:specialPush">人脸启用</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>
                {{# } }}
                {{# } }}
                <!--{{#  if(d.isMember == 0){ }}
                    <li> <a lay-event="member" sptg:security="estate:user:member">激活APP会员</a></li>
                {{#  } }}-->
            </ul>
        </script>

        <!-- 性别 -->
        <script type="text/html" id="is_sex">
            {{#  if(d.sex == 0){ }}
            <span>未定义</span>
            {{#  }else if(d.sex==1){ }}
            <span>男</span>
            {{# }else { }}
            <span>女</span>
            {{# } }}
        </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_createType">
            {{#  if(d.createType == 0){ }}
            <span>小程序</span>
            {{#  } else if(d.createType == 1){ }}
            <span>后台添加</span>
            {{#  } else if(d.createType == 2){ }}
            <span>后台导入</span>
            {{#  } else if(d.createType == 3){ }}
            <span>App添加</span>
            {{#  }  }}
        </script>
        <!-- 人脸审核状态 -->
        <script type="text/html" id="is_checkState">
            {{#  if(d.checkState == 0){ }}
            <span style="color:blue">待审核</span>
            {{#  }else if(d.checkState == 1){ }}
            <img src="{{d.fastDfsServer + d.imageUri}}" style="display: inline-block; width: 20%; height: 100%;cursor: zoom-in">
            {{# }else if(d.checkState == 2){ }}
            <span style="color:red">审核不通过</span>
            {{# }else if(d.checkState == -1){ }}
            <span style="color:orange">待上传</span>
            {{# } }}
        </script>
        <!-- APP会员激活状态 -->
        <script type="text/html" id="is_member">
            {{#  if(d.isMember == 0){ }}
            <span class="layui-badge layui-bg-black">未激活</span>
            {{#  }else if(d.isMember == 1){ }}
            <span class="layui-badge layui-bg-green">已激活</span>
            {{# } }}
        </script>
        <!-- javascript -->
        <script th:src="@{'/layui/layui.js'}"></script>
        <script>
            layui.config({
                base: '/' //静态资源所在路径
            });
        </script>
        <script th:src="@{'/js/estate/residential-user.js'}"></script>
    </body>
</html>
