From ef261a32d1caf39bdd00f48a72fc60a20e9487e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=B6=E5=90=AF=E9=BE=99?= Date: Tue, 27 Aug 2024 18:38:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A6=96=E9=A1=B5=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../new_dashboard_component/AlarmHandling.vue | 18 +++---- .../DailyAlarmStatistics.vue | 47 ++++++++++++++----- 2 files changed, 42 insertions(+), 23 deletions(-) diff --git a/webs/sms-web/src/views/configs/setting_dashboard/new_dashboard_component/AlarmHandling.vue b/webs/sms-web/src/views/configs/setting_dashboard/new_dashboard_component/AlarmHandling.vue index f0f789a..91932b2 100644 --- a/webs/sms-web/src/views/configs/setting_dashboard/new_dashboard_component/AlarmHandling.vue +++ b/webs/sms-web/src/views/configs/setting_dashboard/new_dashboard_component/AlarmHandling.vue @@ -20,7 +20,7 @@ import { ref } from 'vue' import LineCharts from './echarts/LineCharts.vue' import ItemCard from './ItemCard.vue' -import { getOneDayWarnCount, getSevenDayWarnTrend } from 'services/system/dashboard' +import { getSevenDayWarnTrend } from 'services/system/dashboard' import echarts from '@cmp/cmp-echarts/hooks/echarts' export const colorMap = ['rgba(255, 0, 0, 1)', 'rgba(245, 167, 45, 1)', 'rgba(18, 185, 242, 1)', 'rgba(24, 144, 255, 1)'] const chartSetting = { @@ -53,20 +53,11 @@ export default { value: 0 } ]) - ;(async function () { - const res = await getOneDayWarnCount() - if (!res.success) return - countData.value[0].value = res.data.critical - countData.value[1].value = res.data.major - countData.value[2].value = res.data.minor - countData.value[3].value = res.data.warning - })() const lineData = ref({ keys: [], values: [] }) ;(async function () { - // 一天是86400秒 const res = await getSevenDayWarnTrend() if (!res.success) return const names = Object.keys(res.data) @@ -77,7 +68,12 @@ export default { 4: '提示告警' } if (!names.length) return - + // 左侧 + countData.value[0].value = res.data[1].reduce((total, { count }) => count + total, 0) + countData.value[1].value = res.data[2].reduce((total, { count }) => count + total, 0) + countData.value[2].value = res.data[3].reduce((total, { count }) => count + total, 0) + countData.value[3].value = res.data[4].reduce((total, { count }) => count + total, 0) + // 右侧 const result = { keys: res.data[names[0]].map(({ date }) => date), values: names.map(name => { diff --git a/webs/sms-web/src/views/configs/setting_dashboard/new_dashboard_component/DailyAlarmStatistics.vue b/webs/sms-web/src/views/configs/setting_dashboard/new_dashboard_component/DailyAlarmStatistics.vue index d6e365a..1b327c7 100644 --- a/webs/sms-web/src/views/configs/setting_dashboard/new_dashboard_component/DailyAlarmStatistics.vue +++ b/webs/sms-web/src/views/configs/setting_dashboard/new_dashboard_component/DailyAlarmStatistics.vue @@ -1,14 +1,14 @@