From 0825e9e96a6f2d4b71a51d32dae1302f2496c4d1 Mon Sep 17 00:00:00 2001 From: zmc <zmc_li@foxmail.com> Date: 星期四, 23 十一月 2023 16:58:27 +0800 Subject: [PATCH] 1.增加了风险模型的跳转逻辑 2.增加了风险模型的组件 --- 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