<%@ 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">
                <ol class="breadcrumb">
                    <li >
                        <a href="<%=basePath%>/admin/MicroappRecommendation/defaultIndex.htm" style="font-size: 20px">默认排序</a>
                    </li>
                    <li >
                        <a href="<%=basePath%>/admin/MicroappRecommendation/selection.htm" style="font-size: 20px">精选排序</a>
                    </li>
                    <li style="color: #00b3ee">
                        <a href="<%=basePath%>/admin/MicroappRecommendation/home.htm" style="font-size: 20px">首页排序</a>
                    </li>
                </ol>
            </div>
        </div>
    </div>
</div>
<input type="hidden" name="formSerialize" />
<input type="hidden" name="pageNo" value="1" />
<form id="formSearch" action="<%=basePath%>/admin/MicroappRecommendation/queryHomeList.action" method="get" class="form-inline">


</form>
<jsp:include page="../../../common/admin/grid_pre.jsp"></jsp:include>
<button id="btnAdd" type="button" class="btn btn-sm btn-primary btn-position"><i class="fa fa-plus"></i>添加</button>
<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">
    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/MicroappRecommendation/queryHomeList.action", data: formData });
    }

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

    $("#btnAdd").click(function () {
        var sortCategory = $("#sortCategory").val();
        $.popBsPartial({ url: "<%=basePath%>/admin/MicroappRecommendation/add.htm/"+sortCategory});
    });

    search();
    $("#divSectorTree").selectTree({url: "<%=basePath%>/admin/common/sector_tree_data.action"});
</script>
</body>
</html>