فهرست منبع

阈值配置按预警,报警,等级配置

zengy 2 روز پیش
والد
کامیت
84e90c71ac

+ 4 - 0
memory/index.md

@@ -64,6 +64,9 @@ npm run dev       # 默认 http://localhost:80
 - 供水管网信息查询页已重构接入统一表 `pipe_network_base`(`/PipeNetworkBase/*`,network_type=2);旧表 `water_pipe_info` 的接口、实体、mapper 与前端死代码已全部删除,供水 GIS 图与统计分析 mapper 已迁移至新表(均带 `network_type='2'`),压力分布图改为等级分布(`pipe_network_level` 字典);数据迁移与删表由用户侧执行(2026-09-09)。
 - 管理端工单状态契约已与后端重构后的 `0–7` 状态机对齐;`6-延期中` 是处理旁路,终态为 `5-已结案` 与 `7-已取消`。
 - 供水「设备异常管理」页面已按统一设备模块还原(Gogs #65):取数走 `/equipment-base` + `/equipment-base/statistics?rootTypeId=1`,只读看板 + 右侧详情抽屉,导出为当前筛选结果的 CSV。资产状态编码仍有分歧:后端 `CurrentStatusEnum`(0-在用/1-维修/2-报废)与 `waterSupplyUiModel`/旧 GIS 的 3-维修 未统一,收敛前维修中设备在异常看板与 GIS 可能判定不同(2026-09-24)。
+- 2026-11-26 只读审计提炼了下月优化清单:PC 质量门禁/路由失败/SSE token/包体,移动端请求层/分页/详情复用,驾驶舱 WS 事件风暴/首屏去重/轮询,后端网关鉴权/批量写/慢 SQL/线程池与日志;未改代码,落地前需逐项验证。
+- 2026-11-26 水位预警编码按服务拆分:`WARN-WATER-LEVEL-OUTLET`(radar-service/radar_data,排口水位)与 `WARN-WATER-LEVEL-FLOOD`(water-level-service/water_monitor_data,易涝点水位);旧 `WARN-WATER-LEVEL` 保留为历史编码,不再作为新配置指标。需在执行 `sql/01_split_water_level_warning_code_20261126.sql` 并部署两端服务/驾驶舱后生效。
+- 2026-11-26 阈值分级配置改造已实施:两张新表 + `ThresholdEvaluationService` 统一判断/写库 + PC 页面按原型重写;普通阈值型采集服务改走 Java 接口,井盖状态位/音频复合规则暂保留。需执行 `sql/02_warning_threshold_grading_20261126.sql` 并人工重配阈值后生效;旧表不迁移。
 
 ## 长期记忆
 
@@ -72,6 +75,7 @@ npm run dev       # 默认 http://localhost:80
 
 ## 会话记录
 
+- [2026-11-26:下月优化排期只读审计](sessions/2026-11-26.md)
 - [2026-10-22:处置人/核验人按部门层级选择](sessions/2026-10-22.md)
 - [2026-10-21:事件字段与状态调整、设备台账两级类型快捷筛选](sessions/2026-10-21.md)
 - [2026-10-19:移动端故障权限及PC应急指挥与预案调整](sessions/2026-10-19.md)

+ 1 - 1
src/api/pipeNetwork/waterSupply.js

@@ -2,7 +2,7 @@ import request from '@/utils/request'
 
 const get = (url, params) => request({ url, method: 'get', params })
 
-// 供水监测原始采集记录列表(按 warning_threshold 判定告警)
+// 供水监测原始采集记录列表(按新分级阈值配置判定告警)
 export const listFlowRecords = (params) => get('/waterSupply/monitoring/flow/records', params)
 export const listSupplyPressureRecords = (params) => get('/waterSupply/monitoring/pressure/supply/records', params)
 export const listHydrantPressureRecords = (params) => get('/waterSupply/monitoring/pressure/hydrant/records', params)

+ 9 - 5
src/api/warningThreshold.js

@@ -4,18 +4,22 @@ export function listWarningTypes(rootTypeId) {
   return request({ url: '/warning/threshold/types', method: 'get', params: { rootTypeId } })
 }
 
-export function listWarningThresholdDevices(params) {
+export function listThresholdDevices(params) {
   return request({ url: '/warning/threshold/devices', method: 'get', params })
 }
 
+export function listThresholdIndicators(params) {
+  return request({ url: '/warning/threshold/indicators', method: 'get', params })
+}
+
 export function pageWarningThresholds(params) {
   return request({ url: '/warning/threshold/findByPage', method: 'get', params })
 }
 
-export function saveWarningThresholds(data) {
-  return request({ url: '/warning/threshold', method: 'put', data })
+export function saveThresholdConfig(data) {
+  return request({ url: '/warning/threshold/config', method: 'put', data })
 }
 
-export function deleteWarningThreshold(params) {
-  return request({ url: '/warning/threshold', method: 'delete', params })
+export function restoreThresholdConfig(params) {
+  return request({ url: '/warning/threshold/config', method: 'delete', params })
 }

+ 1 - 1
src/views/subSystem/alarm/AlarmMap.vue

@@ -55,7 +55,7 @@ async function initMap() {
       const marker = L.circleMarker([34.77 + (Math.random() - 0.5) * 0.02, 113.65 + (Math.random() - 0.5) * 0.02], {
         radius: 10, fillColor: color, color: '#fff', weight: 2, fillOpacity: 0.8
       }).addTo(mapInstance)
-      marker.bindPopup(`<b>${p.deviceCode}</b><br/>${p.warningType}<br/>值: ${p.actualValue}`)
+      marker.bindPopup(`<b>${p.deviceCode}</b><br/>${p.alarmContent || p.warningType || '—'}`)
       marker.on('click', () => { currentAlarm.value = p; detailVisible.value = true })
     }
   } catch (e) { el.innerHTML = '<div style="display:flex;align-items:center;justify-content:center;height:100%;color:#999;">请安装Leaflet: npm install leaflet</div>' }

+ 0 - 2
src/views/subSystem/alarm/AlarmSummary.vue

@@ -4,14 +4,12 @@
     <div class="summary-body">
       <p>报警单号:{{ alarm.alarmNo || '—' }}</p>
       <div>{{ alarm.alarmContent || '—' }}</div>
-      <p v-if="hasActualValue(alarm)">实际值:<span class="value">{{ valueText(alarm.actualValue, alarm.warningUnit) }}</span>;阈值:{{ thresholdText(alarm) }}</p>
       <p>安装位置:{{ alarm.equipmentLocation || '—' }}</p>
       <p>报警时间:{{ alarm.createTime || '—' }}</p>
     </div>
   </section>
 </template>
 <script setup>
-import { thresholdText, valueText, hasActualValue } from './common/js/alarmReviewModel'
 import { useDict } from '@/utils/dict'
 const { alarm_level: alarmLevels } = useDict('alarm_level')
 defineProps({ alarm: { type: Object, required: true }, levelTone: { type: String, default: 'info' } })

+ 1 - 1
src/views/subSystem/alarm/common/list.vue

@@ -46,7 +46,7 @@
 import { ref, reactive, watch, onBeforeUnmount } from 'vue'
 import { Search, Refresh, Document, Warning, CircleCheck, CircleClose, Clock } from '@element-plus/icons-vue'
 import { getAlarms, getAlarmStatistics } from '@/api/alarm'
-import { hasActualValue, valueText, thresholdText } from './js/alarmReviewModel'
+import { hasActualValue } from './js/alarmReviewModel'
 import { auditStatusTone, levelTone, rangeParams } from './js/alarmOperationsModel'
 import { orderStatusType } from '../../pipeNetwork/ops/workOrder/js/workOrderDict'
 import { useAlarmScope } from './js/useAlarmScope'

+ 3 - 10
src/views/subSystem/lifeCompany/components/WarningDetailDrawer.vue

@@ -87,14 +87,11 @@
               <template #default="scope">{{ scope.row.alarmNo || scope.row.alarmId || '-' }}</template>
             </el-table-column>
             <el-table-column label="报警类型" prop="alarmType" min-width="120" show-overflow-tooltip />
+            <el-table-column label="报警描述" min-width="260" show-overflow-tooltip>
+              <template #default="scope">{{ scope.row.alarmContent || '-' }}</template>
+            </el-table-column>
             <el-table-column label="设备名称" prop="deviceName" min-width="140" show-overflow-tooltip />
             <el-table-column label="设备编码" prop="deviceCode" min-width="150" show-overflow-tooltip />
-            <el-table-column label="阈值" min-width="90">
-              <template #default="scope">{{ displayValue(scope.row.thresholdValue) }}</template>
-            </el-table-column>
-            <el-table-column label="实际值" min-width="90">
-              <template #default="scope">{{ displayValue(scope.row.actualValue) }}</template>
-            </el-table-column>
             <el-table-column label="报警时间" min-width="170">
               <template #default="scope">{{ formatDateTime(scope.row.createTime) }}</template>
             </el-table-column>
@@ -225,10 +222,6 @@ async function loadDetail() {
 function formatDateTime(value) {
   return value ? parseTime(value) : '-'
 }
-
-function displayValue(value) {
-  return value === 0 || value ? value : '-'
-}
 </script>
 
 <style scoped>

+ 5 - 25
src/views/subSystem/lifeCompany/lAlertInformation/LCorrelation.vue

@@ -89,8 +89,9 @@
         <el-table-column label="设备编码" prop="deviceCode" min-width="160" />
         <el-table-column label="告警类型" prop="warningTypeText" width="120" />
         <el-table-column label="告警编码" prop="warningCode" width="160" />
-        <el-table-column label="阈值范围" prop="thresholdText" width="160" />
-        <el-table-column label="实际值" prop="actualValue" width="120" />
+        <el-table-column label="报警描述" min-width="260" show-overflow-tooltip>
+          <template #default="scope">{{ scope.row.alarmContent || scope.row.alarm_content || "-" }}</template>
+        </el-table-column>
         <el-table-column label="报警时间" prop="createTime" width="180" />
         <el-table-column label="报警状态" width="100" align="center">
           <template #default="scope">
@@ -215,8 +216,7 @@
         <el-descriptions-item label="设备编码">{{ currentAlarmDetail.deviceCode || "-" }}</el-descriptions-item>
         <el-descriptions-item label="告警类型">{{ currentAlarmDetail.warningTypeText || "-" }}</el-descriptions-item>
         <el-descriptions-item label="告警编码">{{ currentAlarmDetail.warningCode || "-" }}</el-descriptions-item>
-        <el-descriptions-item label="阈值范围">{{ currentAlarmDetail.thresholdText || "-" }}</el-descriptions-item>
-        <el-descriptions-item label="实际值">{{ currentAlarmDetail.actualValue || "-" }}</el-descriptions-item>
+        <el-descriptions-item label="报警描述" :span="2">{{ buildAlarmContent(currentAlarmDetail) }}</el-descriptions-item>
         <el-descriptions-item label="报警时间">{{ currentAlarmDetail.createTime || "-" }}</el-descriptions-item>
         <el-descriptions-item label="报警状态">{{ currentAlarmDetail.alarmStatus === 1 ? "已处理" : "未处理" }}</el-descriptions-item>
         <el-descriptions-item label="备注" :span="2">{{ currentAlarmDetail.remark || "-" }}</el-descriptions-item>
@@ -351,37 +351,17 @@ function normalizeWarningRow(item) {
   };
 }
 
-function buildThresholdText(item) {
-  if (item.warningValue) {
-    return item.warningValue;
-  }
-  if (item.minValue !== null && item.minValue !== undefined && item.maxValue !== null && item.maxValue !== undefined) {
-    return `${item.minValue} ~ ${item.maxValue}`;
-  }
-  if (item.minValue !== null && item.minValue !== undefined) {
-    return `<= ${item.minValue}`;
-  }
-  if (item.maxValue !== null && item.maxValue !== undefined) {
-    return `>= ${item.maxValue}`;
-  }
-  return "-";
-}
-
 function normalizeAlarmRow(item) {
   const linkedWarning = linkedAlarmMap.value[item.id];
   return {
     ...item,
     warningTypeText: formatTypeText(item.warningType),
-    thresholdText: buildThresholdText(item),
     linkedWarning
   };
 }
 
 function buildAlarmContent(row) {
-  if (!row) {
-    return "-";
-  }
-  return `告警类型:${row.warningTypeText || "-"}\n阈值范围:${row.thresholdText || "-"}\n实际值:${row.actualValue || "-"}`;
+  return row?.alarmContent || row?.alarm_content || "-";
 }
 
 async function loadWarningTypes() {

+ 1 - 0
src/views/subSystem/lifeCompany/warningDetail.js

@@ -53,6 +53,7 @@ export function normalizeWarningAlarm(source = {}) {
     ...source,
     alarmId: warningValue(source, 'alarmId', 'alarm_id', 'id'),
     alarmNo: warningValue(source, 'alarmNo', 'alarm_no', 'warningCode', 'warning_code'),
+    alarmContent: warningValue(source, 'alarmContent', 'alarm_content'),
     alarmType: warningValue(source, 'alarmTypeText', 'alarmType', 'alarm_type', 'warningTypeName', 'warning_type_name', 'warningType', 'warning_type'),
     deviceName: warningValue(source, 'deviceName', 'device_name', 'equipmentName', 'equipment_name'),
     deviceCode: warningValue(source, 'deviceCode', 'device_code', 'equipmentCode', 'equipment_code'),

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 127 - 30
src/views/subSystem/lifeCompany/warningThreshold/index.vue


+ 0 - 1
src/views/subSystem/pipeNetwork/home/index.vue

@@ -52,7 +52,6 @@
               </div>
               <div class="alarm-desc">
                 {{ a.alarmContent || indicatorName(a) }}
-                <span v-if="a.actualValue != null">实测 {{ a.actualValue }}</span>
               </div>
             </div>
             <div v-if="!activeAlarms.length" class="empty">当前无未处理报警</div>

+ 1 - 1
src/views/subSystem/pipeNetwork/pinteControl/realTimeShow.vue

@@ -140,7 +140,7 @@
                 <span v-if="a.alarmNo" class="alarm-no">{{ a.alarmNo }}</span>
                 <span>{{ a.createTime }}</span>
               </div>
-              <div class="alarm-desc">{{ a.alarmContent || "—" }} <span v-if="a.actualValue != null">实测 {{ a.actualValue }}</span></div>
+              <div class="alarm-desc">{{ a.alarmContent || "—" }}</div>
             </div>
             <el-empty v-if="!alarms.length" description="当前无未解除报警" :image-size="60" />
           </div>

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است