<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <script th:replace="common/head"></script>
    <style>
        .layui-form-item .layui-input-inline{
            padding: 7px 15px;
            width: auto;
        }
        .layui-form-item{
            margin-bottom: 0;
        }
        .layui-form-label {
            min-width: 90px !important;
        }
        .layui-input-inline.push_region{
            width: 80%;
        }
        .push_region span{
            margin-right: 15px;
            display: inline-block;
        }
        .push_region span:last-child{
            margin-right: 0;
        }
    </style>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body" pad15>

                    <div class="layui-form" lay-filter="entity_form">

                        <div class="layui-form-item layui-form">
                            <label class="layui-form-label">策略名称</label>
                            <div class="layui-input-inline">
                                <span th:text="${task.strategyName}"></span>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">策略类型</label>
                            <div class="layui-input-block">
                                <input type="radio" name="type" value="1" lay-filter="type-filter" title="工作日"  th:checked="${task.strategyType==1}">
                                <input type="radio" name="type" value="2" lay-filter="type-filter" title="范围"  th:checked="${task.strategyType==2}">
                            </div>
                        </div>
                        <div class="layui-form-item" th:if="${task.strategyType ==1}" >
                            <label class="layui-form-label">时间选择</label>
                            <div class="layui-input-inline">
                                <span th:text="${task.workingDay}"></span>
                            </div>
                        </div>
                        <div class="layui-form-item"  id="datetime-range-id" th:if="${task.strategyType ==2}">
                            <label class="layui-form-label">时间范围</label>
                            <div class="layui-input-inline">
                                <span th:text="${#dates.format(task.beginDate, 'yyyy-MM-dd')}"></span>
                                <span>&nbsp;-&nbsp;</span>
                                <span th:text="${#dates.format(task.endDate, 'yyyy-MM-dd')}"></span>
                            </div>
                        </div>
                        <div class="layui-form-item laydate-time-item" th:each="taskConf:${task.timeStrategyTaskConfList}">
                            <div class="layui-inline">
                                <label class="layui-form-label">时间段</label>
                                <div class="layui-input-inline">
                                    <span th:text="${#dates.format(taskConf.beginTime, 'HH:mm:ss')}"></span>
                                    <span>&nbsp;-&nbsp;</span>
                                    <span th:text="${#dates.format(taskConf.endTime, 'HH:mm:ss')}"></span>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">音量大小</label>
                                <div class="layui-input-inline w80" >
                                    <span th:text="${taskConf.soundVolume}"></span>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">屏幕亮度</label>
                                <div class="layui-input-inline w80">
                                    <span th:text="${taskConf.screenLuminance}"></span>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">补光灯亮度</label>
                                <div class="layui-input-inline w80">
                                    <span th:text="${taskConf.fillLightLuminance}"></span>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item layui-form">
                            <label class="layui-form-label">备注</label>
                            <div class="layui-input-inline">
                                <span th:text="${task.remark}"></span>
                            </div>
                        </div>
                        <!-- 发布状态 -->
                        <div class="layui-form-item layui-form">
                            <label class="layui-form-label">
                                <span>发布状态:</span>
                            </label>
                            <div class="layui-input-inline">
                                <span style="color: red;" th:if="${task.pushStatus == -1}">发布失败</span>
                                <span style="color: green;" th:if="${task.pushStatus == 1}">待发布</span>
                                <span style="color: green;" th:if="${task.pushStatus == 2}">发布成功</span>
                            </div>
                        </div>
                        <!-- 发布时间 -->
                        <div class="layui-form-item layui-form" th:if="${null != task.pushTime}">
                            <label class="layui-form-label">
                                <span>发布时间:</span>
                            </label>
                            <div class="layui-input-inline">
                                <span th:text="${#dates.format(task.pushTime, 'yyyy-MM-dd HH:mm:ss')}"></span>
                            </div>
                        </div>
                        <!-- 发布范围 -->
                        <div class="layui-form-item layui-form">
                            <label class="layui-form-label">
                                <span>发布范围:</span>
                            </label>
                            <div class="layui-input-inline push_region" id="push_region">

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<input id="l_task_id" type="hidden" th:value="${task.id}" />
<input id="i_push_type" type="hidden" th:value="${task.pushType}" />
</body>
<!-- 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/device/time-strategy-push-detail.js'}" charset="utf-8"></script>
</html>