<%@ page import="org.apache.commons.lang.StringUtils" %>
<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String basePath = request.getContextPath();
%>
<!DOCTYPE html>
<html>
<head>
    <jsp:include page="../../../common/admin/head.jsp"></jsp:include>
</head>
<body>
<jsp:include page="../../../common/admin/body_pre.jsp"></jsp:include>
<div class="row hidden-print">
    <div class="col-lg-12">
        <div class="ibox">
            <div class="ibox-title">
                <h2>API发布</h2>
                <ol class="breadcrumb">
                    <li>
                        <a href="javascript:void(0);">资源发布</a>
                    </li>
                    <li class="active">
                        <strong>API发布</strong>
                    </li>
                </ol>
            </div>
        </div>
    </div>
</div>
<jsp:include page="../../../common/admin/search_pre.jsp"></jsp:include>
<input type="hidden" name="formSerialize"/>
<input type="hidden" name="pageNo" value="1"/>
<form id="formSearch" action="<%=basePath%>/admin/classificationAndAggregation/list.action" method="get" class="form-inline">
    <div class="form-group">
        <label class="col-md-5 col-sm-3 control-label">所属机构</label>
        <div class="col-md-3 col-sm-3">
            <input type="hidden" id="provider" name="provider" />
            <button type="button" class="btn btn-default dropdown-toggle" style="min-width: 120px; text-align: right;">
                <span class="caret" style="margin-left: 10px;"></span>
            </button>
            <div id="divAddSectorTree"></div>
            <span class="field-validation-valid help-block"></span>
        </div>

    </div>
    <div class="form-group">
        <label for="resourceName">资源名称</label>
        <input type="text" id="resourceName" name="resourceName" class="form-control"/>
    </div>

    <div class="form-group">
        <label for="resourceType">资源类型</label>
        <select id="resourceType" name="resourceType" class="form-control">
            <option></option>
            <c:forEach items="${resourceType}" var="item">
                <option value="${item.key}">${item.value}</option>
            </c:forEach>
        </select>
    </div>
    <div class="form-group">
        <button id="btnSearch" type="button" class="btn btn-sm btn-primary"><i class="fa fa-search"></i>查询</button>
    </div>
</form>
<jsp:include page="../../../common/admin/search_post.jsp"></jsp:include>
<jsp:include page="../../../common/admin/grid_pre.jsp"></jsp:include>
<jsp:include page="../../../common/admin/grid_middle.jsp"></jsp:include>
<div id="divGrid">
</div>
<jsp:include page="../../../common/admin/grid_post.jsp"></jsp:include>
<jsp:include page="../../../common/admin/body_post.jsp"></jsp:include>
<script type="text/javascript">
    $(".input-group.date").datetimepicker({
        format: "YYYY-MM-DD",
        locale: "zh-cn"
    });

    function search() {
        var formSerialize = $("input[type='hidden'][name='formSerialize']").val();
        var pageNo = $("input[type='hidden'][name='pageNo']").val();
        var formData = formSerialize + "&pageNo=" + pageNo;
        $("#divGrid").renderPartial({url: "<%=basePath%>/admin/classificationAndAggregation/list.action", data: formData});
    }

    $("#btnSearch").click(function () {
        $("input[type='hidden'][name='pageNo']").val(1);
        $("input[type='hidden'][name='formSerialize']").val($("#formSearch").serialize());
        search();
    });


    search();
    $("#divAddSectorTree").selectTree({url: "<%=basePath%>/admin/common/sector_tree_data.action${busiModel.provider == null ? "" : "?selectedId="}${busiModel.provider}"});
</script>
</body>
</html>