<%@ 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>申请时间</th>
            <th>状态</th>
            <th class="hidden-print">操 作</th>
        </tr>
        </thead>
        <tbody>
        <c:choose>
            <c:when test="${list!=null}">
                <c:forEach items="${list}" var="item">
                    <tr>
                        <td>
                            <a href="#" onclick="authorizationView(${item.id})"> ${item.platfromType}</a>
                        </td>
                        <td>${item.resourceName}</td>
                        <td>${item.resourceType}</td>
                        <td>${item.openOrShare}</td>
                        <td><fmt:formatDate value="${item.applyTime}" pattern="yyyy-MM-dd"/></td>
                        <td>${item.authState}</td>
                        <td class="btn-table hidden-print">
                            <input type="hidden" name="id" value="${item.id}"/>
                                    <c:if test="${item.authState==state}">
                                    <button  onclick="btnAuthorization(${item.id} ,'${item.platfromType}','${item.outId1}',${item.applier})" class="btn btn-sm btn-primary m-r-sm"><i
                                            class="fa fa-edit"></i>授权
                                    </button>
                                    </c:if>
                            <c:if test="${item.authState!=state}">
                                <span>----</span>
                            </c:if>
                        </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">
        function authorizationView(id) {
            $.popBsPartial({url: "<%=basePath%>/admin/authorization/view.htm/" + id});
        }

        function btnAuthorization(id,platfromType,outId1,applier) {
            $.popBsPartial({url: "<%=basePath%>/admin/authorization/handle.htm/" + id+"?platfromType="+platfromType+"&outId1="+outId1+"&applier="+applier});
        }
</script>