<%--
  Created by IntelliJ IDEA.
  User: xuan
  Date: 2021/11/5
  Time: 13:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page pageEncoding="UTF-8" %>
<%@ include file="../common/common.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
<head>
    <title>分流检测记录</title>
</head>
<body>
<div class="page_container">
    <div class="page_head">
        <h3>通道分流告警记录</h3>
        <div class="breadcrumb">
            <a href="#">首页</a> > <a href="#">监控管理</a> > 通道分流告警记录
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12">
            <div class="panel">
                <form id="white" action="${basepage}/paList/channelTestRecord.html" method="post">
                    <div class="table_operate" style="margin-bottom: 0;">
                        <div class="query_item">
                            <label>ID：</label>
                            <input id="id" name="id" type="text" value="${params.id}" class="form_control form_white">
                        </div>
                        <div class="query_item">
                            <label>创建时间：</label>
                            <input id="d12" name="startTime" type="text" value="${params.startTime}"
                                   class="Wdate form_control form_white1" type="text"
                                   onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'d13\')||\'%y-%M-%d\'}',dateFmt:'yyyy-MM-dd',isShowClear:false,readOnly:true})"/>-
                            <input id="d13" name="endTime" type="text" value="${params.endTime}"
                                   class="Wdate form_control form_white1" type="text"
                                   onfocus="WdatePicker({minDate:'#F{$dp.$D(\'d12\',{d:0});}',maxDate:'%y-%M-%d',dateFmt:'yyyy-MM-dd',isShowClear:false,readOnly:true})"/>
                        </div>
                        <div class="query_item">
                            <label>任务类型:</label>
                            <select id="type" name="type" class="singleSelect" style="width: 150px;">
                                <option value="">--请选择--</option>
                                <option <c:if test="${params.type == 1}">selected</c:if> value="1">分流检测</option>
                                <option <c:if test="${params.type == 2}">selected</c:if> value="2">历史检测</option>
                            </select>
                        </div>
                        <button type="submit" class="btn btn_orange btn_icon">
                            <span class="ico_16px ico_search"></span><span>查询</span>
                        </button>

                        <div class="query_item" >
                            <a class="btn btn_green" href="${basepage}/paList/channelTest.html">修改配置</a>
                        </div>
                    </div>

                    <div class="table_wrap">
                        <table class="datatable">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>任务ID</th>
                                <th>发送时间</th>
                                <th>是否异常</th>
                                <th>是否已检测</th>
                                <th>异常号码</th>
                                <th>检测时间</th>
                                <th>通道ID</th>
                                <th>检测类型</th>
                                <th class="align_c">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <c:choose>
                                <c:when test="${not empty list}">
                                    <c:forEach items="${list}" var="item" varStatus="vs">
                                        <tr align="center">
                                            <td>${item.id}</td>
                                            <td>${item.taskId }</td>
                                            <td>${item.sendTime}</td>
                                            <td>${item.status == 1 ? '有异常': '无异常'}</td>
                                            <td>${item.isCheck == 1 ? '已检测': '未检测'}</td>
                                            <td>${item.errorPhones}</td>
                                            <td>${item.checkTime}</td>
                                            <td>${item.channelId}</td>
                                            <td>${item.type == 1 ? '分流检测': '历史检测'}</td>
                                            <td class="align_c">
                                                <c:if test="${fn:startsWith(item.errorPhones, 'file:')}">
                                                    <a class="btn btn_small btn_blue" onclick="showDetail('${item.errorPhones}', '${item.type}');">查看详情</a>
                                                </c:if>
                                            </td>

                                        </tr>
                                    </c:forEach>
                                </c:when>
                                <c:otherwise>
                                    <tr class="pagination_info" align="center">
                                        <td colspan="9">没有相关数据</td>
                                    </tr>
                                </c:otherwise>
                            </c:choose>
                            </tbody>
                            <tfoot>
                            <tr>
                                <td>${params.page.pageStr}</td>
                            </tr>
                            </tfoot>
                        </table>
                    </div>

                </form>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    $(function(){
        $('.singleSelect').select2();
    });

    function showDetail(path, type) {
        Dialog.ajaxOpen('${basepage}/paList/showReduceAlarmDetail.html?path=' + path + "&type=" + type,'历史检测告警详情')
    }
</script>
</html>
