<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sptg="http://www.thymeleaf.org">
    <head>
        <script th:replace="common/head"></script>

        <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" id="name" placeholder="请输入名称" 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-admin" lay-submit lay-filter="add" sptg:security="device:path:add">添加位置</button>
                        </div>
                        <table id="data_entity_table" lay-filter="data_table_event"></table>
                    </div>
                </div>
            </div>
        </div>

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

        <!-- 设备类型 -->
        <script type="text/html" id="device_path_type">
            {{#  if(d.type == 0){ }}
            <span>小区</span>
            {{# } else if(d.type == 1){ }}
            <span>单元</span>
            {{#  } }}
        </script>

        <!-- 位置用途 -->
        <script type="text/html" id="device_path_use">
            {{#  if(d.pathUse == 10){ }}
            <span>一般位置</span>
            <!--{{# } else if(d.pathUse == 11){ }}-->
            <!--<span>特殊位置</span>-->
            {{#  } }}
        </script>

        <!--操作-->
        <script type="text/html" id="table-operate">
            <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit" sptg:security="device:path:update">修改</a>
            <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete" sptg:security="device:path:delete">删除</a>
        </script>

    </body>

</html>
