From d24dd35d265a0b6bd0620285d226b5bed3d4566e Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期四, 11 十二月 2025 19:40:27 +0800
Subject: [PATCH] 大屏提交1:首页、GIS、视频页面
---
fzzy-igdss-web/src/main/resources/static/group/gis.js | 221 +++++++++++++++++++++++++------------------------------
1 files changed, 100 insertions(+), 121 deletions(-)
diff --git a/fzzy-igdss-web/src/main/resources/static/group/gis-index.js b/fzzy-igdss-web/src/main/resources/static/group/gis.js
similarity index 72%
rename from fzzy-igdss-web/src/main/resources/static/group/gis-index.js
rename to fzzy-igdss-web/src/main/resources/static/group/gis.js
index 5648024..b850fd2 100644
--- a/fzzy-igdss-web/src/main/resources/static/group/gis-index.js
+++ b/fzzy-igdss-web/src/main/resources/static/group/gis.js
@@ -1,8 +1,8 @@
var colors = {};
var map;
var disProvince;//琛屾斂鍖洪鑹叉覆鏌�
-var deptAreasMap = {};
-var allDeptMap = {};
+var deptListMap = {};
+var allAreaMap = {};
var markers = [];//鐐规爣璁�
var type = "0";
var county = "all";
@@ -10,18 +10,21 @@
//var switch2AreaNode2;
$(function () {
- if (deptAreas) {
- for (var i = 0; i < deptAreas.length; i++) {
- deptAreasMap[deptAreas[i].id] = deptAreas[i];
+ //鎵�鏈夊簱鍖�
+ if (deptList) {
+ for (var i = 0; i < deptList.length; i++) {
+ deptListMap[deptList[i].id] = deptList[i];
}
}
- if (allDept) {
- for (var i = 0; i < allDept.length; i++) {
- allDeptMap[allDept[i].id] = allDept[i];
+ //鎵�鏈夌渷甯�
+ if (allArea) {
+ for (var i = 0; i < allArea.length; i++) {
+ allAreaMap[allArea[i].code] = allArea[i];
}
}
+
//鍒濆鍖栨椂闂�
- //initTime();
+ initTime();
//鍒濆鍖栧湴鍥�
initMap();
@@ -37,16 +40,29 @@
);
//娓叉煋閮ㄩ棬
- //renderDepts();
+ renderList();
- //澶у睆鏍囪
- //initDicSlogan();
-
- //renderAreas(654000);
setTimeout(function () {
- renderAreas(654000);
+ renderAreas(650000);
}, 2000);
+ $('.sup-menu-title').click(function(){
+ var kai = $(this).parent(".sup-menu-group")
+ if (kai.hasClass('menu-group')) {
+ kai.removeClass('menu-group')
+ } else{
+ kai.addClass('menu-group')
+ }
+
+ });
+ $('.sup-menu-h').click(function(){
+ var kai2 = $(this).parents(".sup-menu-ul")
+ if (kai2.hasClass('menu-h')) {
+ kai2.removeClass('menu-h')
+ } else{
+ kai2.addClass('menu-h')
+ }
+ });
});
// 鍒锋柊鏃堕棿
@@ -60,8 +76,8 @@
function initMap() {
map = new AMap.Map('map_container', {
- center: [81.323691, 43.917106],
- zoom: 9,
+ center: [83.721646, 40.627714],
+ zoom: 5.6,
mapStyle: 'amap://styles/41f8248740d3659ddc65dc363078592c',
// rotateEnable:true,
// pitchEnable:true,
@@ -74,7 +90,7 @@
new AMap.DistrictSearch({
extensions: 'all',
subdistrict: 0
- }).search('浼婄妬鍝堣惃鍏嬭嚜娌诲窞', function (status, result) {
+ }).search('鏂扮枂缁村惥灏旇嚜娌诲尯', function (status, result) {
// 澶栧杈瑰舰鍧愭爣鏁扮粍鍜屽唴澶氳竟褰㈠潗鏍囨暟缁�
var outer = [
new AMap.LngLat(-360, 90, true),
@@ -105,52 +121,34 @@
//榛樿琛屾斂鍖哄煙缂栫爜
- renderColor(defaultAreaCode);
-}
-
-//socket淇℃伅杩斿洖铏曠悊
-function socketOnMessage(pocket) {
-
- if (pocket.userId == "slogan") {
- var data = pocket.data;
- dicSlogan = data;
- initDicSlogan();
- }
+ // renderColor(defaultAreaCode);
}
/**
- * 鍒濆鏍囪鏁版嵁
+ * 鑾峰彇甯傚窞涓嬪簱鍖轰俊鎭�
*/
-function initDicSlogan() {
- if (dicSlogan) {
- if (dicSlogan.color == "red") {
- $("#sloganText").css({
- color: "#DE2910"
- });
- } else {
- $("#sloganText").css({
- color: "#7ddfff"
- });
- }
- $("#sloganText").text(dicSlogan.content);
- }
-}
-
-/**
- * 鏍规嵁鍖哄幙鑾峰彇搴撳尯
- */
-function getDeptArea(city, county) {
+function getDeptArea(province, county) {
var list = [];
- if (deptAreas) {
- for (var i = 0; i < deptAreas.length; i++) {
- if (city == deptAreas[i].deptCity) {
- list.push(deptAreas[i]);
+ if (deptList) {
+ 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)){
+ list.push(deptList[i]);
+ }
}
- if (county == deptAreas[i].deptCounty) {
- list.push(deptAreas[i]);
+
+ }
+ if (county && county.length > 0) {
+ var str2 = county.substring(0, 4);
+ for (var i = 0; i < deptList.length; i++) {
+ if(deptList[i].xzqhdm.startsWith(str2)){
+ list.push(deptList[i]);
+ }
}
}
}
+
return list;
}
@@ -158,7 +156,7 @@
* 鐢ㄦ埛鐐瑰嚮鍩庡競鎴栬�呭幙绾у尯绾ф覆鏌撳簱鍖虹偣浣�
*/
function renderAreas(deptId) {
- var d = allDeptMap[deptId];
+ var d = allAreaMap[deptId];
if (d) {
closeInfoWindow();
removeColor();
@@ -166,10 +164,10 @@
//map.setCity(deptId);
renderColor(deptId);
var a = [];
- if ("10" == d.type) {
+ if ("1" == d.type) {
a = getDeptArea(deptId, "")
}
- if ("11" == d.type) {
+ if ("2" == d.type) {
a = getDeptArea("", deptId)
}
if (a && a.length > 0) {
@@ -179,12 +177,10 @@
}
//鍒锋柊鏁版嵁
county = deptId;
- // ajaxFoodNum();
+ // ajaxFoodNum();
} else {
console.log("娌℃湁鑾峰彇鍒拌琛屾斂鍖哄垝:" + deptId);
}
- //闄曡タ
-
}
/**
@@ -192,7 +188,7 @@
* @param deptAreaId
*/
function showAreaInfo(deptAreaId) {
- var d = deptAreasMap[deptAreaId];
+ var d = deptListMap[deptAreaId];
if (d) {
closeInfoWindow();
removeColor();
@@ -209,40 +205,40 @@
/**
* 娓叉煋搴撳尯鍒楄〃
*/
-function renderDepts() {
- if (depts) {
+function renderList() {
+ if (areaList) {
var html = "";
var childs = [];
var areas = [];
- for (var i = 0; i < depts.length; i++) {
+ for (var i = 0; i < areaList.length; i++) {
html += "<div style=\"width: 305px; overflow: hidden\">" +
"<div class=\"sup-menu-group menu-group\">" +
"<div class=\"sup-menu-title\">" +
- "<i class=\"i-icon fl\"><img src=\"/static/images/visual/icon-sj.png\"/></i>" +
- "<a href=\"###\" onclick=\"renderAreas('" + depts[i].id + "')\">" +
- "<span class=\"i-icon32 fl\"><img src=\"/static/images/visual/c-i2.png\"/></span>" +
- (depts[i].name ? depts[i].name : "") +
+ "<i class=\"i-icon fl\"><img src=\"/img/web/group/icon-sj.png\"/></i>" +
+ "<a href=\"###\" onclick=\"renderAreas('" + areaList[i].code + "')\">" +
+ "<span class=\"i-icon32 fl\"><img src=\"/img/web/group/c-i2.png\"/></span>" +
+ (areaList[i].name ? areaList[i].name : "") +
"</a>" +
"</div>";
- if (depts[i].children && depts[i].children.length > 0) {
- childs = depts[i].children;
+ 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\">" +
"<li>" +
"<div class=\"sup-menu-h\">" +
- "<i class=\"i-icon fl\"><img src=\"/static/images/visual/icon-sj.png\"/></i>" +
- "<a href=\"###\" onclick=\"renderAreas('" + childs[j].id + "')\">" +
- "<span class=\"i-icon32 fl\"><img src=\"/static/images/visual/c-i2.png\"/></span>" +
+ "<i class=\"i-icon fl\"><img src=\"/img/web/group/icon-sj.png\"/></i>" +
+ "<a href=\"###\" onclick=\"renderAreas('" + childs[j].code + "')\">" +
+ "<span class=\"i-icon32 fl\"><img src=\"/img/web/group/c-i2.png\"/></span>" +
(childs[j].name ? childs[j].name : "") +
"</a>" +
"</div>";
- areas = getDeptArea("", childs[j].id);
+ 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=\"/static/images/visual/icon-kuqu.png\"/></span>" +
- "<a href=\"#\" onclick=\"showAreaInfo('" + areas[k].id + "')\">" + areas[k].name + "</a>" +
+ "<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>";
}
@@ -252,15 +248,15 @@
}
} else {
//娌℃湁瀛愯妭鐐癸紝鐩存帴灏辨槸鍖虹骇鍒�
- areas = getDeptArea("", depts[i].id);
+ 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=\"/static/images/visual/icon-sj.png\"/></i>" +
- "<a href=\"###\" onclick=\"renderAreas('" + areas[k].id + "')\">" +
- "<span class=\"i-icon32 fl\"><img src=\"/static/images/visual/icon-kuqu.png\"/></span>" +
+ "<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>";
@@ -305,7 +301,7 @@
// " <p>澶╁簻鏂板尯</p>" +
" <span class=\"map-round\"></span>" +
" </div>";
- var position = [deptArea.lon, deptArea.lat];
+ var position = [deptArea.jd, deptArea.wd];
var marker = new AMap.Marker({
position: position,
// 灏� html 浼犵粰 content
@@ -375,54 +371,54 @@
"<div class=\"BMap_bubble_center\" style=\"z-index: 3; position: relative; height: 324px; width: 376px;\">" +
"<div class=\"BMap_bubble_content\" style=\"font-size: 14px; line-height: 24px; position: absolute; top: 2px; color: rgb(85, 85, 85); width: 364px; height: 324px; overflow: auto;\">" +
'<div style=\"height:100%;box-sizing:border-box;\">' +
- '<div style="height: 34px;">'+
+ '<div style="height: 34px;">' +
'<div style="width: 320px;float: left;">';
- if (deptArea.name.length>17) {
- content += '<h3 style="margin:0 0 10px 0;line-height:24px;font-size:14px;color:#fff;">' + (deptArea.name ? deptArea.name : "娌℃湁鑾峰彇鍒板簱鍖轰俊鎭�") + '</h3>' ;
- }else{
- content += '<h3 style="margin:0 0 10px 0;line-height:24px;font-size:18px;color:#fff;">' + (deptArea.name ? deptArea.name : "娌℃湁鑾峰彇鍒板簱鍖轰俊鎭�") + '</h3>' ;
+ 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>';
+ } else {
+ content += '<h3 style="margin:0 0 10px 0;line-height:24px;font-size:18px;color:#fff;">' + (deptArea.kqmc ? deptArea.kqmc : "娌℃湁鑾峰彇鍒板簱鍖轰俊鎭�") + '</h3>';
}
- content += '</div>'+
+ content += '</div>' +
'<div style="width: 40px;float: left;">' +
- '<img style="height: 20px;" src="../../static/images/visual/icon_close.png" onclick="closeInfoWindow()"></img>' +
- '</div>'+
- '</div>'+
+ '<img style="height: 20px;" src="/img/web/group/icon_close.png" onclick="closeInfoWindow()"></img>' +
+ '</div>' +
+ '</div>' +
- '<p style="line-height:24px;font-size:12px;color:#fff;margin-right: 15px;"><img src="../../static/images/visual/icon-address.png" alt="" style="float:left;width: 16px;height: 16px;margin-right:3px;margin-top: 5px;"/>' + (deptArea.address ? deptArea.address + "(" + deptArea.lon + "," + deptArea.lat + ")" : "娌℃湁鑾峰彇鍒板簱鍖轰俊鎭�") + '</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.kqdz ? deptArea.kqdz + "(" + deptArea.jd + "," + deptArea.wd + ")" : "娌℃湁鑾峰彇鍒板簱鍖轰俊鎭�") + '</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.depotNum ? deptArea.depotNum : 0) + '</p>' +
+ '<p>' + (deptArea.cfs ? deptArea.cfs : 0) + '</p>' +
'</div>' +
'<div class="right-topInfo-kd-item">' +
'<h3>娌圭綈涓暟(涓�)</h3>' +
- '<p>' + (deptArea.depotOilNum ? deptArea.depotOilNum : 0) + '</p>' +
+ '<p>' + (deptArea.cfs ? deptArea.cfs : 0) + '</p>' +
'</div>' +
'</div>' +
'<ul class="right-topInfo-kd-list right-topInfo-jg sup-topInfo-list">' +
'<li>';
- if (deptArea.storage && (deptArea.storage + "").length > 4) {
- content += '<p style="font-size: 22px">' + (deptArea.storage ? deptArea.storage.toFixed(3) : 0) + '</p>';
+ if (deptArea.cfs && (deptArea.cfs + "").length > 4) {
+ content += '<p style="font-size: 22px">' + (deptArea.cfs ? deptArea.cfs.toFixed(3) : 0) + '</p>';
} else {
- content += '<p style="font-size: 22px">' + (deptArea.storage ? deptArea.storage.toFixed(3) : 0) + '</p>';
+ content += '<p style="font-size: 22px">' + (deptArea.cfs ? deptArea.cfs.toFixed(3) : 0) + '</p>';
}
- content += '<h3>绮鍌ㄩ噺(鍚�)</h3>'+
+ content += '<h3>绮鍌ㄩ噺(鍚�)</h3>' +
'</li>' +
'<li>';
- if (deptArea.storage && (deptArea.oilStorage + "").length > 4) {
- content += '<p style="font-size: 22px">' + (deptArea.oilStorage ? deptArea.oilStorage.toFixed(3) : 0) + '</p>';
+ if (deptArea.cfs && (deptArea.cfs + "").length > 4) {
+ content += '<p style="font-size: 22px">' + (deptArea.cfs ? deptArea.cfs.toFixed(3) : 0) + '</p>';
} else {
- content += '<p style="font-size: 22px">' + (deptArea.oilStorage ? deptArea.oilStorage.toFixed(3) : 0) + '</p>';
+ content += '<p style="font-size: 22px">' + (deptArea.cfs ? deptArea.cfs.toFixed(3) : 0) + '</p>';
}
content += '<h3>妞嶇墿娌瑰偍閲�(鍚�)</h3>' +
'</li>' +
'<li>' +
- '<p style="font-size: 22px" >' + (deptArea.area ? deptArea.area : 0) + '</p>' +
+ '<p style="font-size: 22px" >' + (deptArea.zdmj ? deptArea.zdmj : 0) + '</p>' +
'<h3>鍗犲湴闈㈢Н锛堛帯锛�</h3>' +
'</li>' +
'</ul>' +
- '<a href="javaScript:;" onclick="toHomeDetail(\'' + deptAreaId + '\')" class="sup-deatil-link"><img src="../../static/images/visual/spu-detail-btn.png" alt="" style="width:100%;height:100%;"/></a>' +
+ '<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>' +
'</div>' +
"</div></div><div class=\"BMap_bubble_bottom\" style=\"display: block; z-index: 2; position: absolute; width: 376px;\">" +
"</div><img style=\"z-index: 1; position: absolute; width: 58px; height: 31px; left: 159px; bottom: -30px; top: 356px;\" src=\"http://webmap0.bdimg.com/image/api/iw_tail.png\"></div>";
@@ -435,7 +431,7 @@
* @param id
*/
function toHomeDetail(id) {
- var url = "../home?t=grain&deptAreaId=" + id;
+ var url = "/index?deptId=" + id;
window.parent.open(url, "_self");
};
@@ -444,23 +440,6 @@
* @param adcode
*/
function renderColor(adcode) {
- // disProvince = new AMap.DistrictLayer.Province({
- // zIndex: 12,
- // adcode: adcode,
- // depth: 2,
- // opacity: 0.6,
- // styles: {
- // 'fill': function (properties) {
- // var adcode = properties.adcode;
- // return getColorByAdcode(adcode);
- // },
- // 'province-stroke': 'cornflowerblue',
- // 'city-stroke': 'white',//涓浗鍦扮骇甯傝竟鐣�
- // 'county-stroke': 'rgba(255,255,255,0.5)'//涓浗鍖哄幙杈圭晫
- // }
- // });
- // disProvince.setMap(map);
- //window.switch2AreaNode2(adcode);
switch2AreaNode(adcode);
}
--
Gitblit v1.9.3