<%@ 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" %>
<%@ include file="/WEB-INF/jspf/ztreeCommom.jsp" %>
<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>
    <!--[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>
        var path = "${path}";
    </script>
    <style type="text/css">
        .mainDiv{
            background-color: #fff;
        }
        /**搜索区*/
        .searchDiv{
            padding-top:5px;
            height:30px;
            text-align: right;
        }
        .searchInput{
            width: 18%;
        }
        .searchElement{
            width: 34%;
        }
        .searchInputElement{
            width: 66%;
        }
        .labelDiv{
            padding-top:4%;
        }
        /**查询按钮组*/
        .btnsDiv{
            padding-top:10px;
            height:30px;
            text-align: right;
            margin-right: 25px;
        }
        .btns{
            margin-left: 1%;
        }
        /**表格div*/
        .tableDiv{
            margin-left:1%;
        }
        /***模态1*/
        .line1{
            float:left;
            width:1px;
            height:100%;
            background: darkgray;
        }
        .addTypeDiv{
            margin:2%;
        }
        .typeDiv{
            margin-top:15%;
        }
        .typeDiv1{
            padding-top:10%;
        }
        .typeLabelDiv{
            text-align: right;
            width:30%;
        }
        .typeInputDiv{
            width:50%;
        }
        /*分类保存删除组合按钮*/
        .typeBtnDiv{
            padding-top: 17%;
            margin-left: 27%;
        }
        .typeBtn{
            margin-left: 16%;
        }
        /*模态框头*/
        .modal-header{
            background-color: #199ED8;
            text-align: center;
        }
    </style>
</head>
<body>
<input type="hidden" id="checks">
<div class="main">
    <div class="headDiv">
        <div class="headSpanDiv">
            <span class="headspan">
                原因及批注模板
            </span>
        </div>
    </div>
    <div class="mainDiv">
        <!--搜索区-->
        <div class="searchDiv">
            <input type="hidden" id="treeId">
            <form id="searchForm">
                <div class="searchInput left">
                    <div class="searchElement left">
                        <label class="labelDiv">类别：</label>
                    </div>
                    <div class="searchInputElement left">
                        <input type="text" class="form-control input-sm" id="searchTypeName" maxlength="25">
                    </div>
                </div>
                <div class="searchInput left">
                    <div class="searchElement left">
                        <label class="labelDiv">内容：</label>
                    </div>
                    <div class="searchInputElement left">
                        <input type="text" class="form-control input-sm" id="searchContent" maxlength="500">
                    </div>
                </div>
                <div class="searchInput left">
                    <div class="searchElement left">
                        <label class="labelDiv">创建人：</label>
                    </div>
                    <div class="searchInputElement left">
                        <input type="text" class="form-control input-sm" id="creater" maxlength="16">
                    </div>
                </div>
                <div class="searchInput left">
                    <div class="searchElement left">
                        <label class="labelDiv">有效否：</label>
                    </div>
                    <div class="searchInputElement left">
                        <select class="form-control input-sm" id="searchEffective">
                            <option value="">请选择</option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                </div>
                <div class="left" style="margin-left: 10px">
                    <button type="button" class="btn btn-sm btn-primary" onclick="refreshTable()">查询</button>
                </div>
            </form>
        </div>
        <div class="btnsDiv">
        <shiro:hasPermission name="/annotationTemplate/addAnoType">
            <button type="button" class="btn btn-sm btn-info btns"  data-toggle="modal" data-target="#myModal1">类别管理</button>
        </shiro:hasPermission>
        <shiro:hasPermission name="/annotationTemplate/addAnno">
            <button type="button" class="btn btn-sm btn-warning btns" onclick="addAnnoType()" data-toggle="modal" data-target="#myModal2">  +  增加</button>
        </shiro:hasPermission>
        <shiro:hasPermission name="/annotationTemplate/exportExcel">
            <button type="button" class="btn btn-sm btn-primary btns" onclick="exportExcel()"><i class="fa fa-reply"></i>导出</button>
        </shiro:hasPermission>
        </div>
        <!--表格-->
        <div id="tableDiv" class="tableDiv">
            <table id="mytab" class="table text-nowrap table-bordered">
            </table>
        </div>
    </div>
</div>
    <!-- 模态框1（Modal）类别 -->
    <div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content" style="width:120%">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        <font size="30">&times;</font>
                    </button>
                    <h4 class="modal-title" style="font-weight: bold">
                        类别信息
                    </h4>
                </div>
                <div class="modal-body" style="height:60%">
                    <div class="treeDiv left"  style="width:29%;height:100%">
                        <input type="text" id="key" value="" class="form-control input-sm"
                               placeholder="类别名称" style="width:90%" maxlength="25"/><br/>
                        <div class="zTreeDemo">
                            <ul id="ztree" class="ztree"></ul>
                        </div>
                    </div>
                    <div class="line1"></div>
                    <div class="contentDiv left" style="width:70%;height:100%">
                        <div class="addTypeDiv">
                            <button type="button" class="btn btn-sm btn-primary right" onclick="resetAnnoType()">添加</button>
                        </div>
                        <input type="hidden" id="level">
                        <form id="form1">
                            <div id="annoTypeDiv" style="display: none">
                                <input type="hidden" id="annoTypeId" name="id">
                                <input type="hidden" name="parentId" id="typeParentId">
                                <input type="hidden" id="childNode">

                                <div class="typeDiv" id="typeDiv">
                                    <div class="typeLabelDiv left">
                                        <label class="labelDiv">类别标志：</label>
                                    </div>
                                    <div class="typeInputDiv left">
                                        <input type="text" id="typeFlag" name="typeFlag" class="form-control input-sm" maxlength="15">
                                    </div>
                                </div>
                                <div class="typeDiv1">
                                    <div class="typeLabelDiv left">
                                        <label class="labelDiv">类别名称：</label>
                                    </div>
                                    <div class="typeInputDiv left">
                                        <input type="text" class="form-control input-sm" name="typeName" id="typeName" maxlength="25">
                                    </div>
                                </div>
                                <div class="typeDiv1">
                                    <div class="typeLabelDiv left">
                                        <label class="labelDiv">有效否：</label>
                                    </div>
                                    <div class="typeInputDiv left">
                                        <select class="form-control input-sm" id="effective" name="effective">
                                            <option value="1">是</option>
                                            <option value="0">否</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="typeBtnDiv" id="typeBtnDiv">
                                    <shiro:hasPermission name="/annotationTemplate/addAnoType">
                                        <button type="button" class="btn btn-sm btn-primary typeBtn left" onclick="saveAnoType()">保存</button>
                                    </shiro:hasPermission>
                                    <shiro:hasPermission name="/annotationTemplate/updateAnoType">
                                        <button type="button" class="btn btn-sm btn-danger typeBtn left" onclick="deleteAnoType()">删除</button>
                                    </shiro:hasPermission>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 模态框2（Modal）增加 -->
    <div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabe2" aria-hidden="true">
        <input type="hidden" id="contentIsNullOption">
        <div class="modal-dialog">
            <div class="modal-content" style="width:80%">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        <font size="30">&times;</font>
                    </button>
                    <h4 class="modal-title" style="font-weight: bold">
                        模板内容
                    </h4>
                </div>
                <div class="modal-body" style="height:40%">
                    <form class="form-horizontal" id="form2">
                        <input type="hidden" id="typeId" name="id">
                        <div class="row">
                            <div class="form-group">
                                <label class="col-sm-4 control-label">类别：</label>
                                <div class="col-sm-7">
                                    <select class="form-control input-sm input" id="parentId" name="parentId">
                                    </select>
                                </div>
                                <div class="col-sm-1"></div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="form-group">
                                <label class="col-sm-4 control-label">内容：</label>
                                <div class="col-sm-7">
                                    <textarea class="form-control input-sm input" id="content" name="content" maxlength="500"></textarea>
                                </div>
                                <div class="col-sm-1"></div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="form-group">
                                <label class="col-sm-4 control-label">有效否：</label>
                                <div class="col-sm-7">
                                    <select class="form-control input-sm input"  name="effective" id="effective1">
                                        <option value="1">是</option>
                                        <option value="0">否</option>
                                    </select>
                                </div>
                                <div class="col-sm-1"></div>
                            </div>
                        </div>
                        <div style="text-align: center">
                            <shiro:hasPermission name="/annotationTemplate/addAnno">
                                <button type="button" class="btn btn-sm typeBtn btn-primary" onclick="saveAnno()">保存</button>
                            </shiro:hasPermission>
                            <button type="button" class="btn btn-sm typeBtn btn-default" onclick="clearAnno()">清空</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <script src="${path}/static/js/approveManage/annotationTemplate/annotationTemplateList.js?t=1"></script>
</body>
</html>
