<ul class="layui-nav layui-nav-tree" lay-filter="demo">
	<li class="layui-nav-item <#if subtype?? && subtype == 'content'>layui-this</#if>">
		<a class="layui-nav-default" href="/admin/content.html">系统概况</a>
	</li>
	<li class="layui-nav-item layui-nav-itemed">
	<a class="layui-nav-title" 
		href="javascript:;">用户和组</a>
		<dl class="layui-nav-child">
			<#if user?? && (user.roleAuthMap["B02_B01"]?? || user.superadmin)>
			<dd  <#if subtype?? && subtype == 'user'>class="layui-this"</#if>>
				<a href="/admin/user/index.html">用户账号</a>
			</dd>
			</#if>
			<#if user?? && (user.roleAuthMap["B02_B02"]?? || user.superadmin)>
			<dd <#if subtype?? && subtype == 'role'>class="layui-this"</#if>>
				<a href="/admin/role/index.html">系统角色</a>
			</dd>
			</#if>
			<#if user?? && (user.roleAuthMap["B02_B03"]?? || user.superadmin)>
			<dd  <#if subtype?? && subtype == 'organ'>class="layui-this"</#if>>
				<a href="/admin/organ/index.html">组织机构</a>
			</dd>
			</#if>
		</dl>
	</li>
	<li class="layui-nav-item layui-nav-itemed">
		<a class="layui-nav-title" href="javascript:;">渠道管理</a>
		<dl class="layui-nav-child">
			<#if user?? && (user.roleAuthMap["B02_B04"]?? || user.superadmin)>
			<dd <#if subtype?? && (maintype == 'webim' || subtype == 'im')>class="layui-this"</#if>>
				<a href="/admin/im/index.html">网站渠道</a>
			</dd>
			</#if>

		    <#if models?seq_contains("callcenter")>
			<dd <#if subtype?? && (maintype == 'callcenter' || subtype == 'channel')>class="layui-this"</#if>>
				<a href="/admin/callcenter/index.html">呼叫中心</a>
			</dd>
            </#if>

			<#if models?seq_contains("skype")>
			<dd <#if subtype?? && (maintype == 'skype' || subtype == 'skype')>class="layui-this"</#if>>
			<a href="/admin/skype/index.html">Skype</a>
			</dd>
			</#if>
		</dl>
	</li>
	
	<#if models?seq_contains("wexin")>
	<li class="layui-nav-item layui-nav-itemed">
		<a class="layui-nav-title" href="javascript:;">微信接入</a>
		<dl class="layui-nav-child">
			<dd <#if subtype?? && subtype == 'weixin'>class="layui-this"</#if>>
				<a href="/admin/weixin/index.html">公众号配置</a>
			</dd>
			<!-- 
			<dd <#if subtype?? && subtype == 'material'>class="layui-this"</#if>>
				<a href="/admin/weixin/material.html">素材管理</a>
			</dd>
			<dd <#if subtype?? && subtype == 'interf'>class="layui-this"</#if>>
				<a href="/admin/weixin/interf.html">接口管理</a>
			</dd>
			 -->
		</dl>
	</li>
	</#if>
	<#if user.superadmin>
	<li class="layui-nav-item layui-nav-itemed">
		<a class="layui-nav-title" href="javascript:;">系统设置</a>
		<dl class="layui-nav-child">
			<dd <#if subtype?? && subtype == 'config'>class="layui-this"</#if>>
				<a href="/admin/config/index.html">系统设置</a>
			</dd>
			<dd <#if subtype?? && subtype == 'sysdic'>class="layui-this"</#if>>
				<a href="/admin/sysdic/index.html">字典管理</a>
			</dd>
			<dd <#if subtype?? && subtype == 'metadata'>class="layui-this"</#if>>
				<a href="/admin/metadata/index.html">元数据</a>
			</dd>
            <#if models?seq_contains("chatbot")>
				<#if user?? &&( user.roleAuthMap["A09"]?? || user.admin) >
					<dd>
						<a data-title="智能机器人" href="javascript:void(0)" onclick="openChatbot()" data-href="/apps/chatbot/index.html" class="iframe_btn" data-id="chatbotIntegrationWin" data-type="tabAdd">
							智能机器人
						</a>
					</dd>
				</#if>
			</#if>

			<dd <#if subtype?? && subtype == 'template'>class="layui-this"</#if>>
				<a href="/admin/template/index.html">系统模板</a>
			</dd>
			<dd <#if subtype?? && subtype == 'email'>class="layui-this"</#if>>
				
				<a href="/admin/email/index.html">邮件通知设置</a>
			</dd>
			<dd <#if subtype?? && subtype == 'sms'>class="layui-this"</#if>>
				<a href="/admin/sms/index.html">短信通知设置</a>
			</dd>
		</dl>
	</li>
	</#if>
</ul>

<script>
		function openChatbot(){
			window.parent.active.tabAdd($(".iframe_btn").data('href') , $(".iframe_btn").data('title'), $(".iframe_btn").data('id'));
		};
</script>
