<%@ 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" %>
<!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>
    <!--[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">
        .leftDiv{
            border-right: 10px solid #c1d7e3;
            background-color:#fff
        }
        .rightDiv{
            background-color:#fff
        }
        .addbtn{
            text-align:center
        }
        .insertbtn{
            width:60%;
            margin: 0 auto;
        }
        .searcDiv{
            margin: 10px 20px;
        }
        .form-control{
            margin: 0 auto;
            width:80%;
        }
        .control-label{
            padding-left:12%!important;
            padding-top:1%;
        }
        .input-group{
            padding-left:5%!important;
        }
        .rightContent{
            padding-left:1%;
        }
        /*模态框头*/
        .modal-header{
            background-color: #199ED8;
            text-align: center;
        }
        .main-content {
            height: calc(100vh - 43px);
        }
        .zTreeDemo {
            height: calc(100vh - 123px) !important;
            min-height: 394px !important;
        }
    </style>
</head>
<body style="background-color: #c1d7e3">
    <div class="main">
        <div class="headDiv">
            <div class="headSpanDiv">
                 <span class="headspan">自定义模板选择</span>
            </div>
        </div>
        <div class="row main-content">
            <!--树-->
            <div class="col-md-3 leftDiv">
                <div class="searcDiv">
                    <input type="text" id="key" value="" class="form-control input-sm"
                           placeholder="名称" maxlength="25"/>
                </div>
                <div class="row addbtn">
                    <shiro:hasPermission name="/template/addTemplateSelect">
                        <button type="button" id="addModle" class="btn btn-sm btn-info insertbtn" onclick="addModle()">添加</button>
                    </shiro:hasPermission>
                </div>
                <div class="zTreeDemo">
                    <ul id="ztree" class="ztree"></ul>
                </div>
            </div>
            <!--明细选项-->
            <div class="col-md-9 rightDiv">
                <div class="rightContent">
                    <iframe style="width:100%;height:100%" id="iframe" name="iframe" frameborder="no" border="0" scrolling="yes" src="${path}/template/templateSelectIframe?id=${emrModle.id}"></iframe>
                </div>
            </div>
        </div>
        <!-- 模态框1（Modal） -->
        <div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <input type="hidden" id="currentTypeId">
            <div class="modal-dialog">
                <div class="modal-content">
                    <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">
                        <form class="form-horizontal" role="form" id="addForm">
                            <input type="hidden" name="formToken" id="formToken" value="${formToken}">
                            <div class="row">
                                <div class="form-group">
                                    <label class="col-sm-4 control-label">模板标志：</label>
                                    <div class="col-sm-7">
                                        <input type="text" class="form-control input-sm input" id="modleFlagCheck" name="modleFlag" maxlength="25">
                                    </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">
                                        <input type="text" class="form-control input-sm input" name="modleName" id="modleNameCheck" maxlength="25">
                                    </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-6 input-group">
                                        <input type="text" class="form-control input-sm dateInput datepicker" name="effeTime" maxlength="10" autocomplete="off">
                                        <div class="input-group-addon">
                                            <i class="fa fa-calendar"></i>
                                        </div>
                                    </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">
                                            <option value="1">是</option>
                                            <option value="0">否</option>
                                        </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">
                                        <input type="number" class="form-control input-sm input" name="modleSort" oninput="if(value.length>9)value=value.slice(0,9)" min="0">
                                    </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" name="remark" maxlength="25"></textarea>
                                    </div>
                                    <div class="col-sm-1"></div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="form-group">
                                    <div class="col-sm-4"></div>
                                    <div class="col-sm-8">
                                        <label>
                                            <input type="radio" value="1" name="selectFlag">选中模板为当前使用
                                        </label>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">关闭
                        </button>
                        <button type="button" class="btn btn-sm btn-primary" onclick="add()">
                            提交更改
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        $(function () {
            $(".modal-dialog").draggable();//为模态对话框添加拖拽
        })
    </script>
    <script type="text/javascript" src="${path}/static/js/recordManage/templateSearch/templateSelectList.js"></script>
</body>
</html>
