From 0d1b8d5609a0dfe7defd79dd6cf6db151413f1d3 Mon Sep 17 00:00:00 2001
From: sgj <1442489573@qq.com>
Date: 星期四, 25 十二月 2025 17:06:50 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
fzzy-igdss-web/src/main/resources/static/group/index.js | 527 ++++++++++++----------------------------------------------
1 files changed, 110 insertions(+), 417 deletions(-)
diff --git a/fzzy-igdss-web/src/main/resources/static/group/index.js b/fzzy-igdss-web/src/main/resources/static/group/index.js
index 6d57481..1e661dc 100644
--- a/fzzy-igdss-web/src/main/resources/static/group/index.js
+++ b/fzzy-igdss-web/src/main/resources/static/group/index.js
@@ -1,66 +1,84 @@
var nowClientWidth = document.documentElement.clientWidth; // 褰撳墠瑙嗗彛瀹藉害
-var pieVarietyChart = null; // 鍝佺楗肩姸鍥� -- 绮
-var pieTypeChart = null; // 鎬ц川楗肩姸鍥� -- 绮
-var pieLevelChart = null; // 绛夌骇楗肩姸鍥� -- 绮
-var pieYearChart = null; // 骞翠唤楗肩姸鍥� -- 绮
-var pieAreaChart = null; // 鍖哄煙楗肩姸鍥� -- 绮
var hisVarietyChart = null; // 鍝佺鏌辩姸鍥�
-var deptAreaAllList = null; // 鎵�鏈夊簱鍖哄垪琛ㄤ俊鎭�
-var deptAreaList = null; // 瀛樻斁鍒囨崲搴撳尯鍒楄〃淇℃伅
-var companyList = null; // 鍏徃淇℃伅
+var deptList = null; // 鎵�鏈夊簱鍖哄垪琛ㄤ俊鎭�
var deptCode = null; // 褰撳墠闂儊鍦板尯鐨勭紪鐮�
-var timer1; // 搴撳尯瀹氭椂
-var index1 = 0; // 搴撳尯鍒囨崲涓嬫爣
-var timer2; // 绮鏁伴噺瀹氭椂
-var index2 = 0; // 绮鏁伴噺鍒囨崲涓嬫爣
-var number2 = 2;// 绮鏁伴噺鍒囨崲鎬绘暟閲�
-var timer3; // 鍌ㄩ噺楗煎浘瀹氭椂
-var index3 = 0; // 鍌ㄩ噺楗煎浘鍒囨崲涓嬫爣
-var number3 = 2;// 鍌ㄩ噺楗煎浘鍒囨崲鎬绘暟閲�
-
+var timer; // 搴撳尯瀹氭椂
+var deptNum = 0; //搴撳尯鍒囨崲涓嬫爣
var mapChart = null;
var geoMap = [{name: '浼婄妬鍝堣惃鍏嬭嚜娌诲窞', value: [81.317946, 43.92186]}]; //榛樿鐐逛綅
var map = chinaMapOutline; //榛樿鍔犺浇鍏ㄥ浗鍦板浘
+
$(function () {
// 鍒濆鍖栭〉闈�
init();
// 鍒濆鍖朩ebSocket
- initWS(companyId,bizType, bizTag, userId);
+ // initWS(companyId,bizType, bizTag, userId);
});
// 鍒濆鍖栭〉闈�
function init() {
// 閫傚簲灞忓箷澶у皬
initScrollbar();
- // 鏃堕棿
- initTime();
+
// 鍒濆鍖栧浘琛�
initChart();
- initDicSlogan();
+
//鍒濆鍖栧湴鍥�
initMap();
+ // 鏃堕棿
+ initTime();
+
+ //鍒濆鍖栨爣璇�
+ initDicSlogan();
+
//鍔犺浇鎸囧畾鍦板尯鍦板浘
renderMapPoints("涔岄瞾鏈ㄩ綈甯�,鍏嬫媺鐜涗緷甯�,鍚愰瞾鐣競,鍝堝瘑甯�,鏄屽悏鍥炴棌鑷不宸�,鍗氬皵濉旀媺钂欏彜鑷不宸�,宸撮煶閮钂欏彜鑷不宸�,闃垮厠鑻忓湴鍖�,鍏嬪瓬鍕掕嫃鏌皵鍏嬪瓬鑷不宸�,鍠�浠�鍦板尯,鍜岀敯鍦板尯,浼婄妬鍝堣惃鍏嬭嚜娌诲窞,濉斿煄鍦板尯,闃垮嫆娉板湴鍖�");
- // 璇锋眰搴撳尯淇℃伅
- // ajaxDeptArea();
- // 鑾峰彇鍏徃淇℃伅
- // ajaxCompany();
- // 璇锋眰绮鏁伴噺缁熻淇℃伅
- // ajaxFoodNum();
- // 璇锋眰鑾峰彇搴撳尯鍔ㄦ�佷俊鎭�
+
+ //缁熻鐩稿叧鏁伴噺淇℃伅锛屽寘鍚簱鐐瑰強绮鏁伴噺
+ ajaxFoodNum();
+
+ //璇锋眰鐩戠搴撳尯淇℃伅
+ ajaxDeptList();
+
+ clearInterval(timer);
+ timing();
+
+ //TODO 璇锋眰AI浜嬩欢淇℃伅
// ajaxMsg();
+
+ //TODO 璇锋眰鎶撴媿璺熻釜淇℃伅
+ // ajaxFoodNum();
+
+
+
+ //鎶撴媿璺熻釜婊氬姩
+ jQuery(".block2").slide({ mainCell: ".bd ul", autoPage: true, effect: "topLoop", autoPlay: true, vis: 4 });
+ jQuery(".follow").slide({ mainCell: ".bd ul", autoPlay: true, effect: "leftMarquee", vis: 5, interTime: 50 });
}
// socket淇℃伅杩斿洖铏曠悊
function socketOnMessage(pocket) {
- //console.log(pocket);
- if (pocket.bizId == "slogan") {
+ if (pocket.bizId === "slogan") {
var data = pocket.data;
dicSlogan = data;
initDicSlogan();
}
+}
+
+/**
+ * 搴撳尯瀹氭椂鍒囨崲
+ */
+function timing() {
+ timer = setInterval(function() {
+ if(deptNum === deptList.length){
+ deptNum = 0;
+ }
+
+ renderDeptInfo();
+ deptNum += 1;
+ }, 5000);
}
//鍔犺浇搴撳尯鍦板浘浣嶇疆
@@ -94,15 +112,15 @@
geoMap = [];
for (var j = 0; j < names.length; j++) {
for (var i = 0; i < all.length; i++) {
- if(all[i].properties.name == names[j]){
+ if(all[i].properties.name === names[j]){
map.features.push(all[i]);
- if(all[i].properties.name == "浼婄妬鍝堣惃鍏嬭嚜娌诲窞"){
+ // 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();
+ // }
+ // renderMap();
break;
}
}
@@ -271,26 +289,6 @@
}
/**
- * 鑾峰彇鍏徃淇℃伅
- */
-function ajaxCompany() {
- $.ajax({
- type: "POST",
- url: "../../visual/index-company",
- dataType: "json",
- contentType: "application/json;charset=UTF-8",
- data: JSON.stringify({
- "companyId": companyId
- }),
- success: function (result) {
- if (result.code == "0000") {
- companyList = result.data;
- }
- }
- });
-}
-
-/**
* 璇锋眰鑾峰彇鍔ㄦ�佷俊鎭�
*/
function ajaxMsg() {
@@ -391,25 +389,43 @@
/**
* 璇锋眰鑾峰彇搴撳尯鐩稿叧淇℃伅
*/
-function ajaxDeptArea() {
- // $.ajax({
- // type: "POST",
- // url: "../../visual/index-dept-area",
- // dataType: "json",
- // contentType: "application/json;charset=UTF-8",
- // data: JSON.stringify({
- // "companyId": companyId
- // }),
- // success: function (result) {
- // if (result.code == "0000") {
- // deptAreaAllList = result.data;
- // getChangeDeptArea(null);
- // }
- // },
- // error: function (error) {
- //
- // }
- // });
+function ajaxDeptList() {
+ deptList = null;
+ $.ajax({
+ type: "POST",
+ url: "/group/index-dept-list",
+ dataType: "json",
+ contentType: "application/json;charset=UTF-8",
+ data: JSON.stringify({
+ "companyId": companyId
+ }),
+ success: function (result) {
+ if (result.code == "0000") {
+ deptList = result.data;
+ renderDeptInfo();
+ }
+ },
+ error: function (error) {
+
+ }
+ });
+}
+
+/**
+ * 娓叉煋搴撳尯淇℃伅
+ */
+function renderDeptInfo() {
+ if (deptList == null || deptList.length <= 0) {
+ return;
+ }
+
+ $("#county").html(deptList[deptNum].county);
+ $("#deptName").html(deptList[deptNum].deptName);
+ $("#inNum").html(deptList[deptNum].inNum);
+ $("#outNum").html(deptList[deptNum].outNum);
+ $("#depotNumber").html(deptList[deptNum].depotNumber);
+ $("#depotBankNumber").html(deptList[deptNum].depotBankNumber);
+ $("#storageNum").html(deptList[deptNum].storageNum);
//鍔犺浇搴撳尯鍦板浘
geoMap = updateDeptMap();
@@ -421,12 +437,12 @@
$.each(deptList, function(index, item) {
var val = [];
var name = '';
- // if(index == deptNum){
- // name = item.name;
- // val = [item.lon, item.lat, 17];
- // }else {
+ if(index === deptNum){
+ name = item.deptName;
+ val = [item.jd, item.wd, 17];
+ }else {
val = [item.jd, item.wd, 8];
- // }
+ }
points.push({
name: name,
value: val
@@ -518,19 +534,19 @@
}
/**
- * 璇锋眰鑾峰彇鐩稿叧鏁伴噺淇℃伅
+ * 璇锋眰鑾峰彇缁熻鏁伴噺淇℃伅
*/
function ajaxFoodNum() {
$.ajax({
type: "POST",
- url: "../../visual/index-food-number",
+ url: "/group/index-num",
dataType: "json",
contentType: "application/json;charset=UTF-8",
data: JSON.stringify({
"companyId": companyId
}),
success: function (result) {
- if (result.code == "0000") {
+ if (result.code === "0000") {
var data = result.data;
renderFoodNum(data);
}
@@ -541,7 +557,10 @@
});
}
-// 鏇存柊搴撳尯淇℃伅
+/**
+ * 娓叉煋缁熻鏁伴噺淇℃伅
+ * @param data
+ */
function renderFoodNum(data) {
if (!data) {
@@ -550,24 +569,17 @@
/*----- 鐩戠搴撶偣淇℃伅 -----*/
$("#companyNum").html(data.companyNum);
- $("#deptAreaNum").html(data.deptAreaNum);
- $("#depotSum").html(data.depotNum);
+ $("#deptNum").html(data.deptNum);
+ $("#depotNum").html(data.depotNum);
+ $("#depotBankNum").html(data.depotBankNum);
/*----- 鐩戠鏁伴噺淇℃伅 -----*/
- if (data.foodSum.length > 8 || data.oilSum.length > 8) {
+ if (data.foodSum.length > 8 || data.packFoodSum.length > 8) {
$("#foodSum").css("font-size", "32px");
- $("#oilSum").css("font-size", "32px");
+ $("#packFoodSum").css("font-size", "32px");
}
$("#foodSum").html(data.foodSum);
- $("#oilSum").html(data.oilSum);
-
- if (data.goodsFoodSum.length > 8 || data.goodsOilSum.length > 8) {
- $("#goodsFoodSum").css("font-size", "32px");
- $("#goodsOilSum").css("font-size", "32px");
- }
- $("#goodsFoodSum").html(data.goodsFoodSum);
- $("#goodsOilSum").html(data.goodsOilSum);
-
+ $("#packFoodSum").html(data.packFoodSum);
/*----- 鍒嗗搧绉嶆煴鐘跺浘 -----*/
if (data.xaxis.length > 0 && data.seriesData.length > 0) {
@@ -577,162 +589,6 @@
hisFoodVariety.chart.setOption(hisFoodVariety.option, true);
hisVarietyChart = hisFoodVariety;
}
-
- /*----- 楗煎浘 -----*/
- // 鍝佺 -- 绮
- if (data.varietyChartPie.length > 0) {
- var varietyChart = pieVarietyChart;
- varietyChart.option.series[0].data = data.varietyChartPie;
- varietyChart.chart.setOption(varietyChart.option, true);
- pieVarietyChart = varietyChart;
- }
- // 鎬ц川 -- 绮
- if (data.typeChartPie.length > 0) {
- var typeChart = pieTypeChart;
- typeChart.option.series[0].data = data.typeChartPie;
- typeChart.chart.setOption(typeChart.option, true);
- pieTypeChart = typeChart;
- }
- // 绛夌骇 -- 绮
- if (data.levelChartPie.length > 0) {
- var levelChart = pieLevelChart;
- levelChart.option.series[0].data = data.levelChartPie;
- levelChart.chart.setOption(levelChart.option, true);
- pieLevelChart = levelChart;
- }
- // 骞翠唤 -- 绮
- if (data.yearChartPie.length > 0) {
- var yearChart = pieYearChart;
- yearChart.option.series[0].data = data.yearChartPie;
- yearChart.chart.setOption(yearChart.option, true);
- pieYearChart = yearChart;
- }
- // 鍖哄煙 -- 绮
- if (data.areaChartPie.length > 0) {
- var areaChart = pieAreaChart;
- areaChart.option.series[0].data = data.areaChartPie;
- areaChart.chart.setOption(areaChart.option, true);
- pieAreaChart = areaChart;
- }
-
- // 绮鐩戠鏁伴噺鍒囨崲
- foodNumSwitch();
- // 绮楗煎浘鍒囨崲
- pieChartSwitch();
-}
-
-/* ---------- 绮鏁伴噺鐩戠鍒囨崲 ---------- */
-function foodNumSwitch() {
- $(".lb-body .right-topInfo-jg").eq(0).show().siblings().hide();
- StartLunbo();
-
- $(".lb-tab").hover(function () {
- clearInterval(timer2);
- index2 = $(this).index();
- ShowPicTab();
- }, function () {
- StartLunbo();
- });
-
- $(".lb-btn1").click(function () {
- clearInterval(timer2);
- index2--;
- if (index2 == -1) {
- index2 = number2 - 1;
- }
-
- ShowPicTab();
- StartLunbo();
- });
-
- $(".lb-btn2").click(function () {
- clearInterval(timer2);
- index2++;
- if (index2 == number2) {
- index2 = 0;
- }
- ShowPicTab();
- StartLunbo();
- });
-}
-
-function ShowPicTab() {
- if (index2 === 0) {
- $("#foodNumTitle").html("鍌ㄥ绮补");
- } else if (index2 === 1) {
- $("#foodNumTitle").html("鍟嗗搧绮补");
- }
- // else if (index2 === 2) {
- // $("#foodNumTitle").html("灏忓寘瑁呯伯娌�");
- // }
- $(".lb-body .right-topInfo-jg").eq(index2).fadeIn(300).siblings().fadeOut(300);
- $(".lb-tab").eq(index2).addClass("bg").siblings().removeClass("bg");
-}
-
-function StartLunbo() {
- timer2 = setInterval(function () {
- index2++;
- if (index2 >= number2) {
- index2 = 0;
- }
- ShowPicTab();
- }, 3000);
-}
-
-/* ---------- 绮楗煎浘鍒囨崲 ---------- */
-function pieChartSwitch() {
- $(".tubiao-Carousel .stats-chart-box").eq(0).show().siblings().hide();
- StartCarousel();
-
- $(".carousel-tab").hover(function () {
- clearInterval(timer3);
- index3 = $(this).index();
- ShowTubiao();
-
- }, function () {
- StartCarousel();
- });
-
- $(".carousel-btn1").click(function () {
- clearInterval(timer3);
- index3--;
- if (index3 == -1) {
- index3 = number3 - 1;
- }
-
- ShowTubiao();
- StartCarousel();
- });
-
- $(".carousel-btn2").click(function () {
- clearInterval(timer3);
- index3++;
- if (index3 == number3) {
- index3 = 0;
- }
- ShowTubiao();
- StartCarousel();
- });
-}
-
-function ShowTubiao() {
- if (index3 === 0) {
- $("#pieCharTitle").html("绮鏁伴噺缁熻(鍚�)");
- } else if (index3 === 1) {
- $("#pieCharTitle").html("娌硅剛鏁伴噺缁熻(鍚�)");
- }
- $(".tubiao-Carousel .stats-chart-box").eq(index3).fadeIn(300).siblings().fadeOut(300);
- $(".carousel-tab").eq(index3).addClass("bg").siblings().removeClass("bg");
-}
-
-function StartCarousel() {
- timer3 = setInterval(function () {
- index3++;
- if (index3 >= number3) {
- index3 = 0;
- }
- ShowTubiao();
- }, 3000);
}
// 鍒锋柊鏃堕棿
@@ -748,26 +604,6 @@
* 鍒濆鍖栧睆骞曞ぇ灏�
*/
function initScrollbar() {
-
- if (pieVarietyChart) {
- pieVarietyChart.resize();
- }
-
- if (pieTypeChart) {
- pieTypeChart.resize();
- }
-
- if (pieLevelChart) {
- pieLevelChart.resize();
- }
-
- if (pieYearChart) {
- pieYearChart.resize();
- }
-
- if (pieAreaChart) {
- pieAreaChart.resize();
- }
if (hisVarietyChart) {
hisVarietyChart.resize();
@@ -795,66 +631,14 @@
return document.getElementById('inventoryInfo').clientHeight > document.getElementById('inventoryInfoBox').clientHeight;
}
-// 鍒濆鍖栧浘琛�
+/**
+ * 鍒濆鍖栧浘琛�
+ */
function initChart() {
-
/* 搴撳瓨鍥捐〃鍔犺浇 */
allInventoryChartLoad(
['灏忛害', '鐜夌背', '绋昏胺', '鎴愬搧绮�', '鎴愬搧娌�', '鍏朵粬'],
[1000, 1200, 1500, 1300, 1100, 1600]
- );
-
- /* 鍝佺 - 绮 */
- pieChartLoad(
- [
- {value: 0, name: '绋昏胺'},
- {value: 0, name: '鐜夌背'},
- {value: 0, name: '灏忛害'}
- ],
- 'pieVarietyChart'
- );
- /* 鎬ц川 - 绮 */
- pieChartLoad(
- [
- {value: 0, name: '鐪佺骇鍌ㄥ'},
- {value: 0, name: '甯傜骇鍌ㄥ'},
- {value: 0, name: '鍘跨骇鍌ㄥ'}
- ],
- 'pieTypeChart'
- );
- /* 绛夌骇 - 绮 */
- pieChartLoad(
- [
- {value: 0, name: '涓�绛�'},
- {value: 0, name: '浜岀瓑'},
- {value: 0, name: '涓夌瓑'},
- {value: 0, name: '鍥涚瓑'},
- {value: 0, name: '浜旂瓑'},
- {value: 0, name: '绛夊'}
- ],
- 'pieLevelChart'
- );
- /* 骞翠唤 - 绮 */
- pieChartLoad(
- [
- {value: 0, name: '2019'},
- {value: 0, name: '2020'},
- {value: 0, name: '2021'},
- {value: 0, name: '2022'},
- {value: 0, name: '2023'}
-
- ],
- 'pieYearChart'
- );
- /* 鍦板煙 - 绮 */
- pieChartLoad(
- [
- {value: 0, name: '2019'},
- {value: 0, name: '2020'},
- {value: 0, name: '2021'},
- {value: 0, name: '2022'},
- {value: 0, name: '2023'}
- ], 'pieAreaChart'
);
}
@@ -975,97 +759,6 @@
};
myChart.setOption(options);
hisVarietyChart = {"chart": myChart, "option": options};
-}
-
-/**
- * 楗煎浘鍔犺浇
- *
- * @param obj
- * @param id
- */
-function pieChartLoad(data, id) {
- var dom = document.getElementById(id);
- var pieChart = echarts.init(dom);
-
- var option = {
- tooltip: {
- trigger: 'item'
- },
- legend: {
- bottom: 10,
- right: 10,
- left: 10,
- textStyle: {
- color: '#fff',
- fontSize: 12
- },
- itemWidth: 8,
- itemHeight: 8,
- icon: "circle",
- // 浣跨敤鍥炶皟鍑芥暟
- formatter:function(name) {
-
- var than = option.series[0].data;
- var total = 0;
- var tarValue;
- for (var i = 0, l = than.length; i < l; i++) {
- total += Number(than[i].value);
- if (than[i].name == name) {
- tarValue = Number(than[i].value);
- }
- }
- var p = 0.0;
- if(total > 0){
- p = (tarValue / total) * 100;
- }
- return name + " " + " " + p.toFixed(2) + "%";
- }
- },
-
- color: ['#26a2cf', '#d36b37', '#d49327', '#2d6be9', '#36b994', '#bc2032', '#d3614f'],
- series: [
- {
- name: '',
- type: 'pie',
- radius: ['20%', '50%'],
- center: ['center', '30%'],
- avoidLabelOverlap: false,
- itemStyle: {
- borderRadius: 10,
- borderColor: '#041636',
- borderWidth: 8,
- },
- label: {
- show: false,
- color: '#fff',
- formatter: '{b}\n{d}%',
- fontSize: nowSize(16),
- lineHeight: nowSize(25),
- },
- labelLine: {
- show: true,
- lineStyle: {
- cap: 'round',
- }
- },
- data: data
- }
- ]
- };
-
- pieChart.setOption(option);
-
- if (id === 'pieVarietyChart') {
- pieVarietyChart = {"chart": pieChart, "option": option};
- } else if (id === 'pieTypeChart') {
- pieTypeChart = {"chart": pieChart, "option": option};
- } else if (id === 'pieLevelChart') {
- pieLevelChart = {"chart": pieChart, "option": option};
- } else if (id === 'pieYearChart') {
- pieYearChart = {"chart": pieChart, "option": option};
- } else if (id === 'pieAreaChart') {
- pieAreaChart = {"chart": pieChart, "option": option};
- }
}
/**
--
Gitblit v1.9.3