From a882cebac01ff2c69b4b78429ac8524500995bf1 Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Fri, 24 Jan 2025 15:07:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=80=BC=E7=8F=AD=E5=B7=A5=E4=BD=9C=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E3=80=81=E5=BC=82=E5=B8=B8=E4=B8=8A=E6=8A=A5=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bns/html/dutyTask/abnormalRepStatistics.html | 2 + bns/html/dutyTask/dutyStatistic.html | 2 + bns/html/dutyTask/newTodayTask.html | 2 + .../dutyTask/violation/abnormalReporting.html | 56 +++ .../violation/dutyWorkStatistics.html | 56 +++ bns/js/dutyTask/abnormalRepStatistics.js | 20 + bns/js/dutyTask/dutyStatistic.js | 19 + bns/js/dutyTask/newTodayTask.js | 21 ++ .../dutyTask/violation/abnormalReporting.js | 343 +++++++++++++++++ .../dutyTask/violation/dutyWorkStatistics.js | 349 ++++++++++++++++++ bns/js/dutyTask/violationStatistics.js | 2 +- 11 files changed, 871 insertions(+), 1 deletion(-) create mode 100644 bns/html/dutyTask/violation/abnormalReporting.html create mode 100644 bns/html/dutyTask/violation/dutyWorkStatistics.html create mode 100644 bns/js/dutyTask/violation/abnormalReporting.js create mode 100644 bns/js/dutyTask/violation/dutyWorkStatistics.js diff --git a/bns/html/dutyTask/abnormalRepStatistics.html b/bns/html/dutyTask/abnormalRepStatistics.html index 3976648..98e849f 100644 --- a/bns/html/dutyTask/abnormalRepStatistics.html +++ b/bns/html/dutyTask/abnormalRepStatistics.html @@ -77,6 +77,8 @@ style="background-color: #2F82FB;" onclick="query(1)">查询 + diff --git a/bns/html/dutyTask/dutyStatistic.html b/bns/html/dutyTask/dutyStatistic.html index d5ed014..72d9973 100644 --- a/bns/html/dutyTask/dutyStatistic.html +++ b/bns/html/dutyTask/dutyStatistic.html @@ -52,6 +52,8 @@ src="../../img/common-icon/export-icon.png">

导出

+ diff --git a/bns/html/dutyTask/newTodayTask.html b/bns/html/dutyTask/newTodayTask.html index bb77a74..99e4916 100644 --- a/bns/html/dutyTask/newTodayTask.html +++ b/bns/html/dutyTask/newTodayTask.html @@ -151,6 +151,8 @@

导出

