<%@page import="com.cpic.icc.system.model.SysUser"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/include/taglib.jsp" %>
<ul id="accordion" class="accordion">
	<hna:permission privilege="sysUserRole.view">
		<li>
			<div class="link"><i class="icon fa-user"></i>权限管理<i class="fa fa-chevron-down"></i></div>
			<ul class="submenu">
				<hna:permission privilege="sysUser">
					<li><a href="${ctx}/sysUser/list.do">用户管理</a></li>
				</hna:permission>
				<hna:permission privilege="sysRole">
					<li><a href="${ctx}/sysRole/list.do">角色管理</a></li>	
				</hna:permission>
				<hna:permission privilege="sysAuthority">
					<li><a href="${ctx}/sysAuthority/list.do">权限管理</a></li>
				</hna:permission>
			</ul>
		</li>
	</hna:permission>
	<!-- <hna:permission privilege="sysUser.view">
		<li>
			<div class="link"><i class="icon fa-user"></i>用户管理<i class="fa fa-chevron-down"></i></div>
			<ul class="submenu">	
				<li><a href="${ctx}/sysUser/list.do">用户管理</a></li>	
			</ul>
		</li>
	</hna:permission>
	<hna:permission privilege="sysRole.view">
		<li>
			<div class="link"><i class="icon fa-role"></i>角色管理<i class="fa fa-chevron-down"></i></div>
			<ul class="submenu">
				<li><a href="${ctx}/sysRole/list.do">角色管理</a></li>
			</ul>
		</li>
	</hna:permission>
	<hna:permission privilege="sysAuthority.view">
		<li>
			<div class="link"><i class="icon fa-permission"></i>权限管理<i class="fa fa-chevron-down"></i></div>
			<ul class="submenu">
				<li><a href="${ctx}/sysAuthority/list.do">权限管理</a></li>
			</ul>
		</li>
	</hna:permission> -->
	<hna:permission privilege="sysLog.view">
		<li>
			<div class="link"><i class="icon fa-log"></i>日志查看<i class="fa fa-chevron-down"></i></div>
			<ul class="submenu">
				<li><a href="${ctx}/sysLog/list.do">日志查看</a></li>
			</ul>
		</li>
	</hna:permission>
	<hna:permission privilege="system.manage">
		<li>
			<div class="link"><i class="icon fa-task"></i>系统管理<i class="fa fa-chevron-down"></i></div>
			<ul class="submenu">
				<hna:permission privilege="sysTask.issuing">
					<li><a href="${ctx}/sysTask/list.do">任务管理</a></li>
				</hna:permission>
				<hna:permission privilege="sysTask.para">
					<li><a href="${ctx}/sysPara/taskApplyPara.do">个人申请</a></li>
					<li><a href="${ctx}/sysPara/modelPara.do">专项模型</a></li>
					<li><a href="${ctx}/sysPara/M6Para.do">M6发起</a></li>
					<li><a href="${ctx}/sysPara/dpPara.do">大屏开关</a></li>
					<li><a href="${ctx}/sysPara/rolePara.do">默认角色</a></li>
					<li><a href="${ctx}/sysPara/machinePara.do">机器学习</a></li>
				</hna:permission>
				<hna:permission privilege="sysPara.codeLibrary">
					<li><a href="${ctx}/sysPara/codeLibrary.do">codeLibrary</a></li>
				</hna:permission>
				<hna:permission privilege="sysModel.importModel">
					<li><a href="${ctx}/sysTaskPlus/specialImport.do">模型数据导入</a></li>
				</hna:permission>
				<hna:permission privilege="sysModel.updateStatus">
					<li><a href="${ctx}/sysTaskPlus/weaverImport.do">案件白名单</a></li>
				</hna:permission>
			</ul>
		</li>
	</hna:permission>
	<!-- <hna:permission privilege="sysTask.issuing">
	<li>
		<div class="link"><i class="icon fa-task"></i>任务管理<i class="fa fa-chevron-down"></i></div>
		<ul class="submenu">
			<li><a href="${ctx}/sysTask/list.do">任务管理</a></li>
		</ul>
	</li>
	</hna:permission>
	<hna:permission privilege="sysTask.para">
	<li>
		<div class="link"><i class="icon fa-para"></i>参数配置<i class="fa fa-chevron-down"></i></div>
		<ul class="submenu">
			<li><a href="${ctx}/sysPara/taskApplyPara.do">个人申请</a></li>
			<li><a href="${ctx}/sysPara/modelPara.do">专项模型</a></li>
			<li><a href="${ctx}/sysPara/M6Para.do">M6发起</a></li>
			<li><a href="${ctx}/sysPara/dpPara.do">大屏开关</a></li>
			<li><a href="${ctx}/sysPara/rolePara.do">默认角色</a></li>
			<hna:permission privilege="sysPara.codeLibrary">
			<li><a href="${ctx}/sysPara/codeLibrary.do">codeLibrary</a></li>
			</hna:permission>
		</ul>
	</li>
	</hna:permission>
	<hna:permission privilege="sysModel.manage"> 
	
	<li>
		
			<div class="link"><i class="icon fa-permission" style="color: #ddd;"></i>模型管理<i class="fa fa-chevron-down"></i></div>
			<ul class="submenu">
				<hna:permission privilege="sysModel.importModel">
					<li><a href="${ctx}/sysTaskPlus/specialImport.do">模型数据导入</a></li>
				</hna:permission>
				<hna:permission privilege="sysModel.updateStatus">
					<li><a href="${ctx}/sysTaskPlus/weaverImport.do">案件白名单</a></li>
				</hna:permission>
			</ul>
		
	</li>
	
	</hna:permission>  -->
</ul>
<script type="text/javascript">
	//给左列表加on
	var url = "${ctx}";3
	var on_val="${param.index}";
	$(".submenu li").each(function(i){
		if(on_val==$(this).text().trim()){
            $(".submenu").find("li").eq(i).addClass("on");
        }
	})
	$(function(){
		//左侧js
		var Accordion = function(el, multiple) {
			this.el = el || {};
			this.multiple = multiple || false;		
			// Variables privadas
			var links = this.el.find('.link');
			// Evento
			links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown);
		}		
		Accordion.prototype.dropdown = function(e) {
			var $el = e.data.el;
				$this = $(this),
				$next = $this.next();
	
			$next.slideToggle();
			$this.parent().toggleClass('open');
	
			if (!e.data.multiple) {
				$el.find('.submenu').not($next).slideUp().parent().removeClass('open');
			};
			$(".searchCon").perfectScrollbar("update");
		}			
		var accordion = new Accordion($('#accordion'), false);
		//判断是否有on存在

		if($("#accordion li").hasClass("on")){
		
			$("#accordion li.on").parent().parent().find(".link").click();
		
			
		}
	})
</script>