|
|
@@ -599,41 +599,32 @@ export function currentEventsView(domain, eventsSection, options = {}) {
|
|
|
// 那是在报告一件还没问过的事(与 panelBlocks 的 sectionPending 同一立场)。
|
|
|
const pending = !!sectionValue && sectionValue.loaded === false
|
|
|
const items = (sectionValue && sectionValue.data) || []
|
|
|
- // 行必须转成**视图行**(`eventRowView`:等级 tag、状态文本、量值、设备名),
|
|
|
- // 组件只认视图行 —— 直接把领域行交给组件会让 level.tone/statusText/quantity 全是
|
|
|
- // undefined(逻辑闸门只数行数抓不到,真机走查才会红;这里收口)。
|
|
|
- //
|
|
|
- // 票 61:**行=后端返回的这一页**,前端不排、不再截 12 条(服务端分页按后端返回序,
|
|
|
- // 总数读 `pagination.total`,条文 7)。空/失败时仍给安全的一页视图(pageCount=1)。
|
|
|
+ // 筛选与计数仍读取完整领域集合;分页后才调用 eventRowView 格式化本页。
|
|
|
+ // 不排序、不改变可见总数,组件仍只消费等级/状态/量值齐全的视图行。
|
|
|
const family = switchView.key
|
|
|
// 维护者 2026-10-29 第 2 条:**当前**预警/报警只展示还在进行中的事件。
|
|
|
// 已处理完(已处理/已解除/已关闭/已取消/误报)的不进这张表;
|
|
|
// 认不出的状态保留(宁可多显示,也不能把进行中的藏掉)。过滤条数如实回显。
|
|
|
const visibleItems = items.filter((item) => !isTerminalEventStatus(item && item.status))
|
|
|
const hiddenTerminalCount = items.length - visibleItems.length
|
|
|
- const allRows = visibleItems.map((item) => ({
|
|
|
- ...eventRowView(item),
|
|
|
- family,
|
|
|
- identityFamily: family,
|
|
|
- }))
|
|
|
// G11:类型筛选**只对已加载行**生效(`row.type` 是后端 eventType,与 warning-study 的
|
|
|
// 类型 code 同一套码)。命中 0 条也照实显示 0,不把"没筛到"画成"没有预警"。
|
|
|
const typeCode = typeof options.warningType === 'string' ? options.warningType.trim() : ''
|
|
|
const typeLabel = typeof options.warningTypeLabel === 'string' && options.warningTypeLabel ? options.warningTypeLabel : typeCode
|
|
|
- const rows = typeCode ? allRows.filter((row) => row.type === typeCode) : allRows
|
|
|
+ const rows = typeCode ? visibleItems.filter((item) => item && item.type === typeCode) : visibleItems
|
|
|
const filterView = typeCode
|
|
|
? {
|
|
|
active: true,
|
|
|
code: typeCode,
|
|
|
label: typeLabel,
|
|
|
- loaded: allRows.length,
|
|
|
+ loaded: visibleItems.length,
|
|
|
matched: rows.length,
|
|
|
// 覆盖范围**必须**随筛选一起出现:这张表只含可解析设备的当前预警(后端 G11 缺口),
|
|
|
// 本地筛选只是在这一份已加载集合里做减法,不是全量。
|
|
|
// 口径三件套:当前页(服务端分页,筛选不跨页)、只含可解析设备的当前预警、不是全量。
|
|
|
- note: `已按预警类型「${typeLabel}」本地筛选:命中 ${rows.length} / 当前页已加载 ${allRows.length} 条;本列表只含可解析设备的当前预警、且筛选不跨页,不代表全部未解除预警(缺口见票 07/G11)`,
|
|
|
+ note: `已按预警类型「${typeLabel}」本地筛选:命中 ${rows.length} / 当前页已加载 ${visibleItems.length} 条;本列表只含可解析设备的当前预警、且筛选不跨页,不代表全部未解除预警(缺口见票 07/G11)`,
|
|
|
}
|
|
|
- : { active: false, code: '', label: '', loaded: allRows.length, matched: allRows.length, note: '' }
|
|
|
+ : { active: false, code: '', label: '', loaded: visibleItems.length, matched: visibleItems.length, note: '' }
|
|
|
// 维护者 2026-10-29:**分页必须按「过滤后的可见行」算**。
|
|
|
// 旧做法把后端 pagination(含已终态事件)当页码,而行已经滤掉终态 ——
|
|
|
// 报警 92 条里 91 条已处理,屏上只剩 1 行却仍画出 10 页控件,还能翻到空页。
|
|
|
@@ -666,7 +657,12 @@ export function currentEventsView(domain, eventsSection, options = {}) {
|
|
|
section: sectionValue,
|
|
|
hasContent,
|
|
|
// 行=**当前页**的可见行(过滤后前端分页);`total` 是可见行总数。
|
|
|
- rows: pageView.rows,
|
|
|
+ // 先在领域行上筛选/分页,再格式化本页;翻页不再投影整批事件。
|
|
|
+ rows: pageView.rows.map((item) => ({
|
|
|
+ ...eventRowView(item),
|
|
|
+ family,
|
|
|
+ identityFamily: family,
|
|
|
+ })),
|
|
|
total: pageView.total,
|
|
|
placeholder,
|
|
|
pagination: hasContent ? pagination : null,
|