--> + diff --git a/bns/html/dutyTask/violation/abnormalReporting.html b/bns/html/dutyTask/violation/abnormalReporting.html new file mode 100644 index 0000000..ed39fb9 --- /dev/null +++ b/bns/html/dutyTask/violation/abnormalReporting.html @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + 异常上报统计 + + + +
+
+
+ + + + \ No newline at end of file diff --git a/bns/html/dutyTask/violation/dutyWorkStatistics.html b/bns/html/dutyTask/violation/dutyWorkStatistics.html new file mode 100644 index 0000000..ca1032f --- /dev/null +++ b/bns/html/dutyTask/violation/dutyWorkStatistics.html @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + 值班工作统计 + + + +
+
+
+ + + + \ No newline at end of file diff --git a/bns/js/dutyTask/abnormalRepStatistics.js b/bns/js/dutyTask/abnormalRepStatistics.js index 932669c..f8ce437 100644 --- a/bns/js/dutyTask/abnormalRepStatistics.js +++ b/bns/js/dutyTask/abnormalRepStatistics.js @@ -353,4 +353,24 @@ function setRiskLevel() { arr: keys }); layui.form.render(); +} + +function vioStatistics(){ + let title = '异常上报统计'; + let layerIndex = layer.open({ + id: 'viewTicket', + type: 2, + title: ['
' + title + '
', 'font-size:16px;background-color:#f0f0f0;display: flex;align-items: center;'], + content: './violation/abnormalReporting.html', + shade: 0.3, + anim: 2, + shadeClose: false, + area: ['80%', '90%'], + move: false, + success: function () { + let iframeWin = window["layui-layer-iframe" + layerIndex]; + }, + cancel: function () { }, + end: function () { } + }); } \ No newline at end of file diff --git a/bns/js/dutyTask/dutyStatistic.js b/bns/js/dutyTask/dutyStatistic.js index 7ad92ec..7aa23d5 100644 --- a/bns/js/dutyTask/dutyStatistic.js +++ b/bns/js/dutyTask/dutyStatistic.js @@ -211,3 +211,22 @@ function query() { } +function vioStatistics(){ + let title = '值班工作统计'; + let layerIndex = layer.open({ + id: 'viewTicket', + type: 2, + title: ['
' + title + '
', 'font-size:16px;background-color:#f0f0f0;display: flex;align-items: center;'], + content: './violation/vioStatistics.html', + shade: 0.3, + anim: 2, + shadeClose: false, + area: ['80%', '90%'], + move: false, + success: function () { + let iframeWin = window["layui-layer-iframe" + layerIndex]; + }, + cancel: function () { }, + end: function () { } + }); +} \ No newline at end of file diff --git a/bns/js/dutyTask/newTodayTask.js b/bns/js/dutyTask/newTodayTask.js index bf0c195..c2bd0d4 100644 --- a/bns/js/dutyTask/newTodayTask.js +++ b/bns/js/dutyTask/newTodayTask.js @@ -724,4 +724,25 @@ function setTrBackgroundColor(value) { // 违章信息 function openNewDetail2() { parent.openNewTab('../dutyTask/violationStatistics.html', '19', '违章统计') +} + + +function dutyWorkStatistics(){ + let title = '值班工作统计'; + let layerIndex = layer.open({ + id: 'viewTicket', + type: 2, + title: ['
' + title + '
', 'font-size:16px;background-color:#f0f0f0;display: flex;align-items: center;'], + content: './violation/dutyWorkStatistics.html', + shade: 0.3, + anim: 2, + shadeClose: false, + area: ['80%', '90%'], + move: false, + success: function () { + let iframeWin = window["layui-layer-iframe" + layerIndex]; + }, + cancel: function () { }, + end: function () { } + }); } \ No newline at end of file diff --git a/bns/js/dutyTask/violation/abnormalReporting.js b/bns/js/dutyTask/violation/abnormalReporting.js new file mode 100644 index 0000000..95737db --- /dev/null +++ b/bns/js/dutyTask/violation/abnormalReporting.js @@ -0,0 +1,343 @@ +let form, layer, laydate; +let user = getUser(); +let myChart12 = echarts.init(document.getElementById('echarts-one')); +layui.use(['form', 'layer', 'laydate'], function () { + layer = layui.layer; + form = layui.form; + laydate = layui.laydate; + laydate.render({ + elem: '#ID-laydate-rangeLinked', + range: ['#startDay', '#endDay'], + rangeLinked: true, + btns: ['confirm'] + }); + $('#startDay').val(getNowTime()); + $('#endDay').val(getNowTime()); + form.render(); + getVioStatistics(); +}); + +// 查询 +function query() { + myChart12.dispose(); + myChart12 = echarts.init(document.getElementById('echarts-one')); + getVioStatistics(); +} + +function getVioStatistics() { + let param = { + startTime: $('#startDay').val(), + endTime: $('#endDay').val(), + currentUserId: user.userId + '', + isSup: user.isSup, + currentUserOrgId: user.orgId + }; + $.ajax({ + headers: { + "encrypt": sm3(JSON.stringify(param)) + }, + url: dataUrl + 'proteam/pot/superStatistics/getVioStatistics?token=' + token, + data: param, + type: 'POST', + async: true, + success: function (result) { + if (result.code === 200) { + initEchartsOne(result.data); + } else if (result.code === 401) { + logout(1) + } + }, error: function () { + } + }); +} + +// 导出 +function exportExcel() { + let startTime = $("#startDay").val(), + endTime = $("#endDay").val(), + currentUserId = user.userId + '', + isSup = user.isSup, + currentUserOrgId = user.orgId; + let loadingMsg = layer.msg("数据导出中,请稍候...", { icon: 16, scrollbar: false, time: 0, }); + let url = dataUrl + "proteam/pot/superStatistics/exportExcel?startTime=" + startTime + "&endTime=" + endTime + "¤tUserId=" + currentUserId + "&isSup=" + isSup + "¤tUserOrgId=" + currentUserOrgId + "&token=" + token; + let xhr = new XMLHttpRequest(); + xhr.open("get", url, true); + xhr.responseType = "blob"; // 转换流 + xhr.setRequestHeader("encrypt", + sm3(JSON.stringify({ + startTime: startTime, + endTime: endTime, + currentUserId: currentUserId, + isSup: isSup, + currentUserOrgId: currentUserOrgId + }))); + xhr.setRequestHeader('encryption','encryption'); + xhr.setRequestHeader('token',token); + xhr.onload = function () { + layer.close(loadingMsg); + if (this.status === 200) { + let blob = this.response; + var a = document.createElement("a"); + var url = window.URL.createObjectURL(blob); + a.href = url; + a.download = startTime + '至' + endTime + "违章统计" + ".xlsx"; // 文件名 + } else { + layer.msg("服务异常,请稍后重试", { icon: 16, scrollbar: false, time: 2000 }); + } + a.click(); + window.URL.revokeObjectURL(url); + }; + xhr.send(); +} + +/*按违章等级统计-echarts*/ +function initEchartsOne(list) { + list = [{orgName:'合肥',classNum:30,vioNum:3,vioRate:10}, + {orgName:'芜湖',classNum:42,vioNum:5,vioRate:11}, + {orgName:'滁州',classNum:11,vioNum:2,vioRate:18}, + {orgName:'马鞍山',classNum:21,vioNum:3,vioRate:14}, + {orgName:'宣城',classNum:21,vioNum:3,vioRate:14}, + ]; + let myData5 = []; // 地市 + let fwrs = []; // 站班会数量 + let xdrs = []; // 违章数量 + let zhl = []; // 违章率 + $.each(list, function (index, item) { + myData5.push(item.orgName); + fwrs.push(item.classNum); + xdrs.push(item.vioNum); + zhl.push(item.vioRate); + }) + let option = { + backgroundColor: "transparent", + tooltip: { + trigger: "axis", + axisPointer: { + type: "shadow", + }, + textStyle: { + color: "#fff", + }, + backgroundColor: "rgba(0, 58, 99, 0.8)", //设置背景颜色 + borderColor: "rgba(0, 58, 99, 0.8)", + confine: true, + formatter: `{b}
{a}:{c}个
{a1}:{c1}个
{a2}:{c2}个`, + }, + legend: { + itemWidth: 12, + itemHeight: 8, + itemGap: 20, + right: "2%", + top: "3%", + x: "center", + textStyle: { + fontSize: 14, + color: "#000", + }, + // data: ["站班会数量", "违章数量", "违章占比"], + data: ["站班会数量", "异常上报数量", "上报占比"], + // data: ["已完成", "未完成", "任务数"], + selectedMode: false, + }, + grid: { + top: "8%", + left: "2%", + right: "2%", + bottom: "2%", + containLabel: true, + }, + xAxis: { + type: "category", + data: myData5, + axisLabel: { + color: "#000", + interval: 0, + fontSize: 12, + }, + axisLine: { + show: true, + lineStyle: { + color: "rgba(127, 214, 255, .4)", + }, + }, + splitLine: { + show: false, + }, + axisTick: { + show: false, + }, + }, + yAxis: [ + { + type: "value", + name: "数量 / 个", + splitNumber: 5, + nameTextStyle: { + color: "#000", + fontSize: 12, + align: "center", + // padding: [0, 20, 5, 0], + }, + axisLabel: { + formatter: "{value}", + color: "rgba(95, 187, 235, 1)", + textStyle: { + fontSize: 14, + color: "#000", + lineHeight: 16, + }, + }, + axisTick: { + show: false, + }, + splitLine: { + show: true, + lineStyle: { + color: "rgba(28, 130, 197, .3)", + type: "dashed", + }, + }, + }, + { + name: "违章占比 / %", + // name: "任务数", + splitNumber: 5, + max: 100, + type: "value", + nameTextStyle: { + color: "#000", + fontSize: 12, + align: "center", + // padding: [0, 0, 5, 0], + }, + axisLabel: { + show: true, + fontSize: 12, + color: "#000", + }, + axisLine: { + show: false, + }, + axisTick: { + show: false, + }, + splitLine: { + show: false, + }, + }, + ], + series: [ + { + name: "站班会数量", + type: "bar", + data: fwrs, + barWidth: "15px", + barGap: "50%", + itemStyle: { + normal: { + borderColor: "#3681FF", + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: "rgba(15, 51, 82, 1)", + }, + + { + offset: 1, + color: "rgba(0, 168, 255, 1)", + }, + ]), + }, + }, + label: { + show: true, + position: "top", + fontSize: 12, + color: "#000", + offset: [0, -5], + formatter: "{c}", + }, + }, + { + // name: "违章数量", + name: "异常上报数量", + // name: "未完成", + type: "bar", + data: xdrs, + barWidth: "15px", + barGap: "50%", + itemStyle: { + normal: { + borderColor: "rgba(54, 234, 255, 1)", + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: "rgba(15, 51, 82, 1)", + }, + + { + offset: 1, + color: "rgba(21, 219, 203, 1)", + }, + ]), + }, + }, + label: { + show: true, + position: "top", + fontSize: 12, + color: "#000", + offset: [0, -5], + formatter: "{c}", + }, + }, + { + // name: "违章占比", + name: "上报占比", + // name: "任务数", + type: "line", + yAxisIndex: 1, + showSymbol: true, + symbolSize: 8, + smooth: true, + symbol: "circle", + lineStyle: { + normal: { + color: "#02D6B0", + }, + }, + itemStyle: { + color: "#02D6B0", + borderColor: "#fff", + borderWidth: 1, + }, + areaStyle: { + normal: { + color: new echarts.graphic.LinearGradient( + 0, + 0, + 0, + 1, + [ + { + offset: 0, + color: "rgba(0, 255, 246, 0.5)", + }, + { + offset: 1, + color: "rgba(0, 255, 246, 0)", + }, + ], + false + ), + }, + }, + data: zhl, // 折线图的数据 + }, + ], + }; + myChart12.setOption(option, true); + window.addEventListener("resize", function () { + myChart12.resize(); + }); +} \ No newline at end of file diff --git a/bns/js/dutyTask/violation/dutyWorkStatistics.js b/bns/js/dutyTask/violation/dutyWorkStatistics.js new file mode 100644 index 0000000..f4b6b5b --- /dev/null +++ b/bns/js/dutyTask/violation/dutyWorkStatistics.js @@ -0,0 +1,349 @@ +let form, layer, laydate; +let user = getUser(); +let myChart12 = echarts.init(document.getElementById('echarts-one')); +layui.use(['form', 'layer', 'laydate'], function () { + layer = layui.layer; + form = layui.form; + laydate = layui.laydate; + laydate.render({ + elem: '#ID-laydate-rangeLinked', + range: ['#startDay', '#endDay'], + rangeLinked: true, + btns: ['confirm'] + }); + $('#startDay').val(getNowTime()); + $('#endDay').val(getNowTime()); + form.render(); + getVioStatistics(); +}); + +// 查询 +function query() { + myChart12.dispose(); + myChart12 = echarts.init(document.getElementById('echarts-one')); + getVioStatistics(); +} + +function getVioStatistics() { + let param = { + startTime: $('#startDay').val(), + endTime: $('#endDay').val(), + currentUserId: user.userId + '', + isSup: user.isSup, + currentUserOrgId: user.orgId + }; + $.ajax({ + headers: { + "encrypt": sm3(JSON.stringify(param)) + }, + url: dataUrl + 'proteam/pot/superStatistics/getVioStatistics?token=' + token, + data: param, + type: 'POST', + async: true, + success: function (result) { + if (result.code === 200) { + initEchartsOne(result.data); + } else if (result.code === 401) { + logout(1) + } + }, error: function () { + } + }); +} + +// 导出 +function exportExcel() { + let startTime = $("#startDay").val(), + endTime = $("#endDay").val(), + currentUserId = user.userId + '', + isSup = user.isSup, + currentUserOrgId = user.orgId; + let loadingMsg = layer.msg("数据导出中,请稍候...", { icon: 16, scrollbar: false, time: 0, }); + let url = dataUrl + "proteam/pot/superStatistics/exportExcel?startTime=" + startTime + "&endTime=" + endTime + "¤tUserId=" + currentUserId + "&isSup=" + isSup + "¤tUserOrgId=" + currentUserOrgId + "&token=" + token; + let xhr = new XMLHttpRequest(); + xhr.open("get", url, true); + xhr.responseType = "blob"; // 转换流 + xhr.setRequestHeader("encrypt", + sm3(JSON.stringify({ + startTime: startTime, + endTime: endTime, + currentUserId: currentUserId, + isSup: isSup, + currentUserOrgId: currentUserOrgId + }))); + xhr.setRequestHeader('encryption','encryption'); + xhr.setRequestHeader('token',token); + xhr.onload = function () { + layer.close(loadingMsg); + if (this.status === 200) { + let blob = this.response; + var a = document.createElement("a"); + var url = window.URL.createObjectURL(blob); + a.href = url; + a.download = startTime + '至' + endTime + "违章统计" + ".xlsx"; // 文件名 + } else { + layer.msg("服务异常,请稍后重试", { icon: 16, scrollbar: false, time: 2000 }); + } + a.click(); + window.URL.revokeObjectURL(url); + }; + xhr.send(); +} + +/*按违章等级统计-echarts*/ +function initEchartsOne(list) { + /* list = [{orgName:'合肥',classNum:30,vioNum:3,vioRate:10}, + {orgName:'芜湖',classNum:42,vioNum:5,vioRate:11}, + {orgName:'滁州',classNum:11,vioNum:2,vioRate:18}, + {orgName:'马鞍山',classNum:21,vioNum:3,vioRate:14}, + {orgName:'宣城',classNum:21,vioNum:3,vioRate:14}, + ]; */ + list = [{orgName:'合肥',classNum:15,vioNum:36,vioRate:51}, + {orgName:'芜湖',classNum:12,vioNum:18,vioRate:30}, + {orgName:'滁州',classNum:46,vioNum:23,vioRate:69}, + {orgName:'马鞍山',classNum:22,vioNum:6,vioRate:28}, + {orgName:'宣城',classNum:12,vioNum:3,vioRate:15}, + ]; + let myData5 = []; // 地市 + let fwrs = []; // 站班会数量 + let xdrs = []; // 违章数量 + let zhl = []; // 违章率 + $.each(list, function (index, item) { + myData5.push(item.orgName); + fwrs.push(item.classNum); + xdrs.push(item.vioNum); + zhl.push(item.vioRate); + }) + let option = { + backgroundColor: "transparent", + tooltip: { + trigger: "axis", + axisPointer: { + type: "shadow", + }, + textStyle: { + color: "#fff", + }, + backgroundColor: "rgba(0, 58, 99, 0.8)", //设置背景颜色 + borderColor: "rgba(0, 58, 99, 0.8)", + confine: true, + formatter: `{b}
{a}:{c}个
{a1}:{c1}个
{a2}:{c2}个`, + }, + legend: { + itemWidth: 12, + itemHeight: 8, + itemGap: 20, + right: "2%", + top: "3%", + x: "center", + textStyle: { + fontSize: 14, + color: "#000", + }, + // data: ["站班会数量", "违章数量", "违章占比"], + // data: ["站班会数量", "异常上报数量", "上报占比"], + data: ["已完成", "未完成", "任务数"], + selectedMode: false, + }, + grid: { + top: "8%", + left: "2%", + right: "2%", + bottom: "2%", + containLabel: true, + }, + xAxis: { + type: "category", + data: myData5, + axisLabel: { + color: "#000", + interval: 0, + fontSize: 12, + }, + axisLine: { + show: true, + lineStyle: { + color: "rgba(127, 214, 255, .4)", + }, + }, + splitLine: { + show: false, + }, + axisTick: { + show: false, + }, + }, + yAxis: [ + { + type: "value", + name: "数量 / 个", + splitNumber: 5, + nameTextStyle: { + color: "#000", + fontSize: 12, + align: "center", + // padding: [0, 20, 5, 0], + }, + axisLabel: { + formatter: "{value}", + color: "rgba(95, 187, 235, 1)", + textStyle: { + fontSize: 14, + color: "#000", + lineHeight: 16, + }, + }, + axisTick: { + show: false, + }, + splitLine: { + show: true, + lineStyle: { + color: "rgba(28, 130, 197, .3)", + type: "dashed", + }, + }, + }, + { + // name: "违章占比 / %", + name: "任务数", + splitNumber: 5, + max: 100, + type: "value", + nameTextStyle: { + color: "#000", + fontSize: 12, + align: "center", + // padding: [0, 0, 5, 0], + }, + axisLabel: { + show: true, + fontSize: 12, + color: "#000", + }, + axisLine: { + show: false, + }, + axisTick: { + show: false, + }, + splitLine: { + show: false, + }, + }, + ], + series: [ + { + name: "已完成", + type: "bar", + data: fwrs, + barWidth: "15px", + barGap: "50%", + itemStyle: { + normal: { + borderColor: "#3681FF", + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: "rgba(15, 51, 82, 1)", + }, + + { + offset: 1, + color: "rgba(0, 168, 255, 1)", + }, + ]), + }, + }, + label: { + show: true, + position: "top", + fontSize: 12, + color: "#000", + offset: [0, -5], + formatter: "{c}", + }, + }, + { + // name: "违章数量", + // name: "异常上报数量", + name: "未完成", + type: "bar", + data: xdrs, + barWidth: "15px", + barGap: "50%", + itemStyle: { + normal: { + borderColor: "rgba(54, 234, 255, 1)", + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: "rgba(15, 51, 82, 1)", + }, + + { + offset: 1, + color: "rgba(21, 219, 203, 1)", + }, + ]), + }, + }, + label: { + show: true, + position: "top", + fontSize: 12, + color: "#000", + offset: [0, -5], + formatter: "{c}", + }, + }, + { + // name: "违章占比", + // name: "上报占比", + name: "任务数", + type: "line", + yAxisIndex: 1, + showSymbol: true, + symbolSize: 8, + smooth: true, + symbol: "circle", + lineStyle: { + normal: { + color: "#02D6B0", + }, + }, + itemStyle: { + color: "#02D6B0", + borderColor: "#fff", + borderWidth: 1, + }, + areaStyle: { + normal: { + color: new echarts.graphic.LinearGradient( + 0, + 0, + 0, + 1, + [ + { + offset: 0, + color: "rgba(0, 255, 246, 0.5)", + }, + { + offset: 1, + color: "rgba(0, 255, 246, 0)", + }, + ], + false + ), + }, + }, + data: zhl, // 折线图的数据 + }, + ], + }; + myChart12.setOption(option, true); + window.addEventListener("resize", function () { + myChart12.resize(); + }); +} \ No newline at end of file diff --git a/bns/js/dutyTask/violationStatistics.js b/bns/js/dutyTask/violationStatistics.js index 8275a05..e20b8de 100644 --- a/bns/js/dutyTask/violationStatistics.js +++ b/bns/js/dutyTask/violationStatistics.js @@ -1111,7 +1111,7 @@ function compareTime(time, time2) { } function vioStatistics(){ - let title = '违章统计'; + let title = '异常上报统计'; let layerIndex = layer.open({ id: 'viewTicket', type: 2,