<%@ page import="com.lightinit.hsdataplatformresdir.dictionary.DicAuthorizationState" %>
<%@ 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 prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
    String basePath = request.getContextPath();
%>
<jsp:include page="../../../common/admin/modal_content_pre.jsp">
    <jsp:param name="modal_title" value="授权"/>
</jsp:include>
<form id="authorizationHandle" action="<%=basePath%>/admin/authorization/handle.action" method="post" class="form-horizontal">
    <div class="form-group">
        <label for="resourceName" class="col-lg-4  text-right">申请资源：</label>
        <div id="resourceName" class="col-lg-4 text-left">
            ${authorization.resourceName}
        </div>
        <span class="field-validation-valid help-block"></span>
    </div>
    <div class="form-group">
        <label for="resourceType" class="col-lg-4  text-right">资源类型：</label>
        <div id="resourceType" class="col-md-7 col-sm-7">
            ${authorization.resourceType}
        </div>
        <span class="field-validation-valid help-block"></span>
    </div>
    <div class="form-group">
        <label for="requirement" class="col-lg-4  text-right">共享开放类型：</label>
        <div id="requirement" class="col-md-7 col-sm-7">
            <c:if test="${authorization.platfromType eq open}">
                ${authorization.openType}
            </c:if>
            <c:if test="${authorization.platfromType eq share}">
                ${authorization.shareType}
            </c:if>
        </div>
        <span class="field-validation-valid help-block"></span>
    </div>
    <div class="form-group">
        <label for="applyTime" class="col-lg-4  text-right">申请时间：</label>
        <div id="applyTime" class="col-md-7 col-sm-7">
            <fmt:formatDate value="${authorization.applyTime}" pattern="yyyy-MM-dd"/>
        </div>
        <span class="field-validation-valid help-block"></span>
    </div>
    <div class="form-group">
        <label for="platfromType" class="col-lg-4  text-right">申请用户类型：</label>
        <div id="platfromType" class="col-md-7 col-sm-7">
            ${authorization.platfromType}
        </div>
        <span class="field-validation-valid help-block"></span>
    </div>
    <div class="form-group">
        <label for="applierName" class="col-lg-4  text-right">申请用户：</label>
        <div id="applierName" class="col-md-7 col-sm-7">
            ${authorization.applierName}
        </div>
        <span class="field-validation-valid help-block"></span>
    </div>
    <div class="form-group">
        <label for="applyReason" class="col-lg-4  text-right">申请理由：</label>
        <div id="applyReason" class="col-md-7 col-sm-7">
            ${authorization.applyReason}
        </div>
        <span class="field-validation-valid help-block"></span>
    </div>
    <div class="form-group">
        <label for="auditedByName" class="col-lg-4  text-right">处理人：</label>
        <div id="auditedByName" class="col-md-7 col-sm-7">
            ${authorization.auditedByName}
        </div>
        <span class="field-validation-valid help-block"></span>
    </div>
    <div class="form-group">
        <label for="authState" class="col-lg-4  text-right">状态：</label>
        <div id="authState" class="col-md-7 col-sm-7">
            ${authorization.authState}
        </div>
        <span class="field-validation-valid help-block"></span>
    </div>
    <div class="form-group">
        <label for="auditedBySector" class="col-lg-4  text-right">授权部门：</label>
        <div id="auditedBySector" class="col-md-7 col-sm-7">
            ${authorization.auditedBySector}
        </div>
        <span class="field-validation-valid help-block"></span>
    </div>
    <div class="form-group">
        <label for="auditOpinion" class="col-lg-4  text-right"><span style="color: red;">*</span>授权审核意见：</label>
        <div class="col-md-7 col-sm-7">
                     <textarea type="text" id="auditOpinion" name="auditOpinion" class="form-control"/>
                    <span class="field-validation-valid help-block"></span>
        </div>
    </div>
    <input type="hidden" name="authorizationState">
    <input type="hidden" name="publishSettingId" value="${authorization.publishSettingId}">
    <input type="hidden" name="id" value="${authorization.id}">
    <input type="hidden" name="resourceName" value="${authorization.resourceName}">
    <input type="hidden" name="resourceType" value="${authorization.resourceType}">
    <input type="hidden" name="platfromType" value="${platfromType}">
    <input type="hidden" name="outId1" value="${outId1}">
    <input type="hidden" name="applier" value="${applier}">
</form>
<jsp:include page="../../../common/admin/modal_content_post.jsp"></jsp:include>
<jsp:include page="../../../common/admin/modal_footer_pre.jsp"></jsp:include>
<button type="button" id="submitButton" class="btn btn-primary"><i class="fa fa-check"></i>同意授权</button>
<button type="button" id="keepButton" class="btn btn-warning"><i class="fa fa-close"></i>不予授权</button>
<button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-close"></i>取消</button>
<jsp:include page="../../../common/admin/modal_footer_post.jsp"></jsp:include>
<script type="text/javascript">
    $("#submitButton").click(function () {
        $('input[name="authorizationState"]').val("<%=DicAuthorizationState.AUTHORIZE_OK%>");
        $('#authorizationHandle').ajaxSubmitCloseRefresh();
    });

    $("#keepButton").click(function () {
        $('input[name="authorizationState"]').val("<%=DicAuthorizationState.AUTHORIZE_NO%>");
        $('#authorizationHandle').ajaxSubmitCloseRefresh();
    });
</script>