<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sptg="http://www.thymeleaf.org">
    <head>
        <script th:replace="common/head"></script>
    </head>
    <body>
        <input type="hidden" id="org_id" th:value="${onLineUser.orgId}" />
        <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>

                    <fieldset class="layui-elem-field">
                        <legend>当前房间</legend>
                        <div class="layui-field-box">
                            <div class="layui-form-item">
                                <input type="hidden" id="room_id" th:value="${room.id}" />
                                <input type="hidden" id="unit_id" th:value="${room.unitId}" />
                                <input type="hidden" id="residential_id" th:value="${room.residentialId}" />
                                <label class="layui-form-label">房间名称：</label>
                                <div class="layui-input-inline">
                                    <span class="detail-info"  th:text="${room.name}"></span>
                                </div>
                                <label class="layui-form-label">房间编号：</label>
                                <div class="layui-input-inline">
                                    <span class="detail-info"  th:text="${room.houseNumber}"></span>
                                </div>
                                <label class="layui-form-label">所属单元：</label>
                                <div class="layui-input-inline">
                                    <span class="detail-info"  th:text="${room.unitName}"></span>
                                </div>
                                <label class="layui-form-label">所属小区：</label>
                                <div class="layui-input-inline">
                                    <span class="detail-info"  th:text="${room.residentialName}"></span>
                                </div>
                            </div>
                        </div>
                    </fieldset>
                    <!-- 表格+头部按钮 -->
                    <div class="layui-card-body" style="padding:0;">
                        <div style="padding-bottom: 10px;">
                            <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="add" sptg:security="estate:user:add">添加住户</button>
                        </div>
                        <table id="table_id" lay-filter="table_event"></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="detail">详情</a>
            <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>
        </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 { }}
            <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){ }}
            <span style="color:green">审核通过</span>
            {{#  }else if(d.checkState == -1){ }}
            <span style="color:yellow">未上传</span>
            {{# }else { }}
            <span style="color:red">审核不通过</span>
            {{# } }}
        </script>
        <!-- javascript -->
        <script th:src="@{'/layui/layui.js'}"></script>
        <script>
            layui.config({
                base: '/' //静态资源所在路径
            });
        </script>
        <script th:src="@{'/js/estate/room-detail.js'}"></script>
    </body>
</html>
