<%@ 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>数据管理平台</h2>
                    <ol class="breadcrumb">
                        <li>
                            <a href="javascript:void(0);" >社会发展</a>
                        </li>
                        <li class="active">
                            <strong>公众评价</strong>
                        </li>
                    </ol>
                </div>
            </div>
        </div>
    </div>
    <div class="row hidden-print">
        <div class="col-lg-12">
            <div class="ibox">
                <div class="ibox-title">
                    <span>在这里选择你要添加的表单</span>
                </div>
                <div class="ibox-content">
    <input type="hidden" name="pageNo" value="1" />
    <div class="form-group">
        <label for="chartTable">请选择需要填写的图表</label>
        <select id="chartTable" name="chartTable" class="form-control" onchange="fnChange()">
            <option></option>
            <c:forEach items="${chartTable}" var="item" >
                <option value="${item.value}">${item.key}</option>
            </c:forEach>
        </select>
    </div>
    <jsp:include page="../../../common/admin/search_post.jsp"></jsp:include>
    <jsp:include page="../../../common/admin/grid_pre.jsp"></jsp:include>
    <button id="btnAdd" type="button" class="btn btn-sm btn-primary btn-position" disabled="disabled"><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 tableType=$('#chartTable').val();
            if(!tableType){
                return;
            }
            var pageNo = $("input[type='hidden'][name='pageNo']").val();
            var formData ="tableType="+tableType+"&pageNo=" + pageNo;
            $("#divGrid").renderPartial({ url: "<%=basePath%>/ms/PublicEvaluation/list.action", data: formData });
        }

        $("#btnAdd").click(function () {
            var tableType=$('#chartTable').val();
            if(!tableType){
                return;
            }
            $.popBsPartial({ url: "<%=basePath%>/ms/PublicEvaluation/add.htm?tableType="+tableType });
        });


        function fnChange(){
            if($('#chartTable').val()){
                $('#btnAdd').removeAttr("disabled");
            }else{
                $('#btnAdd').attr("disabled","disabled");
            }
            $("input[type='hidden'][name='pageNo']").val(1);
            search();
        }
    </script>
</body>
</html>