<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <title>手工推送编辑</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="shortcut icon" type="image/x-icon" th:href="@{/favicon.ico}"/>
    <link rel="stylesheet" th:href="@{/lib/layui/css/layui.css}">
    <link rel="stylesheet" th:href="@{/css/common.css}">
    <link rel="stylesheet" th:href="@{/css/animate.min.css}">
    <link rel="stylesheet" th:href="@{/lib/layui/extend/formSelects-v4.css}" />
</head>

<body>
    <div class="z-body animated fadeIn">
        <form action="" method="post" class="layui-form layui-form-pane">
            <div class="layui-form-item">
                <label for="manualalarmlevel" class="layui-form-label">
                    时长
                </label>
                <div class="layui-input-block">
                    <input type="text" id="manualalarmlevel" name="manualalarmlevel" th:value="${manualalarmlevel}"
                           lay-verify="required" lay-vertype="tips"
                           autocomplete="new-username" class="layui-input">
                </div>
            </div>


            <div class="layui-form-item" pane="">
                <label class="layui-form-label">
                    状态
                </label>
                <div class="layui-input-block">
                    <input type="radio" name="statusname" value="1" th:checked="${manualname == '1' || manualname == null}" title="正常">
                    <input type="radio" name="statusname" value="0" th:checked="${manualname == '0'}" title="锁定">

                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block" style="margin-left:0;text-align:center;">
                    <button th:text="'修改'"  class="layui-btn layui-btn-normal btn-w100" lay-submit="" data-th-lay-filter="'edit'"></button>
                </div>
            </div>
            </form>
    </div>

    <script th:src="@{/lib/jquery/jquery.min.js}"></script>
    <script th:src="@{/lib/layui/layui.js}"></script>
    <script th:src="@{/js/common.js}"></script>

    <script>
        layui.config({
            base: '/lib/layui/extend/'
        }).extend({
            formSelects: 'formSelects-v4'
        }).use(['form', 'layer', 'formSelects', 'dtree'], function () {
            $ = layui.jquery;
            var form = layui.form
                , layer = layui.layer
                , formSelects = layui.formSelects
                , dtree = layui.dtree;



            //监听提交
            form.on('submit(edit)', function (form) {
                $.get('/code/update/'+$('input[name="statusname"]:checked').val()+'/'+ $("#manualalarmlevel").val(),  function (result) {
                    handlerResult(result, editDone);
                });
                return false;
            });

            function editDone(data) {
                layer.msg("修改成功", {icon: 6});
                setTimeout(function(){ window.parent.location.reload(true); }, 1500);
            }
        });
    </script>
</body>

</html>