From cc03aba9005acea0d9913cbb2f781531cb51a9d9 Mon Sep 17 00:00:00 2001 From: Vce Date: Tue, 14 May 2024 11:27:44 +0800 Subject: [PATCH] =?UTF-8?q?flx=EF=BC=9A=E5=AE=89=E5=85=A8=E7=BB=A9?= =?UTF-8?q?=E6=95=88=E5=9B=BE=E6=A0=87=E6=96=B0=E5=A2=9E=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E6=9D=A1=20=E8=B0=83=E6=95=B4=E5=AE=89=E5=85=A8/=E8=B4=A8?= =?UTF-8?q?=E9=87=8F=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projectFront/quality/qualityAnalysis.vue | 91 ++++++++++++++----- .../safetyEducation/safetyAnalysis.vue | 67 ++++++++++---- .../safetyEducation/securityRiskAnalysis.vue | 56 ++++++++++-- 3 files changed, 164 insertions(+), 50 deletions(-) diff --git a/src/views/projectFront/quality/qualityAnalysis.vue b/src/views/projectFront/quality/qualityAnalysis.vue index 4ad24be9..706b37b0 100644 --- a/src/views/projectFront/quality/qualityAnalysis.vue +++ b/src/views/projectFront/quality/qualityAnalysis.vue @@ -111,7 +111,7 @@
-
+

暂无数据

