<%@ 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
        }
        /**搜索框去div*/
        .searcDiv{
            margin: 10px 20px;
        }
        .form-control{
            margin: 0 auto;
            width:80%;
        }
        /**搜索标签名*/
        .labelDiv{
            padding-top:2%;
            text-align: right;
        }
        /**分页*/
        .pagination{
            margin:0!important;
        }
        /**模态框框里的按钮组*/
        .modelBtn{
            padding-left:40%;
        }
        .btns{
            margin-left:11%;
        }
        /**表格div*/
        .tableDiv{
            margin: 10px 20px;
        }
        /*模态框头*/
        .modal-header{
            background-color: #199ED8;
            text-align: center;
        }
        .col-sm-2,col-sm-5{
            padding:0!important;
        }
        .zTreeDemo {
            height: calc(100% - 70px) !important;
            min-height: 394px !important;
        }
        .main-content {
            height: calc(100vh - 43px);
        }
    </style>
</head>
<body style="background-color:#c1d7e3">
    <input type="hidden" id="powerCtx" value="${POWER_URLHEAD}">
    <input type="hidden" id="userId" value="${CURRENT_USER.userId}">
    <input type="hidden" id="userName" value="${CURRENT_USER.userName}">
    <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="16"/><br/>
                </div>
                <div class="zTreeDemo">
                    <ul id="ztree" class="ztree"></ul>
                </div>
            </div>
            <!--搜索区-->
            <div class="col-md-9 rightDiv">
                <ul class="nav nav-tabs" role="tablist">
                    <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">用户调阅配置</a></li>
                    <li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">类别管理</a></li>
                </ul>
                <div class="tab-content">
                    <div role="tabpanel" class="tab-pane fade in active" id="home">
                        <iframe style="width:100%;height:calc(100% - 43px)" frameborder="no" border="0" name="iframe" id="iframe"></iframe>
                    </div>
                    <div role="tabpanel" class="tab-pane fade" id="profile" style="height:calc(100% - 52px)">
                        <div class="row searcDiv">
                            <div class="col-sm-5">
                                <div class="form-group">
                                    <div class="col-sm-5 labelDiv">
                                        <label class="control-label">单名：</label>
                                    </div>
                                    <div class="col-sm-7 inputDiv">
                                        <select class="form-control input-sm" id="searchAssortName">
                                            <option value="">请选择</option>
                                            <c:forEach items="${assorts}" var="assort">
                                                <option value="${assort.assortName}">${assort.assortName}</option>
                                            </c:forEach>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-5">
                                <div class="form-group">
                                    <div class="col-sm-5 labelDiv">
                                        <label class="control-label">是否有效：</label>
                                    </div>
                                    <div class="col-sm-7 inputDiv">
                                        <select class="form-control input-sm" id="searchPrintFlag">
                                            <option value="">请选择</option>
                                            <option value="0">是</option>
                                            <option value="1">否</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-2">
                                <button type="button" class="btn btn-sm btn-primary" onclick="search()">查询</button>
                                <shiro:hasPermission name="/distribution/saveDistribution">
                                    <button type="button" class="btn btn-sm btn-warning" onclick="add()" data-toggle="modal" data-target="#myModal1">添加</button>
                                </shiro:hasPermission>
                            </div>
                        </div>
                        <!--数据表格-->
                        <div id="tableDiv" class="tableDiv">
                            <table id="mytab" class="table text-nowrap table-bordered">
                            </table>
                        </div>
                    </div>
                </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">
                    <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="form">
                            <input type="hidden" name="formToken" id="formToken">
                            <input type="hidden" id="assortId" name="assortId">
                            <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="assortName" id="assortName" maxlength="32">
                                    </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="assortSort" id="assortSort" oninput="if(value.length>4)value=value.slice(0,4)">
                                    </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="printFlag" id="printFlag">
                                            <option value="0">是</option>
                                            <option value="1">否</option>
                                        </select>
                                    </div>
                                    <div class="col-sm-1"></div>
                                </div>
                            </div>
                        </form>
                        <div class="modelBtn">
                            <button type="button" class="btn btn-sm btn-primary btns" onclick="saveDistribution()">保存</button>
                            <button type="button" class="btn btn-sm btn-default btns" onclick="clearForm()">清空</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        $(function () {
            $(".modal-dialog").draggable();//为模态对话框添加拖拽
        })
    </script>
    <script type="text/javascript" src="${path}/static/js/distributionManage/distributionManage.js?t=2"></script>
    <script type="text/javascript" src="${path}/static/js/distributionManage/userDistributionManage.js"></script>
    <%@ include file="/WEB-INF/jspf/loading.jspf" %>
</body>
</html>
