From ba6aab2ba2bc2725df94f578e2ce10dd1100d55a Mon Sep 17 00:00:00 2001 From: Sunwuyuan Date: Sat, 7 Mar 2026 13:05:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E5=99=AA=E9=9F=B3?= =?UTF-8?q?=E7=9B=91=E6=B5=8B=E8=AE=BE=E7=BD=AE=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=99=9A=E8=87=AA=E4=B9=A0=E6=97=B6=E9=97=B4=E6=AE=B5=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=92=8C=E6=A0=A1=E5=87=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/NoiseMonitorDetail.vue | 473 +++++++++--------- src/components/TimeCard.vue | 12 - .../settings/cards/NoiseSettingsCard.vue | 257 ++++++++++ src/pages/settings.vue | 13 +- 4 files changed, 515 insertions(+), 240 deletions(-) diff --git a/src/components/NoiseMonitorDetail.vue b/src/components/NoiseMonitorDetail.vue index 9e674b3..3e71251 100644 --- a/src/components/NoiseMonitorDetail.vue +++ b/src/components/NoiseMonitorDetail.vue @@ -72,15 +72,6 @@ 统计报告 - - - mdi-cog - - 自习配置 - @@ -370,14 +361,12 @@ - 校准({{ calibrateTarget }}dB) + 校准 @@ -772,177 +761,195 @@ - - - -
-
- - mdi-clock-edit-outline - - 晚自习时间段 - - - 添加时段 - -
- -
- 配置晚自习时间段后,系统会在对应时段内自动开启噪音监测并记录统计报告。时间段外不会长期记录。 -
- -
- - -
- - - - - - - - 至 {{ sessionEndTime(session) }} - - - -
-
-
-
- - - - -
- - mdi-alert-decagram - - 监测参数 -
- -
- - -
- - - -
- - 重置 - - - 保存配置 - -
-
-
+ + + + + + mdi-crosshairs-gps + + 分贝校准 + + + + + + + + + + +
+ 当前校准值 +
+
+
+ 基准分贝: + + {{ calibrationSettings.baselineDb }} dB + +
+
+ 基准 RMS: + + {{ calibrationSettings.baselineRms != null ? calibrationSettings.baselineRms.toFixed(6) : '未校准' }} + +
+
+ 最大分贝: + + {{ calibrationSettings.maxLevelDb }} dB + +
+
+
+
+ + +
+ + mdi-auto-fix + + 自动校准 +
+
+ 在已知环境分贝的场景下,输入当前环境的真实分贝值,点击开始后保持环境安静 3 秒。 +
+
+ + + 开始校准 + + + 需先开启监测 + + + {{ calibrateMessage }} + +
+ + + + +
+ + mdi-pencil-ruler + + 手动校准 / 参数调整 +
+
+ 直接输入校准参数。修改后点击保存生效。 +
+
+ + + +
+
+ + + + 恢复默认 + + + + 保存校准 + + +
+
+ diff --git a/src/components/TimeCard.vue b/src/components/TimeCard.vue index 02b04c5..4243cda 100644 --- a/src/components/TimeCard.vue +++ b/src/components/TimeCard.vue @@ -80,7 +80,6 @@ :last-slice="noiseLastSlice" :history="noiseHistory" :is-monitoring="noiseMonitoring" - :session-config="noiseSessionConfig" :session-active="noiseSessionActive" :session-data="noiseSessionData" :report-meta="noiseReportMeta" @@ -88,9 +87,7 @@ :date-reports="noiseCurrentDateReports" @start="startNoise" @stop="stopNoise" - @calibrate="calibrateNoise" @clear-history="clearNoiseHistory" - @save-config="onSaveSessionConfig" @select-date="onSelectReportDate" @clear-date-reports="onClearDateReports" @clear-all-reports="onClearAllReports" @@ -1200,11 +1197,6 @@ export default { this.noiseScore = null this.noiseScoreDetail = null }, - calibrateNoise(targetDb) { - noiseService.calibrate(targetDb, (success, msg) => { - console.log(success ? '校准成功' : `校准失败: ${msg}`) - }) - }, clearNoiseHistory() { noiseService.clearHistory() this.noiseHistory = [] @@ -1470,10 +1462,6 @@ export default { } return result }, - onSaveSessionConfig(config) { - this.noiseSessionConfig = config - this.saveNoiseSessionConfig() - }, async onSelectReportDate(dateStr) { await this.loadReportsForDate(dateStr) }, diff --git a/src/components/settings/cards/NoiseSettingsCard.vue b/src/components/settings/cards/NoiseSettingsCard.vue index 7bc37a9..a409a89 100644 --- a/src/components/settings/cards/NoiseSettingsCard.vue +++ b/src/components/settings/cards/NoiseSettingsCard.vue @@ -13,15 +13,272 @@ + + + + +
+
+ + mdi-clock-edit-outline + + 晚自习时间段 + + + 添加时段 + +
+ +
+ 配置晚自习时间段后,系统会在对应时段内自动开启噪音监测并记录统计报告。时间段外不会长期记录。 +
+ + + + + + + +
+ + mdi-alert-decagram + + 监测参数 +
+ +
+ +
+ +
+ + 重置 + + + 保存配置 + +
+
diff --git a/src/pages/settings.vue b/src/pages/settings.vue index 14ffbb5..67f3148 100644 --- a/src/pages/settings.vue +++ b/src/pages/settings.vue @@ -172,10 +172,10 @@ border @saved="onSettingsSaved" /> - + + + + @@ -420,6 +420,11 @@ export default { icon: "mdi-eye", value: "display", }, + { + title: "噪音监测", + icon: "mdi-microphone", + value: "noise", + }, { title: "通知铃声", icon: "mdi-bell-ring",