<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ page import="com.lightinit.hsdataplatform.dictionary.DicLeaveMessageState"%>
<%@ page isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
    String basePath = request.getContextPath();
%>
<div class="table-responsive">
    <table class="table table-striped table-bordered table-hover " id="tablesOrder"  >
        <thead>
        <tr>
            <th>序号</th>
            <th>监控类型</th>
            <th>日志时间</th>
            <th>标题</th>
            <th>描述</th>
            <th>创建时间</th>
            <th class="hidden-print">操 作</th>
        </tr>
        </thead>
        <tbody>
        <c:choose>
            <c:when test="${outputModel!=null}">
                <c:forEach items="${outputModel}" var="item" varStatus="status">
                    <tr>
                        <td>${(pager.pageNo-1)*(pager.pageSize)+status.count}</td>
                        <td>${item.monitoringType}</td>
                        <td><fmt:formatDate value="${item.logTime}" pattern="yyyy-MM-dd"></fmt:formatDate></td>
                        <td>${item.title}</td>
                        <td <%--title="${item.description}"--%>>${item.description==null?'无描述':(item.description.length()<=50?item.description:item.description.substring(0,50))}${item.description.length()>50?'...':''}</td>
                        <td><fmt:formatDate value="${item.createdAt}" pattern="yyyy-MM-dd"></fmt:formatDate></td>
                        <td>
                           <%-- <c:if test="${item.msgState==DicLeaveMessageState.WATING}"><a href="javascript:void(0);"  onclick="fnEdit(this)">编辑</a></c:if>
                            <c:if test="${item.msgState==DicLeaveMessageState.DONE}"><a href="javascript:void(0);"  onclick="fnShowDetail(this)">查看</a></c:if>
                            &nbsp;&nbsp;|&nbsp;&nbsp;<a href="javascript:void(0);"  onclick="fnDel(this)">删除</a>--%>
                            <a href="javascript:void(0);"  onclick="fnShowDetail(this)">查看</a>
                        </td>
                        <input  type="hidden" id="id" value="${item.id}"/>
                    </tr>
                </c:forEach>
            </c:when>
            <c:otherwise>
                <tr>
                    <td colspan="4">无数据</td>
                </tr>
            </c:otherwise>
        </c:choose>
        </tbody>
    </table>
</div>
<jsp:include page="../../../common/admin/pager.jsp">
    <jsp:param name="pageNo" value="${pager.pageNo}"/>
    <jsp:param name="pageSize" value="${pager.pageSize}"/>
    <jsp:param name="total" value="${pager.total}"/>
</jsp:include>
<script type="text/javascript">
    //修改
    function fnEdit(tr){
        $.popBsPartial({ url: "<%=basePath%>/admin/leavemessage_mgr/edit.htm/"+ $(tr).parent().next().val()});
    }

    //删除
    function fnDel(tr){
        $.delWithConfirm({ func: $.ajaxGetRefresh, funcArgs: { ajaxGetOptions: { url: "<%=basePath%>/admin/leavemessage_mgr/delete.action/" + $(tr).parent().next().val() } } });
    }

  //显示详情
    function fnShowDetail(tr){
        $.popBsPartial({ url: "<%=basePath%>/admin/loggerMoniter/detail.htm/" + $(tr).parent().next().val(),size:WySharpSize.Large });
    }

</script>
