<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sptg="http://www.thymeleaf.org/sptg">
    <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;" id="residential-manage">
        <input type="hidden" id="org_id" th:value="${onLineUser.orgId}" />
        <input type="hidden" id="org_type" th:value="${userOrg.orgType}" />
        <div class="layui-fluid">
            <!-- 下拉树 -->
            <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">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">选择地区</label>
                                    <div class="layui-input-block" id="region_body">
                                        <input type="hidden"  name="regionProvince" />
                                        <input type="hidden"  name="regionCity" />
                                        <input type="hidden"  name="regionArea" />
                                        <input type="text" id="region" readonly="readonly" placeholder="请选择" autocomplete="off" class="layui-input" />
                                        <div th:replace="common/region"></div>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">所属社区</label>
                                <div class="layui-input-block">
                                    <div id="agency_name"></div>
                                    <input id="agency_id" type="hidden" />
<!--                                    <div id="org_name"></div>-->
<!--                                    <input id="org_pid" 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">-->
<!--                                    <div id="estate_name"></div>-->
<!--                                    <input id="estate_pid" 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="residentialNumber" 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="isAssign" name="isAssign" >
                                        <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;">
                            <div style="padding-bottom: 10px;">
                                <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="add" sptg:security="estate:residential:add">添加小区</button>
                                <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="batchdel" lay-event="batchdel" sptg:security="estate:residential:delete">批量删除</button>
                                <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="batchregister" lay-event="batchregister" sptg:security="estate:residential:register:batchdevice">批量注册设备</button>
                                <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="import" lay-event="import" sptg:security="estate:residential:import">导入</button>
                                <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="export" lay-event="export" sptg:security="estate:residential:export">导出</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:residential:update">修改</a>
            <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del" sptg:security="estate:residential:delete">删除</a>
            {{#  if(d.isAssign == 0){ }}
            <a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="assign" sptg:security="estate:residential: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="faceCharge" sptg:security="estate:faceChargeProject:manage">人脸套餐设置</a></li>-->
                <li><a  lay-event="detail" sptg:security="estate:residential:manage">管理小区</a></li>
               <!-- {{#  if(d.qinlinResidentialId == null){ }}
                <li><a  lay-event="registerAdd" sptg:security="estate:residential:register:add">注册小区</a></li>
                {{#  } }}-->
                <li><a  lay-event="registerDevice" sptg:security="estate:residential:register:device">注册设备</a></li>
                <li><a  lay-event="trash" sptg:security="estate:residential:trash">放入垃圾箱</a></li>
                {{#  if(d.oldId != null){ }}
                <li><a  lay-event="syncBuilding" sptg:security="estate:residential:sync">同步楼栋</a></li>
                <li><a  lay-event="syncUnit" sptg:security="estate:residential:sync">同步单元</a></li>
                <li><a  lay-event="syncFloor" sptg:security="estate:residential:sync">同步楼层</a></li>
                <li><a  lay-event="syncRoom" sptg:security="estate:residential:sync">同步房间</a></li>
                {{#  } }}
                <li><a  lay-event="clearBuilding" sptg:security="estate:residential:delete">清空楼栋信息</a></li>
            </ul>
        </script>
        <!-- javascript -->
        <script th:src="@{'/layui/layui.js'}"></script>
        <script>
            layui.config({
                base: '/' //静态资源所在路径
            });
        </script>
        <script th:src="@{'/js/estate/residential-manage.js'}"></script>
    </body>
</html>