From 715b9abd05068c47ec470c064be12dca829bc0f2 Mon Sep 17 00:00:00 2001 From: tianyongbao Date: Mon, 21 Oct 2024 15:59:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=87=AA=E6=B5=8B=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96=EF=BC=8C=E7=94=A8=E8=8D=AF?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=8A=9F=E8=83=BD=E4=BB=A3=E7=A0=81=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/health/marStatistic/index.vue | 680 ++++++++++++++++++ .../health/temperatureStatistic/index.vue | 48 +- 2 files changed, 718 insertions(+), 10 deletions(-) create mode 100644 src/views/health/marStatistic/index.vue diff --git a/src/views/health/marStatistic/index.vue b/src/views/health/marStatistic/index.vue new file mode 100644 index 0000000..d609467 --- /dev/null +++ b/src/views/health/marStatistic/index.vue @@ -0,0 +1,680 @@ + + + diff --git a/src/views/health/temperatureStatistic/index.vue b/src/views/health/temperatureStatistic/index.vue index effb475..8ce3a7b 100644 --- a/src/views/health/temperatureStatistic/index.vue +++ b/src/views/health/temperatureStatistic/index.vue @@ -104,7 +104,7 @@ -
+
@@ -145,7 +145,7 @@
高烧次数
- {{ temp.higherTempCount }} (大于38.5℃) + {{ temp.higherTempCount }} 次(大于38.5℃)
@@ -447,7 +447,7 @@ const drawBar = (data) => { { type: 'value', min: 35.5, // 设置 y 轴的最小值为 0 - max: 40.5, // 设置 y 轴的最大值为 100 + // max: 40.5, // 设置 y 轴的最大值为 100 interval: 0.5, //设置y轴刻度间隔 axisTick: { show: true // 默认为true,如果要隐藏,则改为 false @@ -467,16 +467,30 @@ const drawBar = (data) => { type: 'bar', barWidth: 10, // 根据需求调整数值大小,单位是像素 itemStyle: { - color: '#2283cf' + // 此处可以是一个固定颜色值,也可以是一个回调函数根据数据动态计算颜色 + color: function (params) { + // 这里可以根据需要设置不同的颜色,比如根据数据值 + if (params.data < 37) { + return '#37b328' + } else if (params.data >= 37 && params.data < 37.5) { + return '#ff00ff' + } else if (params.data >= 37.5 && params.data < 38.5) { + return '#ff0066' + } else if (params.data >= 38.5 && params.data < 39.5) { + return '#ff0000' + } else if (params.data >= 39.5) { + return '#990000' // 数据在50到99之间为蓝色 + } + } } } ], // 添加点击事件的处理函数 emphasis: { - itemStyle: { - color: '#2283cf', - barWidth: 20 // 根据需求调整数值大小,单位是像素 - }, + // itemStyle: { + // color: '#2283cf', + // barWidth: 20 // 根据需求调整数值大小,单位是像素 + // }, barWidth: 24 // 根据需求调整数值大小,单位是像素 } } @@ -523,7 +537,7 @@ const drawLine = (data) => { yAxis: { type: 'value', min: 35.5, // 设置 y 轴的最小值为 0 - max: 40.5, // 设置 y 轴的最大值为 100 + // max: 40.5, // 设置 y 轴的最大值为 100 interval: 0.5, //设置y轴刻度间隔 axisTick: { show: true @@ -544,7 +558,21 @@ const drawLine = (data) => { color: '#4181c9' }, itemStyle: { - color: '#4181c9' + // 此处可以是一个固定颜色值,也可以是一个回调函数根据数据动态计算颜色 + color: function (params) { + // 这里可以根据需要设置不同的颜色,比如根据数据值 + if (params.data < 37) { + return '#37b328' + } else if (params.data >= 37 && params.data < 37.5) { + return '#ff00ff' + } else if (params.data >= 37.5 && params.data < 38.5) { + return '#ff0066' + } else if (params.data >= 38.5 && params.data < 39.5) { + return '#ff0000' + } else if (params.data >= 39.5) { + return '#990000' // 数据在50到99之间为蓝色 + } + } }, smooth: true, symbol: 'emptyCircle',