<!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>
<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="selectedAdTitle" 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" id="selectedAdCode" placeholder="请输入" autocomplete="off" class="layui-input">-->
                <!--                        </div>-->
                <!--                    </div>-->
                <!--                    <div class="layui-inline">-->
                <!--                        <label class="layui-form-label">广告类别</label>-->
                <!--                        <div class="layui-input-block">-->
                <!--                            <select id="selectedAdTypeId" lay-verify="" lay-search="">-->
                <!--                                <option value="" selected>全部</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;" id="layPhotosTbImg">
                    <div style="padding-bottom: 10px;">
                        <button class="layui-btn layuiadmin-btn-admin" lay-submit lay-filter="add"
                                sptg:security="ad:adsense:insert">添加广告位
                        </button>
                        <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="batchdel"
                                sptg:security="ad:adsense:delete">批量删除
                        </button>
                    </div>
                    <table id="table-id" lay-filter="table-id"></table>
                </div>
            </div>

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

                {{# if(d.adsenseStatus == '0'){ }}
                <a class="layui-btn layui-btn-xs" lay-event="open"
                   sptg:security="ad:adsense:insert">启用</a>
                {{#  }else if(d.adsenseStatus == '1'){ }}
                <a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="close"
                   sptg:security="ad:adsense:insert">停用</a>
                {{# } }}
            </script>

            <!-- 设备名称或门体编号显示 -->
            <script type="text/html" id="doorNumberOrDeviceName">
                {{# if(d.adsenseType == '1'){ }}
                <span>{{ d.deviceName }}</span>

                {{#  }else{ }}
                <span>{{ d.doorNumber }}</span>
                {{# } }}
            </script>

            <!-- 广告位类型显示 -->
            <script type="text/html" id="adsenseTypeTemplate">
                {{# if(d.adsenseType == '1'){ }}
                <span>设备</span>
                {{#  }else if(d.adsenseType == '2'){ }}
                <span>门体灯箱</span>
                {{# }else if(d.adsenseType == '3'){ }}
                <span>围栏灯箱</span>
                {{# } }}
            </script>
            <!-- 广告类型显示 -->
            <script type="text/html" id="adTypeTemplate">
                {{# if(d.adType == '1'){ }}
                <span>图片</span>
                {{#  }else if(d.adType == '2'){ }}
                <span>视频</span>

                {{# } }}
            </script>
            <!-- 广告状态显示 -->
            <script type="text/html" id="adsenseStatusTemplate">
                {{# if(d.adsenseStatus == '1'){ }}
                <span>启用</span>
                {{#  }else if(d.adsenseStatus == '0'){ }}
                <span>停用</span>
                {{# } }}
            </script>

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

    </script>
    <script th:src="@{'/js/ad/ad-adsense-manage.js'}" charset="utf-8"></script>
</body>

</html>
