<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<c:set var="path" value="${pageContext.request.contextPath}"/>
<%@ include file="/WEB-INF/jspf/common.jspf" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>水印设置</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv=X-UA-Compatible IE=EmulateIE7>
    <link rel="stylesheet" href="${path}/static/css/bootstrap-colorpicker.css"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="${path}/static/js/html5shiv.min.js"></script>
    <script type="text/javascript" src="${path}/static/js/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="${path}/static/js/respond.min.js"></script>
    <![endif]-->
    <script type="text/javascript" src="${path}/static/js/otherManage/bootstrap-colorpicker.js"></script>
    <script>
        var path = "${path}";
    </script>
    <style type="text/css">
        .labelDiv{
            text-align: right;
            padding-top:5px;
        }
        /**查询按钮组*/
        .btnsDiv{
            margin-top: 15px;
            height:35px;
            text-align: right;
            margin-right: 25px;
        }
        .btns{
            margin-left: 2%;
        }
        .row{
            padding-top:10px;
        }
        #color{
            width: 20px;
            height: 20px;
            border: 1px solid #fff;
            border-radius: 4px;
            text-indent: 20px;
        }
    </style>
</head>
<body>
<div class="">
    <div class="headDiv">
        <div class="headSpanDiv">
            <span class="headspan">
                水印设置
            </span>
        </div>
    </div>
    <form id="form" enctype="multipart/form-data">
        <input type="hidden" name="id" id="id" value="${pdfWaterSet.id}">
        <input type="hidden" name="upOrUnder" id="upOrUnder" value="${pdfWaterSet.upOrUnder}">
        <div class="row">
            <div class="col-md-5">
                <div class="col-md-5 labelDiv">
                    <label>透明度：</label>
                </div>
                <div class="col-md-7">
                    <input type="text" id="transparent" class="form-control input-sm"  name="transparent" value="${pdfWaterSet.transparent}"
                           onkeyup="if(isNaN(value)){execCommand('undo');toastr.warning('只能输入数字 !');}"
                           onafterpaste="if(isNaN(value))execCommand('undo')"
                    />
                </div>
            </div>
        </div>
        <hr>
        <div class="row">
            <div class="col-md-5">
                <div class="col-md-5 labelDiv">
                    <label>浏览启用文本水印：</label>
                </div>
                <div class="col-md-7">
                    <select class="form-control input-sm" name="effective">
                        <option value="1" <c:if test="${pdfWaterSet.effective == 1}">selected</c:if>>是</option>
                        <option value="0" <c:if test="${pdfWaterSet.effective == 0}">selected</c:if>>否</option>
                    </select>
                </div>
            </div>
            <div class="col-md-5">
                <div class="col-md-5 labelDiv">
                    <label>下载启用文本水印：</label>
                </div>
                <div class="col-md-7">
                    <select class="form-control input-sm" name="downloadEffective">
                        <option value="1" <c:if test="${pdfWaterSet.downloadEffective == 1}">selected</c:if>>是</option>
                        <option value="0" <c:if test="${pdfWaterSet.downloadEffective == 0}">selected</c:if>>否</option>
                    </select>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-5">
                <div class="col-md-5 labelDiv">
                    <label>打印启用文本水印：</label>
                </div>
                <div class="col-md-7">
                    <select class="form-control input-sm" name="printEffective">
                        <option value="1" <c:if test="${pdfWaterSet.printEffective == 1}">selected</c:if>>是</option>
                        <option value="0" <c:if test="${pdfWaterSet.printEffective == 0}">selected</c:if>>否</option>
                    </select>
                </div>
            </div>
            <div class="col-md-5">
                <div class="col-md-5 labelDiv">
                    <label>文本内容：</label>
                </div>
                <div class="col-md-7">
                    <input type="text" id="text" class="form-control input-sm" value="${pdfWaterSet.text}"
                           name="text" maxlength="50">
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-5">
                <div class="col-md-5 labelDiv">
                    <label>文本偏右(px)：</label>
                </div>
                <div class="col-md-7">
                    <input type="number" min="0" id="textX" class="form-control input-sm" value="${pdfWaterSet.textX}"
                           name="textX" maxlength="10">
                </div>
            </div>
            <div class="col-md-5">
                <div class="col-md-5 labelDiv">
                    <label>文本偏上(px)：</label>
                </div>
                <div class="col-md-7">
                    <input type="number" min="0" id="textY" class="form-control input-sm" value="${pdfWaterSet.textY}"
                           name="textY" maxlength="10">
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-5">
                <div class="col-md-5 labelDiv">
                    <label>文本字号大小：</label>
                </div>
                <div class="col-md-7">
                    <input type="number" min="0" class="form-control input-sm" value="${pdfWaterSet.textSize}"
                           name="textSize" id="textSize" maxlength="10">
                </div>
            </div>
            <div class="col-md-5">
                <div class="col-md-5 labelDiv">
                    <label>文本旋转角度：</label>
                </div>
                <div class="col-md-7">
                    <input type="number" min="0" class="form-control input-sm" value="${pdfWaterSet.textRotation}"
                           name="textRotation" id="textRotation" maxlength="10">
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-5">
                <div class="col-md-5 labelDiv">
                    <label>文本颜色：</label>
                </div>
                <div class="col-md-7">
                    <input type="text" id="color"  class="form-control input-sm" style="background-color: ${pdfWaterSet.textColor}">
                    <input type="hidden" class="form-control input-sm" value="${pdfWaterSet.textColor}"
                           id="textColor" name="textColor" maxlength="12">
                </div>
            </div>
            <div class="col-md-5">
                <div class="col-md-5 labelDiv">
                    <label>是否开启用户信息水印：</label>
                </div>
                <div class="col-md-7">
                    <select class="form-control input-sm" name="userEffective">
                        <option value="1" <c:if test="${pdfWaterSet.userEffective == 1}">selected</c:if>>是</option>
                        <option value="0" <c:if test="${pdfWaterSet.userEffective == 0}">selected</c:if>>否</option>
                    </select>
                </div>
            </div>
        </div>
        <hr>
        <div class="row">
            <div class="col-md-5">
                <div class="col-md-5 labelDiv">
                    <label>浏览启用水印图片：</label>
                </div>
                <div class="col-md-7">
                    <select class="form-control input-sm" name="isImg">
                        <option <c:if test="${pdfWaterSet.isImg == 1}">selected</c:if> value="1">是</option>
                        <option <c:if test="${pdfWaterSet.isImg == 0}">selected</c:if> value="0">否</option>
                    </select>
                </div>
            </div>
            <div class="col-md-5">
                <div class="col-md-5 labelDiv">
                    <label>下载启用水印图片：</label>
                </div>
                <div class="col-md-7">
                    <select class="form-control input-sm" name="downloadIsImg">
                        <option <c:if test="${pdfWaterSet.downloadIsImg == 1}">selected</c:if> value="1">是</option>
                        <option <c:if test="${pdfWaterSet.downloadIsImg == 0}">selected</c:if> value="0">否</option>
                    </select>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-5">
                <div class="col-md-5 labelDiv">
                    <label>打印启用水印图片：</label>
                </div>
                <div class="col-md-7">
                    <select class="form-control input-sm" name="printIsImg">
                        <option <c:if test="${pdfWaterSet.printIsImg == 1}">selected</c:if> value="1">是</option>
                        <option <c:if test="${pdfWaterSet.printIsImg == 0}">selected</c:if> value="0">否</option>
                    </select>
                </div>
            </div>
            <div class="col-md-5">
                <div class="col-md-5 labelDiv">
                    <label>选择图片：</label>
                </div>
                <div class="col-md-7">
                    <input type="file" id="file" accept="image/jpg,image/jpeg,image/png,image/bmp">
                    <input type="hidden" id="imgFile" name="imgFile" value="${pdfWaterSet.imgFile}">
                    <a href="${path}/static/pdfWaterSet/upload/${pdfWaterSet.imgFile}" target="_blank" id="aDiv">
                        <img width="100" height="100" src="${path}/static/pdfWaterSet/upload/${pdfWaterSet.imgFile}" id="imgDiv"/>
                    </a>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-5">
                <div class="col-md-5 labelDiv">
                    <label>水印图片宽(px)：</label>
                </div>
                <div class="col-md-7">
                    <input type="number" min="0" class="form-control input-sm" value="${pdfWaterSet.imgWidth}"
                           name="imgWidth" id="imgWidth" maxlength="10">
                </div>
            </div>
            <div class="col-md-5">
                <div class="col-md-5 labelDiv">
                    <label>水印图片高(px)：</label>
                </div>
                <div class="col-md-7">
                    <input type="number" min="0" class="form-control input-sm" value="${pdfWaterSet.imgHeight}"
                           name="imgHeight" id="imgHeight" maxlength="10">
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-5">
                <div class="col-md-5 labelDiv">
                    <label>图片偏右(px)：</label>
                </div>
                <div class="col-md-7">
                    <input type="number" min="0" class="form-control input-sm" value="${pdfWaterSet.imgX}"
                           name="imgX" id="imgX" maxlength="10">
                </div>
            </div>
            <div class="col-md-5">
                <div class="col-md-5 labelDiv">
                    <label>图片偏上(px)：</label>
                </div>
                <div class="col-md-7">
                    <input type="number" min="0" class="form-control input-sm" value="${pdfWaterSet.imgY}"
                           name="imgY" id="imgY" maxlength="10">
                </div>
            </div>
        </div>
        <div class="btnsDiv">
            <shiro:hasPermission name="/pdfWaterSet/update">
                <button type="button" class="btn btn-sm btn-primary btns" onclick="save()">保存</button>
            </shiro:hasPermission>
        </div>
    </form>
</div>
<script type="text/javascript" src="${path}/static/js/otherManage/pdfWaterSet.js"></script>
<script type="text/javascript" src="${path}/static/js/dateUtil.js"></script>
</body>
</html>
