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

        .w80{width:80px !important;}
    </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="">

                            <div class="layui-form-item">
                                <label class="layui-form-label"><span class="must">*</span>策略名称</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="name"  lay-verify="required" placeholder="" autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label"><span class="must">*</span>策略类型</label>
                                <div class="layui-input-inline">
                                    <input type="radio" name="type" value="1" lay-verify="typeRequired" lay-filter="type-filter" title="工作日"  checked>
                                    <input type="radio" name="type" value="2" lay-verify="typeRequired" lay-filter="type-filter" title="范围"  >
                                </div>
                            </div>
                            <div class="layui-form-item" id="weekday-id">
                                <label class="layui-form-label"><span class="must">*</span>时间选择</label>
                                <div class="layui-input-block">
                                    <input type="checkbox" name="workingDay" value="1" lay-verify="checkboxMustBe" lay-skin="primary" title="星期一">
                                    <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><span>星期一</span><i
                                            class="layui-icon layui-icon-ok"></i></div>
                                    <input type="checkbox" name="workingDay" value="2" lay-verify="checkboxMustBe" lay-skin="primary" title="星期二">
                                    <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><span>星期二</span><i
                                            class="layui-icon layui-icon-ok"></i></div>
                                    <input type="checkbox" name="workingDay" value="3" lay-verify="checkboxMustBe" lay-skin="primary" title="星期三">
                                    <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><span>星期三</span><i
                                            class="layui-icon layui-icon-ok"></i></div>
                                    <input type="checkbox" name="workingDay" value="4" lay-verify="checkboxMustBe" lay-skin="primary" title="星期四">
                                    <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><span>星期四</span><i
                                            class="layui-icon layui-icon-ok"></i></div>
                                    <input type="checkbox" name="workingDay" value="5" lay-verify="checkboxMustBe" lay-skin="primary" title="星期五">
                                    <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><span>星期五</span><i
                                            class="layui-icon layui-icon-ok"></i></div>
                                    <input type="checkbox" name="workingDay" value="6" lay-verify="checkboxMustBe" lay-skin="primary" title="星期六">
                                    <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><span>星期六</span><i
                                            class="layui-icon layui-icon-ok"></i></div>
                                    <input type="checkbox" name="workingDay" value="7" lay-verify="checkboxMustBe" lay-skin="primary" title="星期日">
                                    <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><span>星期日</span><i
                                            class="layui-icon layui-icon-ok"></i></div>
                                </div>
                            </div>
                            <div class="layui-form-item"  id="datetime-range-id" style="display: none;">
                                <label class="layui-form-label"><span class="must">*</span>时间范围</label>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input" autocomplete="off"  name="strategyDate"  placeholder=" - ">
                                </div>
                            </div>
                            <div class="layui-form-item laydate-time-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label"><span class="must">*</span>时间段</label>
                                    <div class="layui-input-inline">
                                        <input type="text" class="layui-input" lay-verify="required" autocomplete="off" name="strategyTime" id="laydate-type-time-head" placeholder=" - " >
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">音量大小</label>
                                    <div class="layui-input-inline w80" >
                                        <input type="number" min="0" max="100"  name="soundVolume"  class="layui-input" oninput="if(value>100)value=100" onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">屏幕亮度</label>
                                    <div class="layui-input-inline w80">
                                        <input type="number" min="0" max="100" name="screenLuminance"  class="layui-input" oninput="if(value>100)value=100" onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">补光灯亮度</label>
                                    <div class="layui-input-inline w80">
                                        <input type="number" min="0" max="100" name="fillLightLuminance" class="layui-input" oninput="if(value>100)value=100" onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <button class="layui-btn layui-btn-radius layui-btn-sm"  type="add-time-range">增加</button>
                                </div>
                            </div>
                            <div id="time-range">
                            </div>
                            <div class="layui-form-item layui-form-text">
                                <label class="layui-form-label">备注</label>
                                <div class="layui-input-block">
                                    <textarea name="remark" placeholder="请输入200字以内" class="layui-textarea w500"></textarea>
                                </div>
                            </div>


                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button class="layui-btn" lay-submit lay-filter="entity_submit_event">提交</button>
                                    <button type="reset" class="layui-btn layui-btn-primary">取消</button>
                                </div>
                            </div>
                        </div>
                        <div id="time-range-template" style="display:none;">
                            <div class="layui-form-item laydate-time-item" >
                                <div class="layui-inline">
                                    <label class="layui-form-label"><span class="must">*</span>时间段</label>
                                    <div class="layui-input-inline">
                                        <input type="text" lay-verify="required" class="layui-input" name="strategyTime" placeholder=" - " >
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">音量大小</label>
                                    <div class="layui-input-inline w80" >
                                        <input type="number" min="0" max="100"  name="soundVolume" class="layui-input" oninput="if(value>100)value=100" onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">屏幕亮度</label>
                                    <div class="layui-input-inline w80">
                                        <input type="number" min="0" max="100" name="screenLuminance"  class="layui-input" oninput="if(value>100)value=100" onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">补光灯亮度</label>
                                    <div class="layui-input-inline w80">
                                        <input type="number" min="0" max="100" name="fillLightLuminance"  class="layui-input" oninput="if(value>100)value=100" onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <button class="layui-btn  layui-btn-radius layui-btn-sm"  type="delete-time-range">删除</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</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-add.js'}" charset="utf-8"></script>
</html>