<!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" name="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" name="selectedAdCode" 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="isEnable" name="isEnable">
                            <option value="">全部</option>
                            <option value="0">启用</option>
                            <option value="1">禁用</option>
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">过期时间：</label>
                    <div class="layui-input-inline" style="width:316px;">
                        <input type="text" th:if="${adPushApp?.beginDate!=null}"
                               th:value="${adPushApp?.beginDate+' - '+adPushApp?.endDate}"
                               class="layui-input date-icon" id="expirationTime" placeholder="请选择过期时间"
                               autocomplete="off" lay-key="1">
                        <input type="text" th:if="${adPushApp?.beginDate==null}"
                               class="layui-input date-icon" id="expirationTime" placeholder="请选择过期时间"
                               autocomplete="off" lay-key="1">
                    </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:push:app:add">添加公告
                    </button>
                    <button class="layui-btn layuiadmin-btn-admin" lay-submit lay-filter="batchdel"
                            sptg:security="ad:push:app: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:push:app:add">修改</a>
            <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del" sptg:security="ad:push:app:delete">删除</a>
        </script>

        <!-- 视频显示 -->
        <script type="text/html" id="videoUri">
            {{#  if(d.videoType == 1 ){ }}
            <a href="{{d.videoUri}}" style="color: #1E9FFF;cursor: pointer;" target="_blank">点击查看视频</a>
            {{#  }else if(d.videoType == 0 ){ }}
            <img style="display: inline-block; width: 16%; height: 100%;cursor: zoom-in" src="{{d.videoUri}}">
            {{#  } }}
        </script>

        <!-- 状态 -->
        <script type="text/html" id="entity_is_enable">
            <input type="checkbox" name="isEnable" lay-skin="switch" lay-filter="switch_is_enable"
                   data-json="{{ encodeURIComponent(JSON.stringify(d)) }}"
                   lay-text="启用|禁用" {{ d.isEnable== 0 ? 'checked' : '' }} />
        </script>
    </div>
</div>
<!-- javascript -->
<script th:src="@{'/layui/layui.js'}" charset="utf-8"></script>
<script>
    layui.config({
        base: '/' //静态资源所在路径
    });
</script>
<script th:src="@{'/js/ad/ad-push-app-manage.js'}" charset="utf-8"></script>
</body>

</html>