@@ -124,8 +124,9 @@
-
风险走势图({{ riskCount }}{{ riskCount == '-' ? '' : '%' }}{{ - riskCount > 0 ? '↑' : '↓' }}比上月({{ riskName }}))
+
风险走势图({{ riskCount }}{{ riskCount == '-' ? '' : '%' }}{{ + riskCount > 0 ? '↑' : '↓' }}比上月({{ riskName }}))
@@ -250,11 +251,12 @@ export default { overdueNotCloseNum: 0, }, examineInfo2: { - dangerNum :0, - generalRiskNum :0, - largerRiskNum :0, - greatFaultLevelNum :0, - lowRiskNum:0, + dangerNum: 0, + generalRiskNum: 0, + largerRiskNum: 0, + greatFaultLevelNum: 0, + lowRiskNum: 0, + flag: false, }, examineInfoFlag: true, @@ -328,6 +330,8 @@ export default { this.examineInfoFlag = false; } } + }).catch(() => { + this.examineInfo2.flag = true; }); }, getStatsByEnterprise(time) { @@ -467,7 +471,22 @@ export default { data: this.enterpriseList.map(item => item.totalNum), type: 'bar', barWidth: '20%', - color: "#268dff" + color: "#268dff", + label: { + show: true, //开启显示 + position: 'top', //在上方显示 + formatter: function (val) { + if (val.value !== 0) { + return val.value; + } else { + return ''; + } + }, + textStyle: { //数值样式 + color: '#1a1a1a', + // fontSize: 12 + } + }, } ] @@ -481,6 +500,14 @@ export default { // 雷达图 radarCharts(el) { let ageChart = echarts.init(el); + const data = [ + this.examineInfo2.investigateNum, + this.examineInfo2.notCloseNum, + this.examineInfo2.overdueNotCloseNum, + this.examineInfo2.rectificationNum, + this.examineInfo2.reviewNum, + this.examineInfo2.verificationNum]; + const maxCount = data.sort((a,b) => b - a)[0]; let option = { legend: { icon: 'roundRect', @@ -497,27 +524,32 @@ export default { indicator: [ { name: '排查记录', - max: parseInt(this.examineInfo2.investigateNum) + 10, + max: maxCount, }, { name: '未闭合', - max: parseInt(this.examineInfo2.notCloseNum) + 10, + max: maxCount, + // max: parseInt(this.examineInfo2.notCloseNum), }, { name: '超期未关闭', - max: parseInt(this.examineInfo2.overdueNotCloseNum) + 10, + max: maxCount, + // max: parseInt(this.examineInfo2.overdueNotCloseNum), }, { name: '待整改', - max: parseInt(this.examineInfo2.rectificationNum) + 10, + max: maxCount, + // max: parseInt(this.examineInfo2.rectificationNum), }, { name: '待复查', - max: parseInt(this.examineInfo2.reviewNum) + 10, + max: maxCount, + // max: parseInt(this.examineInfo2.reviewNum), }, { name: '待核验', - max: parseInt(this.examineInfo2.verificationNum) + 10, + max: maxCount, + // max: parseInt(this.examineInfo2.verificationNum), }, ] }, @@ -533,13 +565,7 @@ export default { }, data: [ { - value: [ - this.examineInfo2.investigateNum, - this.examineInfo2.notCloseNum, - this.examineInfo2.overdueNotCloseNum, - this.examineInfo2.rectificationNum, - this.examineInfo2.reviewNum, - this.examineInfo2.verificationNum], + value: data, name: '质量检查', itemStyle: { //颜色 默认灰色 color: 'rgba(84,112,198,1)', @@ -669,7 +695,7 @@ export default { }; ageChart.setOption(option); ageChart.on('mousemove', (params) => { - if(params.dataIndex == 0){ + if (params.dataIndex == 0) { this.riskCount = 0; this.riskName = "暂无"; return @@ -735,7 +761,7 @@ export default { return colorList[colors.dataIndex]; } }, - avoidLabelOverlap:true, + avoidLabelOverlap: true, // emphasis: { // label: { // show: true, @@ -833,7 +859,22 @@ export default { data: this.inspectionList.map(item => item.y), type: 'bar', barWidth: '35%', - color: "#268dff" + color: "#268dff", + label: { + show: true, //开启显示 + position: 'right', //在上方显示 + formatter: function (val) { + if (val.value !== 0) { + return val.value; + } else { + return ''; + } + }, + textStyle: { //数值样式 + color: '#1a1a1a', + // fontSize: 12 + } + }, } ] diff --git a/src/views/projectFront/safetyEducation/safetyAnalysis.vue b/src/views/projectFront/safetyEducation/safetyAnalysis.vue index 593bd8a9..33d717dc 100644 --- a/src/views/projectFront/safetyEducation/safetyAnalysis.vue +++ b/src/views/projectFront/safetyEducation/safetyAnalysis.vue @@ -111,7 +111,7 @@
-
+

暂无数据

@@ -256,6 +256,7 @@ export default { largerRiskNum: 0, greatFaultLevelNum: 0, lowRiskNum: 0, + flag: false, }, examineInfoFlag: true, @@ -329,6 +330,8 @@ export default { this.examineInfoFlag = false; } } + }).catch(() => { + this.examineInfo2.flag = true; }); }, getStatsByEnterprise(time) { @@ -468,7 +471,22 @@ export default { data: this.enterpriseList.map(item => item.totalNum), type: 'bar', barWidth: '20%', - color: "#268dff" + color: "#268dff", + label: { + show: true, //开启显示 + position: 'right', //在上方显示 + formatter: function (val) { + if (val.value !== 0) { + return val.value; + } else { + return ''; + } + }, + textStyle: { //数值样式 + color: '#1a1a1a', + // fontSize: 12 + } + }, } ] @@ -482,6 +500,14 @@ export default { // 雷达图 radarCharts(el) { let ageChart = echarts.init(el); + const data = [ + this.examineInfo2.investigateNum, + this.examineInfo2.notCloseNum, + this.examineInfo2.overdueNotCloseNum, + this.examineInfo2.rectificationNum, + this.examineInfo2.reviewNum, + this.examineInfo2.verificationNum]; + const maxCount = data.sort((a,b) => b - a)[0]; let option = { legend: { icon: 'roundRect', @@ -498,27 +524,27 @@ export default { indicator: [ { name: '排查记录', - max: parseInt(this.examineInfo2.investigateNum) + 10, + max: maxCount, }, { name: '未闭合', - max: parseInt(this.examineInfo2.notCloseNum) + 10, + max: maxCount, }, { name: '超期未关闭', - max: parseInt(this.examineInfo2.overdueNotCloseNum) + 10, + max: maxCount, }, { name: '待整改', - max: parseInt(this.examineInfo2.rectificationNum) + 10, + max: maxCount, }, { name: '待复查', - max: parseInt(this.examineInfo2.reviewNum) + 10, + max: maxCount, }, { name: '待核验', - max: parseInt(this.examineInfo2.verificationNum) + 10, + max: data.sort((a,b) => b - a)[0], }, ] }, @@ -534,13 +560,7 @@ export default { }, data: [ { - value: [ - this.examineInfo2.investigateNum, - this.examineInfo2.notCloseNum, - this.examineInfo2.overdueNotCloseNum, - this.examineInfo2.rectificationNum, - this.examineInfo2.reviewNum, - this.examineInfo2.verificationNum], + value: data, name: '安全检查', itemStyle: { //颜色 默认灰色 color: 'rgba(84,112,198,1)', @@ -834,7 +854,22 @@ export default { data: this.inspectionList.map(item => item.y), type: 'bar', barWidth: '35%', - color: "#268dff" + color: "#268dff", + label: { + show: true, //开启显示 + position: 'right', //在上方显示 + formatter: function (val) { + if (val.value !== 0) { + return val.value; + } else { + return ''; + } + }, + textStyle: { //数值样式 + color: '#1a1a1a', + // fontSize: 12 + } + }, } ] diff --git a/src/views/projectFront/safetyEducation/securityRiskAnalysis.vue b/src/views/projectFront/safetyEducation/securityRiskAnalysis.vue index 2c6650f6..b390f05e 100644 --- a/src/views/projectFront/safetyEducation/securityRiskAnalysis.vue +++ b/src/views/projectFront/safetyEducation/securityRiskAnalysis.vue @@ -126,12 +126,12 @@
-
- -

暂无数据

+
+ +

暂无数据

+
-
@@ -447,7 +447,7 @@ export default { }, grid: { left: '14%', - right: '8%', + right: '9%', top: '10%', bottom: "10%", // containLabel: true, @@ -499,16 +499,54 @@ export default { } }, }, + dataZoom: [ + { + id: 'dataZoomY', + type: 'inside', + yAxisIndex: [0], + brushSelect: false, + zoomOnMouseWheel: false, + moveOnMouseWheel: true, // 开启滚轮平移 + moveOnMouseMove: true, // 鼠标移动能触发数据窗口平移 + preventDefaultMouseMove: false, + start:100, + startValue: 0, + endValue: 3, + // 滚动条高度 + width: 8, + // 滚动条显示位置 + // height: "80%", + // 距离右边 + right: 3, + // 控制手柄的尺寸 + handleSize: 0, + filterMode: 'empty', + top: "top", + }, + ], series: [ { data: this.safeList.map(item => item.y), type: 'bar', barWidth: '35%', - color: "#268dff" + color: "#268dff", + label: { + show: true, //开启显示 + position: 'right', //在上方显示 + formatter: function (val) { + if (val.value !== 0) { + return val.value; + } else { + return ''; + } + }, + textStyle: { //数值样式 + color: '#1a1a1a', + // fontSize: 12 + } + }, } - ] - - + ], }; ageChart.setOption(option); window.addEventListener("resize", () => {