<!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>
    <input type="hidden" id="residentialId" th:value="${residentialId}" />
    <div class="layui-fluid">
        <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">
                            <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">
                            <select name="type">
                                <option value="">全部</option>
                                <option value="0">保安</option>
                                <option value="1">快递</option>
                                <option value="2">外卖</option>
                                <option value="3">清洁</option>
                                <option value="4">其他</option>
                            </select>

                        </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" 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">
                            <select name="isEnable">
                                <option value="">全部</option>
                                <option value="0">启用</option>
                                <option value="1">禁用</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" 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:serverUser:add">添加人员</button>
                        <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="batchdel" sptg:security="estate:serverUser:delete">批量删除</button>
                    </div>
                    <table id="table-id" lay-filter="table-id"></table>
                </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:serverUser:update">修改</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete" sptg:security="estate:serverUser:delete">删除</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="openPermission" sptg:security="estate:serverUser:openDoor">开门权限</a></li>
            <li><a  lay-event="specialOpenPermission" sptg:security="estate:serverUser:openSpecialDoor">特殊开门权限</a></li>
<!--            <li><a  lay-event="disablePermission" sptg:security="estate:serverUser:openSpecialDoor">门禁禁用</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>-->
            {{#  if(d.faceEnable != null){ }}
            {{#  if(d.faceEnable == 1){ }}
            <li><a  lay-event="faceDisable" sptg:security="estate:access:specialPush">人脸禁用</a></li>
            {{#  }else { }}
            <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.accessCard != null){ }}-->
            <!--<li><a  lay-event="deleteCard" sptg:security="estate:access:specialPush">门禁卡禁用</a></li>-->
            <!--{{#  }else { }}-->
            <!--{{# } }}-->
            <!--{{#  if(d.serverUserFaceImage != null){ }}-->
            <!--<li><a  lay-event="deleteFace" sptg:security="estate:access:specialPush">人脸禁用</a></li>-->
            <!--{{#  }else { }}-->
            <!--{{# } }}-->
        </ul>

    </script>

    <!-- 人脸启用状态 -->
    <script type="text/html" id="is_faceEnable">
        {{#  if(d.faceEnable == -1){ }}
        <span class="layui-badge layui-bg-orange">未上传</span>
        {{#  }else if(d.faceEnable == 0){ }}
        <span class="layui-badge layui-bg-blue">待启用</span>
        {{#  }else if(d.faceEnable == 1){ }}
        <span class="layui-badge layui-bg-green">已启用</span>
        {{# }else { }}
        <span class="layui-badge layui-bg-red">已禁用</span>
        {{# } }}
    </script>

    <!-- 机构状态 -->
    <script type="text/html" id="switch_is_enable">
        <input type="checkbox" name="isEnable" lay-skin="switch" lay-filter="switch_is_enable"  kid="{{ d.id }}"
               lay-text="启用|禁用" {{ d.isEnable == 0 ? 'checked' : '' }} />
    </script>

    <!-- 图片显示 -->
    <input type="hidden" id="fastDfsServer" th:value="${fastDfsServer}" />
    <script type="text/html" id="is_imageUri">
        {{# var fastDfsServer = document.getElementById("fastDfsServer").value;}}
        {{# if(d.serverUserFaceImage != null && d.serverUserFaceImage != ''){ }}
        {{# if(d.serverUserFaceImage.imageUri != null && d.serverUserFaceImage.imageUri != ''){ }}
        <img src="{{fastDfsServer + d.serverUserFaceImage.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/residential-server-user.js'}"></script>

</body>

</html>
