From 2c48904cb755250f3e94c87574ad5bb87d79156b Mon Sep 17 00:00:00 2001 From: Chenyme <118253778+chenyme@users.noreply.github.com> Date: Mon, 16 Feb 2026 18:22:27 +0800 Subject: [PATCH] feat: Add distribution rate input field and display column to credit configuration. --- frontend/components/common/admin/credit.tsx | 49 ++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/frontend/components/common/admin/credit.tsx b/frontend/components/common/admin/credit.tsx index 26f9bae4..8e441f83 100644 --- a/frontend/components/common/admin/credit.tsx +++ b/frontend/components/common/admin/credit.tsx @@ -68,10 +68,20 @@ function PayConfigDetailPanel({

{config ? formatDateTime(config.created_at) : ''}

-
+

{config ? formatDateTime(config.updated_at) : ''}

+ + + +
@@ -209,6 +219,42 @@ function PayConfigDetailPanel({
+
+ +
+ { + const value = e.target.value + if (value === '') { + onEditDataChange('distribute_rate', '0') + return + } + + const numValue = parseInt(value) + if (isNaN(numValue)) { + return + } + + if (numValue >= 0 && numValue <= 100) { + onEditDataChange('distribute_rate', (numValue / 100).toString()) + } + }} + className="text-xs text-right h-4 w-16 px-0 mr-3 rounded-none border-none shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 placeholder:text-[12px]" + /> +

%

+
+
+
@@ -315,6 +361,7 @@ export function UserPayConfigs() { { header: "每日限额", cell: (item) => item.daily_limit ? `LDC ${ item.daily_limit.toLocaleString() }` : "无限制", width: "min-w-[200px]", align: "left" }, { header: "费率", cell: (item) => `${ (Number(item.fee_rate) * 100).toFixed(2) }%`, width: "min-w-[200px]", align: "left" }, { header: "分数转化率", cell: (item) => `${ (Number(item.score_rate) * 100).toFixed(2) }%`, width: "min-w-[200px]", align: "left" }, + { header: "分发费率", cell: (item) => `${ (Number(item.distribute_rate) * 100).toFixed(2) }%`, width: "min-w-[200px]", align: "left" }, { header: "更新时间", cell: (item) => {formatDateTime(item.updated_at)}, width: "min-w-[200px]", align: "left" }, ]} renderDetail={({ selected, hovered, editData, onEditDataChange, onSave, saving }) => (