From 153d74d033d6e322697658f8dd398be4639a5c49 Mon Sep 17 00:00:00 2001 From: ChickenPige0n <2336983354@qq.com> Date: Tue, 14 Jul 2026 22:54:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E5=AE=B9=E9=87=8F?= =?UTF-8?q?=E7=AD=96=E7=95=A5=E9=A1=B5=E9=9D=A2=E7=9A=84=E7=BB=B4=E5=BA=A6?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=92=8C=E9=80=BB=E8=BE=91=E5=88=86=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/org/[slug]/capacity/+page.svelte | 290 +++++++++++++----- 1 file changed, 221 insertions(+), 69 deletions(-) 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} + +