<%@ 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="workContentType" action="${ctx}/workcontent/workContentType/" method="post" class="form-inline">
				<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
				<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
				<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->

				<div class="commonQuery lw9">
					<div class="layui-item query athird">
						<label class="layui-form-label">内容类型编号：</label>
						<div class="layui-input-block">
							<form:input path="typeId" 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="typeName" 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: 0px;" 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="workcontent:workContentType:add">
						<table:addRow url="${ctx}/workcontent/workContentType/form" title="工作内容类型"></table:addRow><!-- 增加按钮 -->
					</shiro:hasPermission>
					<shiro:hasPermission name="workcontent:workContentType:del">
						<table:delRow url="${ctx}/workcontent/workContentType/deleteAll" id="contentTable"></table:delRow><!-- 删除按钮 -->
					</shiro:hasPermission>
					<shiro:hasPermission name="workcontent:workContentType:import">
						<table:importExcel url="${ctx}/workcontent/workContentType/import"></table:importExcel><!-- 导入按钮 -->
					</shiro:hasPermission>
					<shiro:hasPermission name="workcontent:workContentType:export">
						<table:exportExcel url="${ctx}/workcontent/workContentType/export"></table:exportExcel><!-- 导出按钮 -->
					</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="50%">内容类型名称</th>
							<th width="17%">内容类型编号</th>
							<th width="17%">状态</th>
							<th width="16^">操作</th>
						</tr>
					</thead>
					<tbody>
					<c:forEach items="${list}" var="workContentType">
						<tr  id="${workContentType.typeId}" pId="${workContentType.parentId}">
							<td><a  href="#" onclick="openDialogView('查看工作内容类型', '${ctx}/workcontent/workContentType/form?id=${workContentType.id}','95%', '95%')">
								${workContentType.typeName}</a>
							</td>
							<td style="text-align: center">
								${workContentType.typeId}
							</td>
							<td style="text-align: center">
								<c:if test="${workContentType.delFlag eq '0'}">启用</c:if>
								<c:if test="${workContentType.delFlag eq '1'}">禁用</c:if>
							</td>
							<td class="op-td text-center">
								<div class="op-btn-box">
									<shiro:hasPermission name="workcontent:workContentType:view">
										<a href="#" onclick="openDialogView('查看工作内容类型', '${ctx}/workcontent/workContentType/form?id=${workContentType.id}','95%', '95%')" class="op-btn op-btn-view" ><i class="fa fa-search-plus"></i> 查看</a>
									</shiro:hasPermission>
									<shiro:hasPermission name="workcontent:workContentType:edit">
										<c:if test="${workContentType.parentId != '0'}">
											<c:if test="${workContentType.delFlag eq '0'}">
												<a href="${ctx}/workcontent/workContentType/change?typeId=${workContentType.typeId}&delFlag=${workContentType.delFlag}" onclick="return confirmx('确认要删除该工作内容类型吗？', this.href)"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 移除</a>
											</c:if>
											<c:if test="${workContentType.delFlag eq '1'}">
												<a href="${ctx}/workcontent/workContentType/change?typeId=${workContentType.typeId}&delFlag=${workContentType.delFlag}" 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>
	
		<!-- 分页代码 -->
			</div>
		</div>
	</div>
</div>

</body>
</html>