diff --git a/hub/admin-web/src/routes/admin/org/[slug]/capacity/+page.svelte b/hub/admin-web/src/routes/admin/org/[slug]/capacity/+page.svelte index d74df88..70191a4 100644 --- a/hub/admin-web/src/routes/admin/org/[slug]/capacity/+page.svelte +++ b/hub/admin-web/src/routes/admin/org/[slug]/capacity/+page.svelte @@ -1,6 +1,6 @@ - + {#snippet actions()} - {/snippet} -

- 未配置平台上限的维度暂不可设置组织限制(见 ADR-0022 / LayeredLimit.Valid)。 +

+ 未配置平台上限的维度暂不可设置组织限制。输入框留空即沿用平台上限。

{#if loading} @@ -107,52 +153,158 @@ {:else if view} {#if view.dimensions.length === 0} - + {:else} -
- - - - - - - - - - - {#each view.dimensions as row} - - - - - - - {/each} - -
维度平台上限组织限制有效值
{DIMENSION_LABELS[row.dimension] ?? row.dimension} - {#if row.platformCeiling === null} - 未配置 - {:else} - {row.platformCeiling} - {/if} - - - - {row.platformCeiling === null - ? '—' - : drafts[row.dimension] && drafts[row.dimension] !== '' - ? Math.min(row.platformCeiling, Number.parseInt(drafts[row.dimension]!, 10) || row.platformCeiling) - : row.platformCeiling} -
+ {@const policy = view} +
+ {#each GROUPS as group} + {@const rows = group.dims + .map((d) => policy.dimensions.find((r) => r.dimension === d)) + .filter((r): r is CapacityDimensionRow => r !== undefined)} + {#if rows.length > 0} +
+
+

{group.title}

+ {rows.length} 项 +
+
+ {#each rows as row (row.dimension)} + {@const err = draftError(row)} + {@const eff = liveEffective(row)} + {@const lowered = isLowered(row)} + {@const disabled = row.platformCeiling === null} +
+
{DIMENSION_LABELS[row.dimension] ?? row.dimension}
+
+ {#if disabled} + 未配置 + {:else} + 平台 ≤ {row.platformCeiling} + {/if} +
+ +
+ {#if eff === null} + + {:else if lowered} + 有效 {eff} + {:else} + 有效 {eff} + {/if} +
+ {#if err !== null} +
{err}
+ {/if} +
+ {/each} +
+
+ {/if} + {/each}
{/if} {:else} {/if} + +