From d58029c637d3a1eae5a434d6b3a471d88fc7814c Mon Sep 17 00:00:00 2001 From: skynono Date: Sat, 20 Jun 2026 22:08:29 +0800 Subject: [PATCH] =?UTF-8?q?fix(model-pricing):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=8F=AF=E8=A7=86=E5=8C=96=E6=A8=A1=E5=9E=8B=E5=AE=9A=E4=BB=B7?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B9=E6=97=A0=E6=B3=95=E5=88=A0=E9=99=A4?= =?UTF-8?q?=20(#5628)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 删除时已从草稿中移除模型,但列表为 saved∪draft 并集且优先取 saved, 导致行不消失(isDraftDeleted 计算后未被使用),表现为无法删除。改为过滤 掉已暂存删除的行;并在删除当前正在编辑的行时关闭编辑器,避免从残留面板 保存又把模型写回。 --- .../system-settings/models/model-ratio-visual-editor.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/web/default/src/features/system-settings/models/model-ratio-visual-editor.tsx b/web/default/src/features/system-settings/models/model-ratio-visual-editor.tsx index a1684a1d..1af2927c 100644 --- a/web/default/src/features/system-settings/models/model-ratio-visual-editor.tsx +++ b/web/default/src/features/system-settings/models/model-ratio-visual-editor.tsx @@ -225,6 +225,7 @@ const ModelRatioVisualEditorComponent = forwardRef< isDraftNew: Boolean(!saved && draft), } }) + .filter((row) => !row.isDraftDeleted) .sort((a, b) => a.name.localeCompare(b.name)) }, [ savedModelPrice, @@ -392,6 +393,12 @@ const ModelRatioVisualEditorComponent = forwardRef< 'billing_setting.billing_expr', JSON.stringify(billingExprMap, null, 2) ) + + if (editData?.name === name) { + setEditData(null) + setEditorOpen(false) + setSheetOpen(false) + } }, [ modelPrice, @@ -405,6 +412,7 @@ const ModelRatioVisualEditorComponent = forwardRef< billingMode, billingExpr, onChange, + editData, ] )