<!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="unit_id" th:value="${unit.id}" />
                                    <input type="hidden" id="residential_id" th:value="${unit.residentialId}" />
                                    <label class="layui-form-label">单元名称：</label>
                                    <div class="layui-input-inline">
                                        <span class="detail-info"  th:text="${unit.name}"></span>
                                    </div>
                                    <label class="layui-form-label">单元编号：</label>
                                    <div class="layui-input-inline">
                                        <span class="detail-info"  th:text="${unit.unitNumber}"></span>
                                    </div>
                                    <label class="layui-form-label">所属小区：</label>
                                    <div class="layui-input-inline">
                                        <span class="detail-info"  th:text="${unit.residentialName}"></span>
                                    </div>
                                    <label class="layui-form-label">所属机构：</label>
                                    <div class="layui-input-inline">
                                        <span class="detail-info"  th:text="${unit.orgPidName}"></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:room: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="edit" sptg:security="estate:room:update">修改</a>
            <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del" sptg:security="estate:room:delete">删除</a>
            <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="detail" sptg:security="estate:room:manage">管理房间</a>
        </script>

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