<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('缓存清理')" />
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="col-sm-12">
        <div class="row">
            <label class="col-sm-1 control-label"></label>
            <div class="col-sm-8">
                <div style="color: #999999;">备注：0:会员看板，1:今年产品看板，2:去年产品看板，3:前年产品看板</div>
            </div>
        </div>
        <div class="row">
            <label class="col-sm-1 control-label"></label>
            <div class="col-sm-10">
                <label class="check-box">
                    <input type="checkbox" value="0" id="inlineCheckbox0" name="checkboxGroupName">0</label>
                <label class="check-box">
                    <input type="checkbox" value="1" id="inlineCheckbox1" name="checkboxGroupName">1</label>
                <label class="check-box">
                    <input type="checkbox" value="2" id="inlineCheckbox2" name="checkboxGroupName">2</label>
                <label class="check-box">
                    <input type="checkbox" value="3" id="inlineCheckbox3" name="checkboxGroupName">3</label>
                <label class="check-box">
                    <input type="checkbox" value="4" id="inlineCheckbox4" name="checkboxGroupName">4</label>
                <label class="check-box">
                    <input type="checkbox" value="5" id="inlineCheckbox5" name="checkboxGroupName">5</label>
                <label class="check-box">
                    <input type="checkbox" value="6" id="inlineCheckbox6" name="checkboxGroupName">6</label>
                <label class="check-box">
                    <input type="checkbox" value="7" id="inlineCheckbox7" name="checkboxGroupName">7</label>
                <label class="check-box">
                    <input type="checkbox" value="8" id="inlineCheckbox8" name="checkboxGroupName">8</label>
                <label class="check-box">
                    <input type="checkbox" value="9" id="inlineCheckbox9" name="checkboxGroupName">9</label>
                <label class="check-box">
                    <input type="checkbox" value="10" id="inlineCheckbox10" name="checkboxGroupName">10</label>
                <label class="check-box">
                    <input type="checkbox" value="11" id="inlineCheckbox11" name="checkboxGroupName">11</label>
                <label class="check-box">
                    <input type="checkbox" value="12" id="inlineCheckbox12" name="checkboxGroupName">12</label>
                <label class="check-box">
                    <input type="checkbox" value="13" id="inlineCheckbox13" name="checkboxGroupName">13</label>
                <label class="check-box">
                    <input type="checkbox" value="14" id="inlineCheckbox14" name="checkboxGroupName">14</label>
                <label class="check-box">
                    <input type="checkbox" value="15" id="inlineCheckbox15" name="checkboxGroupName">15</label>
            </div>
        </div>
        <div class="row" style="margin-top: 10px;">
            <label class="col-sm-1 control-label" style="text-align: right;padding: 0;height: 34px;line-height: 34px;">清空单体：</label>
            <div class="col-sm-8">
                <input type="text" id="keyName" name="" class="form-control" placeholder="">
            </div>
        </div>
        <div class="row" style="margin-top: 10px;">
            <label class="col-sm-1 control-label"></label>
            <button id="applyBtn" class="btn btn-success" style="margin-left: 15px;">
                提交
            </button>
        </div>
    </div>
</div>
</body>
<th:block th:include="include :: footer" />
<script type="text/javascript">
    var domain = window.location.host;
    var ht = domain.indexOf('localhost') != -1 ? 'http://' : 'https://';
    var prefixEdit = ht + domain + "/oneportal/wxportal/magnet";
    // var prefixEdit = 'https://suishenbangtest.nipponpaint.com.cn/oneportal/wxportal/magnet';

    $('#applyBtn').on('click', function (res) {
        var selectedValues = [];
        $('input[name="checkboxGroupName"]:checked').each(function() {
            selectedValues.push($(this).val()*1);
        });
        var keyNameValue = $('#keyName').val();
        var data = {
            redisDb:selectedValues,
            keyName:keyNameValue
        }
        console.log(1,data);
        $.ajax({
            url: prefixEdit + '/cleanRedisByDb',
            type: "post",
            contentType: 'application/json',
            data: JSON.stringify(data),
            success: function (result) {
                if (result.code == 0) {
                    $.modal.alertWarning('提交成功');
                } else {
                    $.modal.alertWarning(result.msg);
                }
            }
        })
    })
</script>
</html>
