From a490dad9c597f360b2dd417cab430056b8932711 Mon Sep 17 00:00:00 2001 From: sunnylqm Date: Thu, 19 Mar 2026 10:31:53 +0000 Subject: [PATCH 1/2] fix: unify admin user tier options --- src/pages/admin-users.tsx | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/pages/admin-users.tsx b/src/pages/admin-users.tsx index f2dccee..b18d52f 100644 --- a/src/pages/admin-users.tsx +++ b/src/pages/admin-users.tsx @@ -17,10 +17,21 @@ import { import dayjs from 'dayjs'; import { useEffect, useRef, useState } from 'react'; import { type Content, JSONEditor, type OnChange } from 'vanilla-jsoneditor'; +import { quotas } from '@/constants/quotas'; import { adminApi } from '@/services/admin-api'; const { Title } = Typography; +const tierOptions = [ + ...Object.entries(quotas).map(([value, quota]) => ({ + value, + label: quota.title, + })), + { value: 'custom', label: '定制版' }, +]; + +const tierLabelMap = new Map(tierOptions.map((option) => [option.value, option.label])); + // JSON Editor wrapper component for quota editing const JsonEditorWrapper = ({ value, @@ -188,7 +199,8 @@ export const Component = () => { title: '套餐', dataIndex: 'tier', key: 'tier', - width: 100, + width: 120, + render: (tier: string) => tierLabelMap.get(tier) || tier || '-', }, { title: '套餐过期时间', @@ -278,13 +290,9 @@ export const Component = () => {