<%@ 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 : 2},{ 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="workExampleIndices" action="${ctx}/workexample/workExampleIndices/" 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">
							</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">
					<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="40%">指标名称</th>
						<th  >排序</th>
						<th >禁用状态</th>
						<th width="240px">操作</th>
					</tr>
					</thead>
					<c:choose>
						<c:when test="${not empty list}">
							<c:forEach items="${list}" var="workExampleIndices">
								<tr id="${workExampleIndices.id}" pid="${workExampleIndices.parent.id}">
									<td><a  href="#" onclick="openDialogView('查看指标项目', '${ctx}/workexample/workExampleIndices/form?id=${workExampleIndices.id}&view=view','60%', '60%')">
											${workExampleIndices.name}
									</a></td>
									<td style="text-align: center">
											${workExampleIndices.orderNum}
									</td>
									<td style="text-align: center">
											${fns:getDictLabel(workExampleIndices.isDisable, 'is_disable', '')}
									</td>
									<td class="op-td text-center">
										<div class="op-btn-box">
											<a href="javascript:void(0);" onclick="openDialog('修改', '${ctx}/workexample/workExampleIndices/form?id=${workExampleIndices.id}&view=edit','60%','60%')" class="op-btn op-btn-edit"><i class="fa fa-edit"></i> 修改</a>
											<c:choose>
												<c:when test="${workExampleIndices.type eq 2 || workExampleIndices.type eq 3}">
													<a href="javascript:void(0);" onclick="openDialog('添加指标项', '${ctx}/workexample/workExampleIndices/form?id=${workExampleIndices.id}&view=save','60%','60%')" class="op-btn op-btn-add"><i class="fa fa-plus"></i> 添加指标</a>
												</c:when>
												<c:when test="${workExampleIndices.type < 8}">
													<a href="javascript:void(0);" onclick="openDialog('添加指标项', '${ctx}/workexample/workExampleIndices/form?id=${workExampleIndices.id}&view=save','60%','60%')" class="op-btn op-btn-add"><i class="fa fa-plus"></i> 添加项</a>
												</c:when>
												<c:otherwise></c:otherwise>
											</c:choose>
											<c:choose>
												<c:when test="${workExampleIndices.isDisable ne 0}">
													<a href="${ctx}/workexample/workExampleIndices/delete?id=${workExampleIndices.id}&status=0" onclick="return confirmx('确认要启用该指标项目及其子指标项目吗？', this.href)"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 启用</a>
												</c:when>
												<c:otherwise>
													<a href="${ctx}/workexample/workExampleIndices/delete?id=${workExampleIndices.id}&status=1" onclick="return confirmx('确认要禁用该指标项目及其子指标项目吗？', this.href)"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 禁用</a>
												</c:otherwise>
											</c:choose>
										</div>
									</td>
								</tr>
							</c:forEach>
						</c:when>
						<c:otherwise>
							<tr>
								<td colspan="4" align="center">暂无数据</td>
							</tr>
						</c:otherwise>
					</c:choose>

					</tbody>
				</table>

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

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