sgj
3 天以前 241d327e57cbfe504aa806c61aa22e6205706098
fzzy-igdss-web/src/main/resources/static/group/gis.js
@@ -6,6 +6,7 @@
var markers = [];//点标记
var type = "0";
var county = "all";
var breedChart = null;
//var switch2AreaNode2;
@@ -13,7 +14,7 @@
    //所有库区
    if (deptList) {
        for (var i = 0; i < deptList.length; i++) {
            deptListMap[deptList[i].id] = deptList[i];
            deptListMap[deptList[i].deptId] = deptList[i];
        }
    }
    //所有省市
@@ -29,19 +30,33 @@
    //初始化地图
    initMap();
    //左侧图表
    //初始化左侧图表
    pieChartLoad(
        [
            {value: "0.000", name: '稻谷'},
            {value: "0.000", name: '玉米'},
            {value: "0.000", name: '小麦'}
            {value: "0", name: '伊宁市'},
            {value: "0", name: '奎屯市'},
            {value: "0", name: '霍尔果斯市'},
            {value: "0", name: '伊宁县'},
            {value: "0", name: '察布查尔锡伯自治县'},
            {value: "0", name: '霍城县'},
            {value: "0", name: '巩留县'},
            {value: "0", name: '新源县'},
            {value: "0", name: '昭苏县'},
            {value: "0", name: '特克斯县'},
            {value: "0", name: '尼勒克县'}
        ],
        'breedChart'
    );
    window.onresize = function (e) {
        if (breedChart) {
            breedChart.resize();
        }
    }
    //渲染部门
    renderList();
    renderNum();
    //定位到新疆省
    setTimeout(function () {
        positioning("650000");
@@ -160,7 +175,7 @@
        if (province && province.length > 0) {
            var str1 = province.substring(0, 2);
            for (var i = 0; i < deptList.length; i++){
                if(deptList[i].xzqhdm.startsWith(str1)){
                if(deptList[i].code.startsWith(str1)){
                    list.push(deptList[i]);
                }
            }
@@ -169,7 +184,7 @@
        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)){
                if(deptList[i].code.startsWith(str2)){
                    list.push(deptList[i]);
                }
            }
@@ -177,7 +192,7 @@
        //区县
        if (county && county.length > 0) {
            for (var i = 0; i < deptList.length; i++) {
                if(deptList[i].xzqhdm === county){
                if(deptList[i].code === county){
                    list.push(deptList[i]);
                }
            }
@@ -291,13 +306,12 @@
                                    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>" +
                                        "<a href=\"#\" onclick=\"showAreaInfo('" + areas[k].deptId + "')\">" + areas[k].deptName + "</a>" +
                                        "</p>" +
                                        "</div>";
                                }
                            }
                            html += "</li>" +
                                "</ul>";
                            html += "</li></ul>";
                        }
                    } else {
                        //没有子节点,直接就是库区
@@ -310,13 +324,12 @@
                                    "<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 : "") +
                                    (areas[k].deptName ? areas[k].deptName : "") +
                                    "</a>" +
                                    "</div>";
                                html += "<div class=\"sup-menu-box\">" +
                                    "</div>";
                                html += "</li>" +
                                    "</ul>";
                                html += "</li></ul>";
                            }
                        }
@@ -351,6 +364,28 @@
        $("#menuDiv").html(html);
    }
}
function renderNum() {
    $("#foodSum").html(gisData.deptNum);
    var foodNumPerHtml = '';
    var color = ["0, 228, 250", "22, 226, 173", "255, 181, 23", "238, 60, 72", "135, 103, 255", "41, 122, 255", "238, 60, 144", "0, 228, 250", "22, 226, 173", "255, 181, 23", "238, 60, 72", "135, 103, 255", "41, 122, 255", "238, 60, 144"];
    for (var i = 0; i < gisData.deptList.length; i++) {
        foodNumPerHtml += '<li><div class="con" style="background-color: rgba('+color[i]+',.05);">';
        foodNumPerHtml += '<div class="dot" style="background-color: rgb('+color[i]+');"></div>';
        foodNumPerHtml += '<div class="num" style="color: rgb('+color[i]+');">'+gisData.deptList[i].percent+'%</div>';
        foodNumPerHtml += '<div class="type">'+gisData.deptList[i].name+'</div>';
        foodNumPerHtml += '</div></li>';
    }
    $("#foodNumPer").html(foodNumPerHtml);
    if (gisData.deptList.length > 0) {
        var varietyChart = breedChart;
        varietyChart.option.series[0].data = gisData.deptList;
        varietyChart.chart.setOption(varietyChart.option, true);
        breedChart = varietyChart;
    }
    barChartLoad("ss");
}
/**
@@ -430,7 +465,7 @@
 * 创建信息窗口
 */
