From dd5fbe2e6cacffa0ff67f0f68c262d14ddfce3cc Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期五, 24 十一月 2023 15:21:56 +0800 Subject: [PATCH] 1.修复指标排名界面的排序换页后重置的问题 --- src/views/risk_assessment/components/DustRadarChart.vue | 33 +++++++++++++++++++-------------- 1 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/views/risk_assessment/components/DustRadarChart.vue b/src/views/risk_assessment/components/DustRadarChart.vue index 1936eb3..6a90aac 100644 --- a/src/views/risk_assessment/components/DustRadarChart.vue +++ b/src/views/risk_assessment/components/DustRadarChart.vue @@ -14,9 +14,9 @@ }, // 鏁版嵁 yData: { - type: Array, + type: Object, default: () => { - return [100,0,0,0,100]; + return {}; } } }, @@ -26,8 +26,11 @@ }; }, watch: { - yData() { - this.set(); + yData: { + handler() { + this.set() + }, + deep:true } }, mounted() { @@ -36,22 +39,24 @@ }, computed:{ valid(){ - return (100-this.yData[0]).toFixed(2) + return (this.yData.validRisk*100).toFixed(2) }, exceptionRecurrence(){ - return this.yData[1]*100 + return (this.yData.exceptionTypeAggregation*100).toFixed(2) }, exceptionTypeAggregation(){ - return this.yData[2]*100 + return (this.yData.exceptionTypeAggregation*100).toFixed(2) }, exceeding(){ - return this.yData[3] + return (this.yData.exceedRisk*100).toFixed(2) }, online(){ - return (100-this.yData[4]).toFixed(2) + return (this.yData.onlineRisk*100).toFixed(2) } }, methods: { + + initRadarChart() { this.chart = echarts.init(document.getElementById('main')); }, @@ -92,11 +97,11 @@ data: [ { value: [ - (1 - this.yData[0]/100).toFixed(4), - this.yData[1], - this.yData[2], - (this.yData[3]/100).toFixed(4), - (1-this.yData[4]/100).toFixed(4) + this.yData.validRisk.toFixed(4), + this.yData.typicalExceptionRepetitionRate, + this.yData.exceptionTypeAggregation, + this.yData.exceedRisk.toFixed(4), + this.yData.onlineRisk.toFixed(4) ], name: '寮傚父鍒嗘瀽' -- Gitblit v1.9.3