<div class="row">
	<div class="col-lg-12">
		<h1 class="site-h1">
			对话列表
			<div style="clefloat:right;">
				<div class="layui-btn-group">
					<a href="/agent/index.html?sort=lastmessage" style="<#if sort?? && sort == "lastmessage">color:#ffffff !important;</#if>">
					  <button class="layui-btn layui-btn-primary layui-btn-small" style="<#if sort?? && sort == "lastmessage">color:#ffffff !important;<#else>background-color:#ffffff !important;color:#32c24d  !important;</#if>">
					    	消息
					  </button>
				  </a>
				  <a href="/agent/index.html?sort=logintime" style="<#if sort?? && sort == "logintime">color:#ffffff !important;</#if>">
					  <button class="layui-btn layui-btn-primary layui-btn-small" style="<#if sort?? && sort == "logintime">color:#ffffff !important;<#else>background-color:#ffffff !important;color:#32c24d  !important;</#if>">
					 	接入
					  </button>
				  </a>
				  <a href="/agent/index.html?sort=default" style="<#if !sort?? || sort == "default">color:#ffffff !important;</#if>">
				  <button class="layui-btn layui-btn-primary layui-btn-small" style="<#if !sort?? || sort == "default">color:#ffffff !important;<#else>background-color:#ffffff !important;color:#32c24d  !important;</#if>">
				  	默认
				  </button>
				  </a>
				  <a href="/agent/clean.html" data-toggle="tip" data-title="清理对话列表将会删除已结束对话，请确认是否清理？">
					  <button class="layui-btn layui-btn-primary layui-btn-small" style="background-color:#ffffff !important;color:#32c24d  !important;">
					  	<i class="layui-icon" style="font-size:22px;color:red;">&#xe640;</i>
					  </button>
				  </a>	
				</div>
				
			</div>
		</h1>
		<ul class="dialog-list" id="chat_users">
			<#if agentUserList??>
			<#list agentUserList as agentuser>
			<li class="clearfix chat-list-item <#if curagentuser?? && curagentuser.id?? && agentuser.id?? && curagentuser.id == agentuser.id>active</#if>"
				id="agentuser_${agentuser.userid!''}" remove-id="${agentuser.id!''}" data-id="${agentuser.userid!''}">
				<a href="/agent/agentuser.html?id=${agentuser.id!''}&channel=${agentuser.channel!''}" data-toggle="load" data-target="#ukefu-chat-agent" onclick="$('.chat-list-item.active').removeClass('active');$(this).closest('li.chat-list-item').addClass('active');cleanTopMsgTip(this) ;$('#last_msg_${agentuser.userid!''}').text(0).hide();">
					<img src="<#if agentuser.headimgurl?? && agentuser.headimgurl != ''>${agentuser.headimgurl}<#else>/images/im/user.png</#if>" style="width:45px;height:45px;">
                    <#if agentuser.status?? && agentuser.status == 'end'>
                        <#if agentuser.channel?? && agentuser.channel == "weixin">
                        <i class="kfont ukefu-channel-icon-end" id="tip_icon_wenxin_${agentuser.userid!''}">&#xe64d;</i>
                        <#elseif agentuser.channel?? && agentuser.channel == "webim">
                        <i class="kfont ukefu-channel-icon-end" id="tip_icon_webim_${agentuser.userid!''}">&#xe60d;</i>
						<#elseif agentuser.channel?? && agentuser.channel == "skype">
						<i class="csfont ukefu-channel-icon-end" id="tip_icon_skype_${agentuser.userid!''}">&#59404;</i>
						<#elseif agentuser.channel?? && agentuser.channel == "phone">
                        <img class="ukefu-channel-image" src="/images/cde-ico-gray.png" id="tip_icon_phone_${agentuser.userid!''}">
                        </#if>
                    <#else>
                        <#if agentuser.channel?? && agentuser.channel == "weixin">
                        <i class="kfont ukefu-channel-icon" id="tip_icon_wenxin_${agentuser.userid!''}">&#xe64d;</i>
                        <#elseif agentuser.channel?? && agentuser.channel == "webim">
                        <i class="kfont ukefu-channel-icon" id="tip_icon_webim_${agentuser.userid!''}">&#xe60d;</i>
						<#elseif agentuser.channel?? && agentuser.channel == "skype">
						<i class="csfont ukefu-channel-icon" id="tip_icon_skype_${agentuser.userid!''}">&#59404;</i>
                        <#elseif agentuser.channel?? && agentuser.channel == "phone">
                        <img class="ukefu-channel-image" src="/images/phone-ico.png" id="tip_icon_phone_${agentuser.userid!''}">
                        </#if>
                    </#if>
					<div class="dialog-info">
						<div class="address">
							<span style="width:90px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap: break-word;
word-break: break-all;">${agentuser.username!''}</span>
						</div>
						<div class="news">
							<#if agentUser.servicetime??>${agentuser.servicetime?string('yyyy-MM-dd HH:mm:ss')}<#else>${agentuser.servicetime?string('yyyy-MM-dd HH:mm:ss')}</#if>
							<#if agentuser.status?? && agentuser.status == 'end'>
								<small class="label bg-gray pull-right" id="tip_message_${agentuser.userid!''}">离开</small>
							<#else>
								<small class="label bg-green pull-right" id="tip_message_${agentuser.userid!''}">在线</small>
							</#if>
							
						</div>
					</div>
					<div class="last-msg">
						<small class="ukefu-badge bg-red" id="last_msg_${agentuser.userid!''}" style="<#if agentuser.tokenum == 0 || (curagentuser?? && curagentuser.id == agentuser.id)>display:none;</#if>">${agentuser.tokenum!0}</small>
					</div>
				</a>
			</li>
			</#list>
			</#if>
		</ul>
	</div>
</div>