<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ 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 " >
        <thead>
        <tr>
            <th>序号</th>
            <th>信息资源申请名称</th>
            <th>信息资源申请部门</th>
            <th>申请时间</th>
            <th class="hidden-print">操 作</th>
</tr>
</thead>
<tbody>
<c:choose>
    <c:when test="${list!=null}">
        <c:forEach items="${list}" var="item" varStatus="status">
            <tr style="" >
                <td>${(pager.pageNo-1)*pager.pageSize+status.count}</td>
               <%-- <td style="max-width:150px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="${item.catelogType}">${item.catelogType}</td>
                <td style="max-width:150px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="${item.catelogName}">${item.catelogName}</td>
                <td>${item.dataCode}</td>--%>
                <td>${item.dataName}</td>
                <td>${item.sectorName}</td>
               <%-- <td>${item.dataSummary}</td>--%>
               <%-- <td>${item.dataSourceTypeString}</td>--%>
                <td><fmt:formatDate value="${item.applyTime}" pattern="yyyy-mm-dd" ></fmt:formatDate></td>
               <%-- <td>${item.itemName}</td>--%>
                <td class="btn-table hidden-print" style="width: 220px">
                   <%-- <input type="hidden" name="supplierId" value="${item.supplier}" />--%>
                    <input type="hidden" name="id" value="${item.id}" />
                   <%-- <input type="hidden" name="supplierDeptid" value="${item.supplierDept}" />--%>
                  <%--  <button name="btnDetail" class="btn btn-sm btn-info m-r-sm"><i class="fa fa-leaf"></i>订阅</button>--%>
                    <button name="btnDownload"class="btn btn-sm btn-primary m-r-sm" ><i class="fa fa-edit"></i>通过</button>
                    <button name="btnSubcribe" class="btn btn-sm btn-danger"><i class="fa fa-leaf"></i>不通过</button>
                </td>
            </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">

    $("#divGrid table tbody tr td:last-child")
        .on("click", "button[name='btnDownload']", function () {
          /*  var supplierId = $(this).parent().children("input[type='hidden'][name='supplierId']").val();
            var dataCatelogId = $(this).parent().children("input[type='hidden'][name='dataCatelogId']").val();*/
            var id = $(this).parent().children("input[type='hidden'][name='id']").val();
            $.functionWithConfirm({ func: $.ajaxGetRefresh, funcArgs: { ajaxGetOptions: { url: "<%=basePath%>/admin/subscribeAndDownload/audit.do/" + id +"/1"} } });
        })
        .on("click", "button[name='btnSubcribe']", function() {
           /* var supplierId = $(this).parent().children("input[type='hidden'][name='supplierId']").val();
            var dataCatelogId = $(this).parent().children("input[type='hidden'][name='dataCatelogId']").val();*/
            var id = $(this).parent().children("input[type='hidden'][name='id']").val();
            $.functionWithConfirm({ func: $.ajaxGetRefresh, funcArgs: { ajaxGetOptions: { url: "<%=basePath%>/admin/subscribeAndDownload/audit.do/" + id+"/0" } } });
        })
        .on("click", "button[name='btnEdit']", function () {
            var id = $(this).parent().children("input[type='hidden'][name='id']").val();
            window.location.href="<%=basePath%>/admin/datacatelog_mgr/edit.htm/"+id;
        });

</script>