function getTeamNum() { Ajax().post({ headers: { "encrypt": sm3(JSON.stringify({})) }, url: dataUrl + 'proteam/pot/teamNew/getTeamNum', data: {}, async: true, success: function (data) { var cityName = []; var perNum = []; //人员数量 var teamNum = []; //班组数量 var perNums = 0; var teamNums = 0; if (data.code === 200) { $.each(data.data, function (index, item) { cityName.push(item.cityName); perNum.push(item.perNum); teamNum.push(item.teamNum); perNums += parseInt(item.perNum); teamNums += parseInt(item.teamNum); }) initEchartsOne(cityName, perNum, teamNum) } document.getElementById("teamNums").innerText = teamNums; document.getElementById("perNums").innerText = perNums; } }); } function initEchartsOne(cityName, perNum, teamNum) { let option = { tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } }, legend: { top: '2%', data: ['班组数', '人员数'], textStyle: { color: '#ffffff' //字体颜色 }, }, dataZoom: [{ type: 'inside', zoomOnMouseWheel: false, moveOnMouseMove: true, moveOnMouseWheel: true, startValue: 0, endValue: 6, },], grid: { left: '3%', right: '8%', bottom: '5%', top: '22%', containLabel: true }, yAxis: { type: 'value', splitLine: { show: true, lineStyle: { color: '#0B4CA9', } }, axisLine: { lineStyle: { color: '#0B4CA9' } }, axisTick: { show: false }, axisLabel: { color: '#ffffff', fontSize: 14, fontFamily: 'Alibaba PuHuiTi R' } }, xAxis: { type: 'category', data: cityName, axisLine: { lineStyle: { color: '#0B4CA9' } }, axisTick: { show: false }, axisLabel: { interval: 0, // 解决x轴名称过长问题 color: '#ffffff', fontSize: 14, fontFamily: 'Alibaba PuHuiTi R' } }, series: [{ name: '班组数', type: 'bar', barWidth: 12, barGap: '40%', data: teamNum, itemStyle: { color: '#77D3FF' }, label: { show: true, position: 'top', color: '#FFFFFF' } }, { name: '人员数', type: 'bar', barWidth: 12, barGap: '40%', data: perNum, itemStyle: { color: '#6EFFF5' }, label: { show: true, position: 'top', color: '#FFFFFF' } } ] } // 为echarts对象加载数据 myChart12.setOption(option); myChart12.on('mousemove', stop); myChart12.on('globalout', goMove); autoMove(); // 自动滚动 function autoMove() { if (cityName != null && cityName.length > 0) { clearInterval(timeOut12); //自动滚动 timeOut12 = setInterval(() => { if (option.dataZoom[0].endValue === cityName.length) { option.dataZoom[0].endValue = 6; option.dataZoom[0].startValue = 0; } else { option.dataZoom[0].endValue = option.dataZoom[0].endValue + 1; option.dataZoom[0].startValue = option.dataZoom[0].startValue + 1; } myChart12.setOption(option); }, 4000); } } //停止滚动 function stop() { clearInterval(timeOut12); } //继续滚动 function goMove() { autoMove(); } myChart12.on('click', function (params) { var name = params.name; // 城市名称 var seriesName = params.seriesName; //柱状图的名称 openWorkerPostInfo(name, seriesName); }); window.addEventListener("resize", function () { myChart12.resize(); }); } function openWorkerPostInfo(name, seriesName) { let width = getNewDefaultWidth().toFixed(0) + "px"; let height = getNewDefaultHeight().toFixed(0) + "px"; let layerIndex = layer.open({ id: "workerPostInfo", title: false, type: 2, maxmin: false, skin: "my-skin child-skin", content: 'workerPostInfo.html', area: [width, height], shade: 0.65, closeBtn: 0, success: function (layero, index) { let iframeWin = window["layui-layer-iframe" + layerIndex]; iframeWin.setParams(name, seriesName); $(window).resize(function () { if (autoNewResizeWidth) autoNewResizeWidth(index); if (autoNewResizeHeight) autoNewResizeHeight(index); }); } }); } //日风险 function getDayRiskNum() { Ajax().post({ headers: { "encrypt": sm3(JSON.stringify({})) }, url: dataUrl + 'proteam/pot/dailyRisk/getDayRiskByEcharts', data: {}, async: true, success: function (result) { if (result.code === 200) { initEchartsTwo(result.data.orgList, result.data.orgNameList, result.data.twoRiskList, result.data.threeRiskList, result.data.fourRiskList, result.data.fiveRiskList) } } }); } function initEchartsTwo(orgList, orgNameList, twoRiskList, threeRiskList, fourRiskList, fiveRiskList) { let option = { tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' }, }, legend: { x: 'center', y: '10px', textStyle: { color: '#f2f2f2', fontSize: 13, }, icon: 'circle', data: ['二级', '三级'] }, dataZoom: [{ type: 'inside', zoomOnMouseWheel: false, moveOnMouseMove: true, moveOnMouseWheel: true, startValue: 0, endValue: 6, },], grid: { left: '3%', right: '8%', bottom: '2%', top: '28%', containLabel: true }, xAxis: [{ type: 'category', data: orgNameList, nameTextStyle: { color: '#fff' }, axisLine: { lineStyle: { color: '#0B4CA9' } }, axisTick: { show: false, }, axisLabel: { show: true, textStyle: { color: "#fff", fontSize: 14, fontFamily: 'Alibaba PuHuiTi R' }, interval: 0, //rotate:30 }, }], yAxis: [{ type: 'value', nameTextStyle: { color: '#fff' }, position: 'left', axisLine: { lineStyle: { color: '#0B4CA9' } }, splitLine: { lineStyle: { color: "#0B4CA9", } }, axisLabel: { color: '#fff', fontSize: 14, fontFamily: 'Alibaba PuHuiTi R' }, },], series: [{ name: '二级', type: 'line', yAxisIndex: 0, symbolSize: 8, itemStyle: { normal: { color: '#DD690B', } }, label: { show: true, position: 'top', color: '#FFFFFF' }, data: twoRiskList }, { name: '三级', type: 'line', yAxisIndex: 0, symbolSize: 8, itemStyle: { normal: { color: '#FFE91F', } }, label: { show: true, position: 'top', color: '#FFFFFF' }, data: threeRiskList }, ] } // 为echarts对象加载数据 myChart11.setOption(option); myChart11.on('mousemove', stop); myChart11.on('globalout', goMove); autoMove(); // 自动滚动 function autoMove() { if (orgNameList != null && orgNameList.length > 0) { clearInterval(timeOut11); //自动滚动 timeOut11 = setInterval(() => { if (option.dataZoom[0].endValue === orgNameList.length) { option.dataZoom[0].endValue = 6; option.dataZoom[0].startValue = 0; } else { option.dataZoom[0].endValue = option.dataZoom[0].endValue + 1; option.dataZoom[0].startValue = option.dataZoom[0].startValue + 1; } myChart11.setOption(option); }, 4000); } } //停止滚动 function stop() { clearInterval(timeOut11); } //继续滚动 function goMove() { autoMove(); } myChart11.off('click').on('click', function (params) { let name = params.name; let seriesName = params.seriesName; openDayRisk(name, seriesName); }); window.addEventListener("resize", function () { myChart11.resize(); }); } //优良率 function getExcellRateByOrg(type) { clearInterval(interval); $("#awards").removeClass("main-right-box4-btn"); $("#excellRate").removeClass("main-right-box4-btns"); $("#awards").addClass("main-right-box4-btns"); $("#excellRate").addClass("main-right-box4-btn"); $("#construction").show() $("#awardsText").hide(); if (type) { myChart10.dispose(); myChart10 = echarts.init(document.getElementById('construction')); } Ajax().post({ headers: { "encrypt": sm3(JSON.stringify({})) }, url: dataUrl + 'proteam/pot/greenBuild/getExcellRateByOrg', data: {}, async: true, success: function (result) { if (result.code === 200) { initEchartsThree(result.data.orgList, result.data.excellList) } } }); } function initEchartsThree(orgList, excellList) { let option = { backgroundColor: 'transparent', tooltip: { axisPointer: { // 坐标轴指示器,坐标轴触发有效 type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' }, trigger: 'axis', confine: true, }, dataZoom: [{ type: 'inside', zoomOnMouseWheel: false, moveOnMouseMove: true, moveOnMouseWheel: true, startValue: 0, endValue: 6, },], grid: { left: '2%', right: '4%', bottom: '2%', top: '30px', containLabel: true, }, legend: { show: false }, xAxis: { type: 'category', axisLine: { lineStyle: { color: '#0B4CA9', }, }, axisLabel: { interval: 0, fontSize: 14, color: '#fff', fontFamily: 'Alibaba PuHuiTi R' }, axisTick: { show: false, }, data: orgList, }, yAxis: { type: 'value', min: 0, minInterval: 1, nameTextStyle: { fontSize: 12, color: '#BAE7FF', align: 'center', }, splitLine: { lineStyle: { color: '#0B4CA9', }, }, splitArea: {show: false}, axisLine: { show: false, }, axisTick: { show: false, }, axisLabel: { show: false }, }, series: [ { name: '优良率', type: 'bar', barWidth: '2', tooltip: { show: false }, itemStyle: { normal: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, color: 'rgba(3,227,247,0.3)', }, { offset: 1, color: 'rgba(3,227,247,0.3)', }, ]), barBorderRadius: 6, }, }, data: excellList }, { name: '优良率', smooth: true, showAllSymbol: true, //显示所有图形。 symbol: "circle", //标记的图形为实心圆 symbolSize: 4, //标记的大小 itemStyle: { //折线拐点标志的样式 normal: { color: "#03e3f7", borderWidth: 4, shadowColor: "#03e3f7", shadowBlur: 10, borderColor: "#03e3f7" } }, label: { show: true, position: 'top', color: '#fff' }, type: 'line', data: excellList, // 纵坐标数据 barWidth: 2, areaStyle: { // 区域颜色 color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: 'rgba(12,227,247,0.3)', }, { offset: 1, color: 'rgba(12,227,247,0.1)', }]), }, }, ], }; // 为echarts对象加载数据 myChart10.setOption(option); myChart10.on('mousemove', stop); myChart10.on('globalout', goMove); autoMove(); // 自动滚动 function autoMove() { if (orgList != null && orgList.length > 0) { clearInterval(timeOut10); //自动滚动 timeOut10 = setInterval(() => { if (option.dataZoom[0].endValue === orgList.length) { option.dataZoom[0].endValue = 6; option.dataZoom[0].startValue = 0; } else { option.dataZoom[0].endValue = option.dataZoom[0].endValue + 1; option.dataZoom[0].startValue = option.dataZoom[0].startValue + 1; } myChart10.setOption(option); }, 4000); } } //停止滚动 function stop() { clearInterval(timeOut10); } //继续滚动 function goMove() { autoMove(); } window.addEventListener("resize", function () { myChart10.resize(); }); } //获奖情况 function getAwardsList() { $("#awards").removeClass("main-right-box4-btns"); $("#excellRate").removeClass("main-right-box4-btn"); $("#awards").addClass("main-right-box4-btn"); $("#excellRate").addClass("main-right-box4-btns"); $("#construction").hide(); $("#awardsText").show(); Ajax().post({ headers: { "encrypt": sm3(JSON.stringify({})) }, url: dataUrl + 'proteam/pot/greenBuild/getAwardsList', data: {}, async: true, success: function (result) { if (result.code === 200) { var html = ''; html += '' $("#awardsText").html(html); setTimeout(scrollAwards,1000) } } }); } //工程统计 function getProPlanStatis() { Ajax().post({ headers: { "encrypt": sm3(JSON.stringify({})) }, url: dataUrl + 'proteam/pot/tysj/getProPlanStatis', data: {}, async: true, success: function (result) { console.log(result) if (result.code === 200) { $('#kg-bd').html(result.data.bdkgwcl + '%') $('#kg-xl').html(result.data.xlkgwcl + '%') $('#tc-bd').html(result.data.bdtcwcl + '%') $('#tc-xl').html(result.data.xltcwcl + '%') $('#kg-pj').html(result.data.kgpz + '%') $('#tc-pj').html(result.data.tcpz + '%') } } }); } //环水保 function getEiaNum() { Ajax().post({ headers: { "encrypt": sm3(JSON.stringify({})) }, url: dataUrl + 'proteam/pot/teamNew/getEiaNum', data: {}, async: true, success: function (result) { if (result.code === 200) { $.each(result.data, function (index, item) { $('#' + item.type).text(item.num) }) } } }); } //工程造价 function getProZj() { Ajax().post({ headers: { "encrypt": sm3(JSON.stringify({})) }, url: dataUrl + 'proteam/pot/tysj/getProZj', data: {}, async: true, success: function (result) { if (result.code === 200) { document.getElementById("jrPro").innerText = result.data.jrPro + ""; document.getElementById("jsPro").innerText = result.data.jsPro + ""; document.getElementById("wclPro").innerText = result.data.wclPro + ""; } } }); } //工程技术 function getGcjsNum() { Ajax().post({ headers: { "encrypt": sm3(JSON.stringify({})) }, url: dataUrl + 'proteam/pot/tysj/getGcjsNum', data: {}, async: true, success: function (result) { if (result.code === 200) { document.getElementById("tysj").innerText = result.data.data.tysj + ""; document.getElementById("sjwt").innerText = result.data.data.sjwt + ""; document.getElementById("sbyy").innerText = result.data.data.sbyy + ""; } } }); } //工程统计 function getProStatisNum(proType) { getCssPattern(proType); Ajax().post({ headers: { "encrypt": sm3(JSON.stringify({proType: proType})) }, url: dataUrl + 'proteam/pot/tysj/getProStatisNum', data: {proType: proType}, async: true, success: function (result) { if (result.code === 200) { document.getElementById("sgNum").innerHTML = result.data.sgNum; document.getElementById("tgNum").innerHTML = result.data.tgNum; document.getElementById("zjNum").innerHTML = result.data.zjNum; } } }); } function getCssPattern(proType) { $("#all").removeClass("main-right-box4-btn"); $("#sub").removeClass("main-right-box4-btn"); $("#line").removeClass("main-right-box4-btn"); switch (proType) { case "01": $("#sub").addClass("main-right-box4-btn"); break; case "03": $("#line").addClass("main-right-box4-btn"); break; default: $("#all").addClass("main-right-box4-btn"); break; } }