function createInfoWindow(deptArea) {
    var deptAreaId = deptArea.id;
    var deptAreaId = deptArea.deptId;
    var content = "<div class=\"BMap_bubble_pop\" style=\"padding: 0px 8px; position: relative; top:0px !important;left:0px !important;cursor: default; border: 1px solid rgb(221, 221, 221); background-color: rgb(255, 255, 255); border-radius: 10px; left: 837px; top: -46px; width: 376px;\">" +
        "<div class=\"BMap_bubble_top\" style=\"height:31px\">" +
        "<div class=\"BMap_bubble_title\" style=\"line-height: 30px; overflow: hidden; height: 30px; white-space: nowrap; color: rgb(51, 51, 51); width: 376px;\">" +
@@ -449,10 +484,10 @@
        '<div style=\"height:100%;box-sizing:border-box;\">' +
        '<div style="height: 34px;">' +
        '<div style="width: 320px;float: left;">';
    if (deptArea.kqmc.length > 17) {
        content += '<h3 style="margin:0 0 10px 0;line-height:24px;font-size:14px;color:#fff;">' + (deptArea.kqmc ? deptArea.kqmc : "没有获取到库区信息") + '</h3>';
    if (deptArea.deptName.length > 17) {
        content += '<h3 style="margin:0 0 10px 0;line-height:24px;font-size:14px;color:#fff;">' + (deptArea.deptName ? deptArea.deptName : "没有获取到库区信息") + '</h3>';
    } else {
        content += '<h3 style="margin:0 0 10px 0;line-height:24px;font-size:18px;color:#fff;">' + (deptArea.kqmc ? deptArea.kqmc : "没有获取到库区信息") + '</h3>';
        content += '<h3 style="margin:0 0 10px 0;line-height:24px;font-size:18px;color:#fff;">' + (deptArea.deptName ? deptArea.deptName : "没有获取到库区信息") + '</h3>';
    }
    content += '</div>' +
        '<div style="width: 40px;float: left;">' +
@@ -460,38 +495,38 @@
        '</div>' +
        '</div>' +
        '<p style="line-height:24px;font-size:12px;color:#fff;margin-right: 15px;"><img src="/img/web/group/icon-address.png" alt="" style="float:left;width: 16px;height: 16px;margin-right:3px;margin-top: 5px;"/>' + (deptArea.kqdz ? deptArea.kqdz + "(" + deptArea.jd + "," + deptArea.wd + ")" : "没有获取到库区信息") + '</P>' +
        '<p style="line-height:24px;font-size:12px;color:#fff;margin-right: 15px;"><img src="/img/web/group/icon-address.png" alt="" style="float:left;width: 16px;height: 16px;margin-right:3px;margin-top: 5px;"/>' + (deptArea.county ? deptArea.county : "没有获取到库区信息") + '</P>' +
        '<div class="right-topInfo-kd " style="height: 80px;width: 270px;margin: 5px auto 10px auto;">' +
        '<div class="right-topInfo-kd-item">' +
        '<h3>粮仓个数(个)</h3>' +
        '<p>' + (deptArea.cfs ? deptArea.cfs : 0) + '</p>' +
        '<h3>当日入库单数(个)</h3>' +
        '<p>' + (deptArea.inNum) + '</p>' +
        '</div>' +
        '<div class="right-topInfo-kd-item">' +
        '<h3>油罐个数(个)</h3>' +
        '<p>' + (deptArea.cfs ? deptArea.cfs : 0) + '</p>' +
        '<h3>当日出库单数(个)</h3>' +
        '<p>' + (deptArea.outNum) + '</p>' +
        '</div>' +
        '</div>' +
        '<ul class="right-topInfo-kd-list right-topInfo-jg sup-topInfo-list">' +
        '<li>';
    if (deptArea.cfs && (deptArea.cfs + "").length > 4) {
        content += '<p style="font-size: 22px">' + (deptArea.cfs ? deptArea.cfs.toFixed(3) : 0) + '</p>';
    if (deptArea.depotNumber && (deptArea.depotNumber + "").length > 4) {
        content += '<p style="font-size: 22px">' + (deptArea.depotNumber) + '</p>';
    } else {
        content += '<p style="font-size: 22px">' + (deptArea.cfs ? deptArea.cfs.toFixed(3) : 0) + '</p>';
        content += '<p style="font-size: 22px">' + (deptArea.depotNumber) + '</p>';
    }
    content += '<h3>粮食储量(吨)</h3>' +
    content += '<h3>仓库数(个)</h3>' +
        '</li>' +
        '<li>';
    if (deptArea.cfs && (deptArea.cfs + "").length > 4) {
        content += '<p style="font-size: 22px">' + (deptArea.cfs ? deptArea.cfs.toFixed(3) : 0) + '</p>';
    if (deptArea.depotBankNumber && (deptArea.depotBankNumber + "").length > 4) {
        content += '<p style="font-size: 22px">' + (deptArea.depotBankNumber) + '</p>';
    } else {
        content += '<p style="font-size: 22px">' + (deptArea.cfs ? deptArea.cfs.toFixed(3) : 0) + '</p>';
        content += '<p style="font-size: 22px">' + (deptArea.depotBankNumber) + '</p>';
    }
    content += '<h3>植物油储量(吨)</h3>' +
    content += '<h3>质押仓数(个)</h3>' +
        '</li>' +
        '<li>' +
        '<p style="font-size: 22px" >' + (deptArea.zdmj ? deptArea.zdmj : 0) + '</p>' +
        '<h3>占地面积(㎡)</h3>' +
        '<p style="font-size: 22px" >' + (deptArea.storageNum) + '</p>' +
        '<h3>库存数(吨)</h3>' +
        '</li>' +
        '</ul>' +
        '<a href="javaScript:;" onclick="toHomeDetail(\'' + deptAreaId + '\')"  class="sup-deatil-link"><img src="/img/web/group/spu-detail-btn.png" alt="" style="width:100%;height:100%;"/></a>' +