<!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'}">
    </head>
    <body style="position: absolute;top:0;bottom: 0;left:0;right: 0;">
        <input type="hidden" id="org_id" th:value="${onLineUser.orgId}" />
        <div class="layui-fluid">
            <!-- 下拉树 -->
            <div th:replace="common/org-tree"></div>
            <!-- 表格 -->
            <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 for="agencyName" class="layui-form-label">社区名称</label>
                                <div class="layui-input-block">
                                    <input id="agencyName" type="text" autocomplete="off" class="layui-input">
                                </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:agency:add">添加社区</button>
                                <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="import" lay-event="import"  sptg:security="estate:agency:import">导入</button>
                            </div>
                            <table id="table_id" lay-filter="table_event"></table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>

    <!-- 工具栏 -->
    <script type="text/html" id="table-useradmin-webuser">
        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit" sptg:security="estate:agency:update">
            <span>修改</span>
        </a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete" sptg:security="estate:agency:delete">
            <span>删除</span>
        </a>
    </script>

    <!-- 机构状态 -->
<!--    <script type="text/html" id="entity_is_enable">-->
<!--        {{# if(d.id != pageData.myOrgId){ }}-->
<!--        <input type="checkbox" name="isEnable" lay-skin="switch" lay-filter="switch_is_enable"-->
<!--               data-json="{{ encodeURIComponent(JSON.stringify(d)) }}"-->
<!--               lay-text="正常|禁用" {{ d.isEnable == 1 ? 'checked' : '' }} />-->
<!--        {{# }else { }}-->
<!--        <input type="checkbox" name="isEnable" lay-skin="switch" disabled-->
<!--               lay-text="正常|禁用" {{ d.isEnable == 1 ? 'checked' : '' }} />-->
<!--        {{# } }}-->
<!--    </script>-->

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

        //  页面数据
        var pageData = {
            myOrgId     :   parseInt(document.getElementById('org_id').value)
        };
    </script>
    <script type="text/javascript" th:src="@{'/js/estate/agency-manage.js'}"></script>
</html>