기둥 모양도 페이지

4354 단어
@layout("/common/_container.html"){

#SelectCon>

$(document).ready(function(){ zdjia(); var province = document.getElementById("province").value; regionCX(province); $("#cxMessage").click(function () { province = document.getElementById("province").value; regionCX(province); }); }); function zdjia() { $.ajax({ async: false, type: "post", dataType: "json", url: "/getAddress/getProvince", success: function (data) { $("#province").empty(); $.each(data, function (i, val) { $("#province").append($("<option value=" + val.id + ">" + val.region_name + "</option>")); }) }, error: function (msg) { window.top.alert(' ...' + msg); } }); } // function regionCX(province) { $.ajax({ async : false, type: "post", url: "/testReport/messageInfo?province="+province, success : function(data){ var strName = []; var intCount = []; for(var key in data) { if (!data.hasOwnProperty(key)) { continue } strName.push(key); intCount.push(data[key]); } messageGroup(strName,intCount); // document.getElementById("strName").value = strName; //document.getElementById("intCount").value = intCount; }, error : function(msg){ //window.top.alert(' ...'+msg); } }); } @}

后台接口
省份

 @RequestMapping(value = "/getProvince",method = RequestMethod.POST)
    public List> getProvicne(){
        return izUserService.getProvince();
    }


데이터

    /**
     *  
     */
    @RequestMapping("/messageInfo")
    @ResponseBody
    public Object messageInfo(String province){
        // ID 
        List regionsList = regionService.selectList(new EntityWrapper().eq("PARENT_ID",province));

        String[] strName = new String[regionsList.size()]; // 、 
        Integer[] intCount = new Integer[regionsList.size()]; // count
        for (int i = 0; i < regionsList.size(); i++) {
            // 
            int count = testReportService.selectCount(new EntityWrapper().eq("cityId",regionsList.get(i).getId()));
            strName[i] = regionsList.get(i).getRegionName();
            intCount[i] = count;
        }
        Map map = new HashMap();
        for (int i = 0; i < strName.length; i++) {
            map.put(strName[i],intCount[i]);

        }
        return JSONObject.fromObject(map);
    }

좋은 웹페이지 즐겨찾기