<!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" style="display: flex;">
            <!-- 下拉树 -->
            <ul id="per-tree" class="layui-box layui-tree" style="width: 200px!important">
                <li data-id="0">
                    <i class="layui-icon layui-icon-triangle-d layui-tree-spread"></i>
                    <a href="javascript: void(0);"><cite>全国</cite></a>
                </li>
            </ul>
            <div class="x-body per-table " style="margin-left: 0;">
                <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" name="createTime" class="layui-input" id="date_range" placeholder="请选择发布时间" autocomplete="off">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">设备名称</label>
                                <div class="layui-input-block">
                                    <input type="text"  name="deviceName" 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="deviceSerialNumber" 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-useradmin" th:if="${taskType == 1}"
                                        sptg:security="device.advert.face.early_warning" lay-submit lay-filter="setWarning">设置预警</button>
                                <button class="layui-btn layuiadmin-btn-useradmin" th:if="${taskType == 2}"
                                        sptg:security="device.advert.leisure.early_warning" lay-submit lay-filter="setWarning">设置预警</button>
                            </div>
                            <input type="hidden" name="taskType" th:value="${taskType}" />
                            <table id="data_table" lay-filter="data_table_event"></table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>


    <script type="text/html" th:if="${taskType == 1}" th:attr="id='warning_from'" sptg:security="device.advert.face.early_warning">
        <div class="layui-fluid">
            <div class="layui-form">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">月预警值</label>
                        <div class="layui-input-block">
                            <input type="text" name="monthExpect"
                                   oninput = "value=value.replace(/[^\d]/g,'')"
                                   placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">周预警值</label>
                        <div class="layui-input-block">
                            <input type="text" name="weekExpect"
                                   oninput = "value=value.replace(/[^\d]/g,'')"
                                   placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <p>1、时间段内设备观看广告次数低于预警值，视为一次预警</p>
                    <p>2、下周和下月开始统计，记录下下周和下下月的预警记录</p>
                </div>
            </div>
        </div>
    </script>

    <script type="text/html" th:if="${taskType == 2}" th:attr="id='warning_from'" sptg:security="device.advert.leisure.early_warning">
        <div class="layui-fluid">
            <div class="layui-form">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">月预警值</label>
                        <div class="layui-input-block">
                            <input type="text" name="monthExpect"
                                   oninput = "value=value.replace(/[^\d]/g,'')"
                                   placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">周预警值</label>
                        <div class="layui-input-block">
                            <input type="text" name="weekExpect"
                                   oninput = "value=value.replace(/[^\d]/g,'')"
                                   placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <p>1、时间段内设备观看广告次数低于预警值，视为一次预警</p>
                    <p>2、下周和下月开始统计，记录下下周和下下月的预警记录</p>
                </div>
            </div>
        </div>
    </script>

    <!--操作-->
    <script type="text/html" id="table-operate">
        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="info">详情</a>
    </script>

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