From a28b026ed01f09abd588ed6463f74db2968de08d Mon Sep 17 00:00:00 2001 From: admin <1297598740@qq.com> Date: Wed, 28 Jan 2026 17:01:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E8=B4=A2=E5=8A=A1?= =?UTF-8?q?=E5=81=A5=E5=BA=B7=E8=AF=84=E5=88=86=E5=BC=B9=E7=AA=97=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E5=B1=95=E7=A4=BA=E7=94=A8=E6=88=B7=E8=B4=A2?= =?UTF-8?q?=E5=8A=A1=E7=8A=B6=E5=86=B5=E3=80=81=E6=8F=90=E4=BE=9BAI?= =?UTF-8?q?=E5=BB=BA=E8=AE=AE=E5=B9=B6=E8=AF=B4=E6=98=8E=E8=AF=84=E5=88=86?= =?UTF-8?q?=E8=A7=84=E5=88=99=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/home/HealthScoreModal/HealthScoreModal.tsx | 2 +- src/config/categoryIcons.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/home/HealthScoreModal/HealthScoreModal.tsx b/src/components/home/HealthScoreModal/HealthScoreModal.tsx index b29d3e7..a73d12b 100644 --- a/src/components/home/HealthScoreModal/HealthScoreModal.tsx +++ b/src/components/home/HealthScoreModal/HealthScoreModal.tsx @@ -34,7 +34,7 @@ export const HealthScoreModal: React.FC = ({ const [loadingAdvice, setLoadingAdvice] = useState(false); // --- Logic & Calculations --- - const netAssets = totalAssets - totalLiabilities; + const debtRatio = totalAssets > 0 ? (totalLiabilities / totalAssets) * 100 : 0; const spendDiff = todaySpend - yesterdaySpend; diff --git a/src/config/categoryIcons.ts b/src/config/categoryIcons.ts index cdc162f..b26f070 100644 --- a/src/config/categoryIcons.ts +++ b/src/config/categoryIcons.ts @@ -9,7 +9,7 @@ * @param categoryId - 保留参数接口,虽然不再用于查表 * @param defaultIcon - 可选的默认图标 */ -export const getCategoryIcon = (categoryId: number): string => { +export const getCategoryIcon = (_categoryId: number): string => { // 不再维护本地大表,统一返回默认图标 // 组件应当优先使用 props 传入的 icon return 'solar:question-circle-bold-duotone'; @@ -30,7 +30,7 @@ const COLOR_PALETTE = [ * 获取分类颜色 * 使用 consistent hashing 算法根据 ID 生成一致的颜色 */ -export const getCategoryColor = (categoryId: number, isDarkMode = false): string => { +export const getCategoryColor = (categoryId: number, _isDarkMode = false): string => { // 简单的哈希算法确保同一个ID总是对应同一个颜色 const index = Math.abs(categoryId) % COLOR_PALETTE.length; return COLOR_PALETTE[index]; @@ -47,7 +47,7 @@ export const getCategoryGradient = (categoryId: number): string => { }; // 辅助函数:调整颜色亮度 (简单实现) -function adjustColor(color: string, amount: number) { +function adjustColor(color: string, _amount: number) { return color; // 暂不需要复杂计算,直接返回原色 }