|
@@ -291,13 +291,17 @@ export function emptyDesignView(view, section) {
|
|
|
if (!view) return view
|
|
if (!view) return view
|
|
|
if (sectionPending(section)) return view
|
|
if (sectionPending(section)) return view
|
|
|
if (sectionHasContent(section)) return view
|
|
if (sectionHasContent(section)) return view
|
|
|
|
|
+ // 面板可以声明「这些读数不来自本分区」(如运行信息的窨井数量取自档案目录):
|
|
|
|
|
+ // 分区为空只说明**本分区**没有数,不能连带把一个已经从别处拿到真值的读数抹成占位符
|
|
|
|
|
+ // (维护者 2026-11-12:筛「窨井」后基础档案显示「窨井 3」,而运行信息的窨井数量是「—」)。
|
|
|
|
|
+ const retained = view.retainedKeys || []
|
|
|
return {
|
|
return {
|
|
|
...view,
|
|
...view,
|
|
|
// 分区状态一字不改:`hasContent` 仍为 false(状态标识与摘要都按真实状态说),
|
|
// 分区状态一字不改:`hasContent` 仍为 false(状态标识与摘要都按真实状态说),
|
|
|
// 只是内容区改画设计骨架。
|
|
// 只是内容区改画设计骨架。
|
|
|
hasContent: false,
|
|
hasContent: false,
|
|
|
designOnly: true,
|
|
designOnly: true,
|
|
|
- blocks: (view.blocks || []).map(emptyDesignBlock),
|
|
|
|
|
|
|
+ blocks: (view.blocks || []).map((block) => emptyDesignBlock(block, retained)),
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -306,19 +310,22 @@ export function emptyDesignView(view, section) {
|
|
|
* 数据驱动的行(如"按类型分布")没有数据时本来就没有类别名可画 —— 那部分由渲染层的
|
|
* 数据驱动的行(如"按类型分布")没有数据时本来就没有类别名可画 —— 那部分由渲染层的
|
|
|
* 块级占位符兜底,不在这里编造假类别。
|
|
* 块级占位符兜底,不在这里编造假类别。
|
|
|
*/
|
|
*/
|
|
|
-function emptyDesignBlock(block) {
|
|
|
|
|
|
|
+function emptyDesignBlock(block, retained = []) {
|
|
|
if (!block || typeof block !== 'object') return block
|
|
if (!block || typeof block !== 'object') return block
|
|
|
const design = { ...block, placeholder: true }
|
|
const design = { ...block, placeholder: true }
|
|
|
switch (block.kind) {
|
|
switch (block.kind) {
|
|
|
case 'kpi':
|
|
case 'kpi':
|
|
|
// 读数与差值("较昨日 +6")在没有数的时候同样是断言,得一起撤。
|
|
// 读数与差值("较昨日 +6")在没有数的时候同样是断言,得一起撤。
|
|
|
- design.items = (block.items || []).map((item) => ({
|
|
|
|
|
- ...item,
|
|
|
|
|
- value: EMPTY_VALUE,
|
|
|
|
|
- full: '',
|
|
|
|
|
- delta: undefined,
|
|
|
|
|
- deltaText: '',
|
|
|
|
|
- }))
|
|
|
|
|
|
|
+ // `retained` 里的键例外:它们的值来自别的数据源,本分区空不代表它们没数。
|
|
|
|
|
+ design.items = (block.items || []).map((item) => retained.includes(item.key)
|
|
|
|
|
+ ? item
|
|
|
|
|
+ : {
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ value: EMPTY_VALUE,
|
|
|
|
|
+ full: '',
|
|
|
|
|
+ delta: undefined,
|
|
|
|
|
+ deltaText: '',
|
|
|
|
|
+ })
|
|
|
break
|
|
break
|
|
|
case 'cards':
|
|
case 'cards':
|
|
|
case 'bars':
|
|
case 'bars':
|