czt
昨天 9bb4d71dc57eee0314c34b536e1faf3b3c61b217
大屏提交2:GIS地图修改
已修改4个文件
已添加1个文件
47889 ■■■■ 文件已修改
fzzy-igdss-web/src/main/java/com/fzzy/sys/manager/group/GroupManager.java 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-web/src/main/resources/static/group/chinaMapList.js 14081 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-web/src/main/resources/static/group/gis.js 100 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-web/src/main/resources/static/group/index.js 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-web/src/main/resources/static/group/mapList.js 33650 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-web/src/main/java/com/fzzy/sys/manager/group/GroupManager.java
@@ -42,8 +42,18 @@
        List<DicArea> list = new ArrayList<>();
        list.add(area);
        if (Constant.AREA_TYPE_1.equals(area.getType())) {
            List<DicArea> children = dicAreaService.listData(area.getCode(), null, null);
            if (null != children && children.size() > 0) {
            //市州级别,只查询伊犁
            List<DicArea> children = dicAreaService.listData(null, null, "654000");
            if (null != children && !children.isEmpty()) {
                for (DicArea child : children) {
                    if (Constant.AREA_TYPE_2.equals(child.getType())) {
                        //区县
                        List<DicArea> childrenItem = dicAreaService.listData(child.getCode(), null, null);
                        if (null != childrenItem && !childrenItem.isEmpty()) {
                            list.addAll(childrenItem);
                        }
                    }
                }
                list.addAll(children);
            }
        }
@@ -59,22 +69,31 @@
     */
    public List<DicArea> getAreaAndChild(String areaCode) {
        List<DicArea> areaList = dicAreaService.listData(null, null, areaCode);
        if (null == areaList || areaList.isEmpty()) {
        DicArea area = dicAreaService.listDicAreaByCode(areaCode);
        if (null == area) {
            return null;
        }
        List<DicArea> children;
        for (DicArea dicArea : areaList) {
            if (Constant.AREA_TYPE_1.equals(dicArea.getType())) {
                children = dicAreaService.listData(dicArea.getCode(), null, null);
                if (null != children && children.size() > 0) {
                    dicArea.setChildren(children);
        List<DicArea> list = new ArrayList<>();
        if (Constant.AREA_TYPE_1.equals(area.getType())) {
            //市州级别,只查询伊犁
            List<DicArea> children = dicAreaService.listData(null, null, "654000");
            if (null != children && !children.isEmpty()) {
                for (DicArea child : children) {
                    if (Constant.AREA_TYPE_2.equals(child.getType())) {
                        //区县
                        List<DicArea> childrenItem = dicAreaService.listData(child.getCode(), null, null);
                        if (null != childrenItem && !childrenItem.isEmpty()) {
                            child.setChildren(childrenItem);
                        }
                    }
                }
                area.setChildren(children);
            }
        }
        return areaList;
        }
        list.add(area);
        return list;
    }
    /**
@@ -84,7 +103,6 @@
     * @return
     */
    public List<Dept> getAllDept(String companyId) {
        return deptService.listDept(null, companyId, null);
    }
}
fzzy-igdss-web/src/main/resources/static/group/chinaMapList.js
¶Ô±ÈÐÂÎļþ
ÎļþÌ«´ó
fzzy-igdss-web/src/main/resources/static/group/gis.js
@@ -127,9 +127,10 @@
/**
 * èŽ·å–å¸‚å·žä¸‹åº“åŒºä¿¡æ¯
 */
function getDeptArea(province, county) {
function getDeptArea(province, city, county) {
    var list = [];
    if (deptList) {
        //省
        if (province && province.length > 0) {
            var str1 = province.substring(0, 2);
            for (var i = 0; i < deptList.length; i++){
@@ -137,12 +138,20 @@
                    list.push(deptList[i]);
                }
            }
        }
        if (county && county.length > 0) {
            var str2 = county.substring(0, 4);
        //市州
        if (city && city.length > 0) {
            var str2 = city.substring(0, 4);
            for (var i = 0; i < deptList.length; i++) {
                if(deptList[i].xzqhdm.startsWith(str2)){
                    list.push(deptList[i]);
                }
            }
        }
        //区县
        if (county && county.length > 0) {
            for (var i = 0; i < deptList.length; i++) {
                if(deptList[i].xzqhdm === county){
                    list.push(deptList[i]);
                }
            }
@@ -155,20 +164,25 @@
/**
 * ç”¨æˆ·ç‚¹å‡»åŸŽå¸‚或者县级区级渲染库区点位
 */
function renderAreas(deptId) {
    var d = allAreaMap[deptId];
function renderAreas(code) {
    var d = allAreaMap[code];
    if (d) {
        closeInfoWindow();
        removeColor();
        delMarker();
        //map.setCity(deptId);
        renderColor(deptId);
        renderColor(code);
        var a = [];
        //省
        if ("1" == d.type) {
            a = getDeptArea(deptId, "")
            a = getDeptArea(code, "", "");
        }
        //市州
        if ("2" == d.type) {
            a = getDeptArea("", deptId)
            a = getDeptArea("", code, "")
        }
        //区县
        if ("3" == d.type) {
            a = getDeptArea("", "", code)
        }
        if (a && a.length > 0) {
            for (var i = 0; i < a.length; i++) {
@@ -176,10 +190,10 @@
            }
        }
        //刷新数据
        county = deptId;
        county = code;
        // ajaxFoodNum();
    } else {
        console.log("没有获取到该行政区划:" + deptId);
        console.log("没有获取到该行政区划:" + code);
    }
}
@@ -209,6 +223,7 @@
    if (areaList) {
        var html = "";
        var childs = [];
        var childsItem = [];
        var areas = [];
        for (var i = 0; i < areaList.length; i++) {
            html += "<div style=\"width: 305px; overflow: hidden\">" +
@@ -220,7 +235,7 @@
                (areaList[i].name ? areaList[i].name : "") +
                "</a>" +
                "</div>";
            if (areaList[i].children && areaList[i].children.length > 0) {
            if (areaList[i].children && areaList[i].children.length > 0) {   //市州
                childs = areaList[i].children;
                for (var j = 0; j < childs.length; j++) {
                    html += "<ul class=\"sup-menu-ul  menu-h\">" +
@@ -232,23 +247,58 @@
                        (childs[j].name ? childs[j].name : "") +
                        "</a>" +
                        "</div>";
                    areas = getDeptArea("", childs[j].code);
                    if (areas && areas.length > 0) {
                        for (var k = 0; k < areas.length; k++) {
                            html += "<div class=\"sup-menu-box\">" +
                                "<p>" +
                                "<span class=\"i-icon32 fl\"><img src=\"/img/web/group/icon-kuqu.png\"/></span>" +
                                "<a href=\"#\" onclick=\"showAreaInfo('" + areas[k].id + "')\">" + areas[k].kqmc + "</a>" +
                                "</p>" +
                    if (childs[j].children && childs[j].children.length > 0) {   //市州
                        childsItem = childs[j].children;
                        for (var j = 0; j < childsItem.length; j++) {
                            html += "<ul class=\"sup-menu-ul  menu-h\">" +
                                "<li>" +
                                "<div class=\"sup-menu-h\">" +
                                "<i class=\"i-icon fl\"><img src=\"/img/web/group/icon-sj.png\"/></i>" +
                                "<a href=\"###\" onclick=\"renderAreas('" + childsItem[j].code + "')\">" +
                                "<span class=\"i-icon32 fl\"><img src=\"/img/web/group/c-i2.png\"/></span>" +
                                (childsItem[j].name ? childsItem[j].name : "") +
                                "</a>" +
                                "</div>";
                            areas = getDeptArea("","", childsItem[j].code);
                            if (areas && areas.length > 0) {
                                for (var k = 0; k < areas.length; k++) {
                                    html += "<div class=\"sup-menu-box\">" +
                                        "<p>" +
                                        "<span class=\"i-icon32 fl\"><img src=\"/img/web/group/icon-kuqu.png\"/></span>" +
                                        "<a href=\"#\" onclick=\"showAreaInfo('" + areas[k].id + "')\">" + areas[k].kqmc + "</a>" +
                                        "</p>" +
                                        "</div>";
                                }
                            }
                            html += "</li>" +
                                "</ul>";
                        }
                    } else {
                        //没有子节点,直接就是库区
                        areas = getDeptArea("", "", areaList[i].code);
                        if (areas && areas.length > 0) {
                            for (var k = 0; k < areas.length; k++) {
                                html += "<ul class=\"sup-menu-ul\">" +
                                    "<li>" +
                                    "<div class=\"sup-menu-h\">" +
                                    "<i class=\"i-icon fl\"><img src=\"/img/web/group/icon-sj.png\"/></i>" +
                                    "<a href=\"###\" onclick=\"renderAreas('" + areas[k].code + "')\">" +
                                    "<span class=\"i-icon32 fl\"><img src=\"/img/web/group/icon-kuqu.png\"/></span>" +
                                    (areas[k].name ? areas[k].name : "") +
                                    "</a>" +
                                    "</div>";
                                html += "<div class=\"sup-menu-box\">" +
                                    "</div>";
                                html += "</li>" +
                                    "</ul>";
                            }
                        }
                    }
                    html += "</li>" +
                        "</ul>";
                }
            } else {
                //没有子节点,直接就是区级别
                areas = getDeptArea("", areaList[i].code);
                //没有子节点,直接就是库区
                areas = getDeptArea("", "",areaList[i].code);
                if (areas && areas.length > 0) {
                    for (var k = 0; k < areas.length; k++) {
                        html += "<ul class=\"sup-menu-ul\">" +
fzzy-igdss-web/src/main/resources/static/group/index.js
@@ -19,7 +19,7 @@
var number3 = 2;// å‚¨é‡é¥¼å›¾åˆ‡æ¢æ€»æ•°é‡
var mapChart = null;
var geoMap = [{name: '乌鲁木齐', value: [87.617733, 43.792818]}]; //默认点位
var geoMap = [{name: '伊犁哈萨克自治州', value: [81.317946, 43.92186]}]; //默认点位
var map = chinaMapOutline; //默认加载全国地图
$(function () {
    // åˆå§‹åŒ–页面
@@ -43,7 +43,7 @@
    initMap();
    //加载指定地区地图
    renderMapPoints("新疆维吾尔自治区");
    renderMapPoints("乌鲁木齐市,克拉玛依市,吐鲁番市,哈密市,昌吉回族自治州,博尔塔拉蒙古自治州,巴音郭楞蒙古自治州,阿克苏地区,克孜勒苏柯尔克孜自治州,喀什地区,和田地区,伊犁哈萨克自治州,塔城地区,阿勒泰地区");
    // è¯·æ±‚库区信息
    // ajaxDeptArea();
    // èŽ·å–å…¬å¸ä¿¡æ¯
@@ -87,10 +87,12 @@
        for (var i = 0; i < all.length; i++) {
            if(all[i].properties.name == names[j]){
                map.features.push(all[i]);
                geoMap.push({
                    name: all[i].properties.centerName,
                    value: [all[i].properties.center[0], all[i].properties.center[1], 12]
                });
                if(all[i].properties.name == "伊犁哈萨克自治州"){
                    geoMap.push({
                        name: all[i].properties.centerName,
                        value: [all[i].properties.center[0], all[i].properties.center[1], 12]
                    });
                }
                renderMap();
                break;
            }
fzzy-igdss-web/src/main/resources/static/group/mapList.js
ÎļþÌ«´ó