<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>职级类型管理</title>
	<meta name="decorator" content="default"/>
    <%@include file="/webpage/include/treetable.jsp" %>
    <script type="text/javascript">
        $(document).ready(function() {
            $("#treeTable").treeTable({expandLevel : 5},{ expandable: true });
        });
    </script>
    <style>
        body{
            background-color:transparent;
            filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
            color:#ffffff;
            background-color:rgba(255,255,255,0);
            height:100%;
        }
    </style>
</head>
<body >
<div class="wrapper wrapper-content">
    <sys:message content="${message}"/>
    <div class="layui-row">
        <div class="full-width fl">
            <div class="contentShadow layui-row" id="queryDiv">
            <form:form id="searchForm" modelAttribute="workJobGrade" action="${ctx}/workjobgrade/workJobGrade/" method="post" class="form-inline">
                <div class="commonQuery">
                    <div class="layui-item query athird">
                        <label class="layui-form-label">职级名称：</label>
                        <div class="layui-input-block with-icon">
                            <form:input path="name" htmlEscape="false" class=" form-control layui-input"></form:input>
                        </div>
                    </div>
                    <div class="layui-item query athird">
                        <label class="layui-form-label">类型编号：</label>
                        <div class="layui-input-block">
                            <form:input path="no" htmlEscape="false" class=" form-control layui-input"></form:input>
                        </div>
                    </div>
                    <div class="layui-item athird">
                        <div class="input-group">
                            <button id="searchReset" style="margin-right: 10px;" class="fixed-btn searchReset fr" onclick="resetSearch()">重置</button>
                            <button id="searchQuery" class="fixed-btn searchQuery fr" onclick="search()">查询</button>
                        </div>
                    </div>
                    <div style="    clear:both;"></div>
                </div>
            </form:form>
            </div>
        </div>
        <div class="full-width fl">
            <div class="contentShadow layui-form contentDetails">
                <div class="nav-btns">
                    <shiro:hasPermission name="workjobgrade:workJobGrade:add">
                        <table:addRow url="${ctx}/workjobgrade/workJobGrade/form" title="职级类型"></table:addRow><!-- 增加按钮 -->
                    </shiro:hasPermission>
                    <button class="nav-btn nav-btn-refresh" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"><i class="glyphicon glyphicon-repeat"></i>&nbsp;刷新</button>
                    <div style="clear: both;"></div>
                </div>

                <!-- 表格 -->
                <table id="treeTable" class="table table-bordered table-hover list-table">
                    <thead>
                    <tr>
                        <th width="20%">类型编号</th>
                        <th width="20%">职级名称</th>
                        <th width="20%">父节点</th>
                        <th width="20%">禁用状态</th>
                        <th width="20%">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach items="${list}" var="workJobGrade">
                        <tr id="${workJobGrade.id}" pid="${workJobGrade.parent.id}">
                            <td>
                                    ${workJobGrade.no}
                            </td>
                            <td style="text-align: center">
                                <a  href="#" onclick="openDialogView('查看职级类型', '${ctx}/workjobgrade/workJobGrade/view?id=${workJobGrade.id}','95%', '95%')">
                                        ${workJobGrade.name}
                                </a>
                            </td>
                            <td style="text-align: center">
                                    ${workJobGrade.parent.name}
                            </td>
                            <td style="text-align: center">
                                    ${workJobGrade.state}
                            </td>
                            <td class="op-td text-center">
                                <div class="op-btn-box">
                                        <a href="#" onclick="openDialogView('查看职级类型', '${ctx}/workjobgrade/workJobGrade/view?id=${workJobGrade.id}','95%', '95%')" class="op-btn op-btn-view" ><i class="fa fa-search-plus"></i> 查看</a>
                                    <shiro:hasPermission name="workjobgrade:workJobGrade:edit">
                                        <a href="#" onclick="openDialog('修改职级类型', '${ctx}/workjobgrade/workJobGrade/form?id=${workJobGrade.id}','95%', '95%')" class="btn btn-success btn-xs" ><i class="fa fa-edit"></i> 修改</a>
                                        <c:if test="${workJobGrade.parentId != '0'}">
                                            <c:if test="${workJobGrade.state eq '启用'}">
                                                <a href="javascript:location.href='${ctx}/workjobgrade/workJobGrade/change?id=${workJobGrade.id}&state='+encodeURIComponent('${workJobGrade.state}');" onclick="return confirmx('确认要移除该职级类型吗？', this.href)"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 移除</a>
                                            </c:if>
                                            <c:if test="${workJobGrade.state eq '禁用'}">
                                                <a href="javascript:location.href='${ctx}/workjobgrade/workJobGrade/change?id=${workJobGrade.id}&state='+encodeURIComponent('${workJobGrade.state}');" onclick="return confirmx('确认要恢复该职级类型吗？', this.href)"   class="op-btn op-btn-submit"><i class="fa fa-undo"></i> 恢复</a>
                                            </c:if>
                                        </c:if>
                                    </shiro:hasPermission>
                                </div>
                            </td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>

                <!-- 分页代码 -->
                <%--<table:page page="${page}"></table:page>--%>

            </div>
        </div>
    </div>
</div>
<script>
    resizeListWindow1();
    $(window).resize(function(){
        resizeListWindow1();
    });
</script>
</body>
</html>