This commit is contained in:
SunCheng
2026-02-15 10:10:28 +08:00
parent e51a3edd50
commit a88556c784
92 changed files with 6751 additions and 776 deletions

View File

@@ -16,7 +16,9 @@
<template #right>
<!-- 未覆盖分类警告图标支出和收入 tab -->
<van-icon
v-if="activeTab !== BudgetCategory.Savings && uncoveredCategories.length > 0 && !isArchive"
v-if="
activeTab !== BudgetCategory.Savings && uncoveredCategories.length > 0 && !isArchive
"
name="warning-o"
size="20"
color="var(--van-danger-color)"
@@ -285,7 +287,13 @@
<!-- 空状态 -->
<van-empty
v-if="activeTab !== BudgetCategory.Savings && !loading && !hasError && ((activeTab === BudgetCategory.Expense && expenseBudgets?.length === 0) || (activeTab === BudgetCategory.Income && incomeBudgets?.length === 0))"
v-if="
activeTab !== BudgetCategory.Savings &&
!loading &&
!hasError &&
((activeTab === BudgetCategory.Expense && expenseBudgets?.length === 0) ||
(activeTab === BudgetCategory.Income && incomeBudgets?.length === 0))
"
:description="`暂无${activeTab === BudgetCategory.Expense ? '支出' : '收入'}预算`"
/>
</div>
@@ -347,7 +355,10 @@
<div style="padding: 16px">
<div
class="rich-html-content"
v-html="archiveSummary || '<p style=\'text-align:center;color:var(--van-text-color-3)\'>暂无总结</p>'"
v-html="
archiveSummary ||
'<p style=\'text-align:center;color:var(--van-text-color-3)\'>暂无总结</p>'
"
/>
</div>
</PopupContainer>
@@ -402,7 +413,7 @@ defineOptions({
})
const messageStore = useMessageStore()
const theme = computed(() => messageStore.isDarkMode ? 'dark' : 'light')
const theme = computed(() => (messageStore.isDarkMode ? 'dark' : 'light'))
// 日期状态
const currentDate = ref(new Date())
@@ -607,11 +618,7 @@ const loadBudgetData = async () => {
try {
// 并发加载多个数据源
await Promise.allSettled([
loadMonthlyData(),
loadCategoryStats(),
loadUncoveredCategories()
])
await Promise.allSettled([loadMonthlyData(), loadCategoryStats(), loadUncoveredCategories()])
} catch (_error) {
console.error('加载预算数据失败:', _error)
hasError.value = true
@@ -910,7 +917,8 @@ onBeforeUnmount(() => {
}
.budget-content {
padding: 12px;
padding: var(--spacing-md);
padding-top: 0;
}
.error-state {
@@ -970,7 +978,9 @@ onBeforeUnmount(() => {
.item-amount {
font-size: 18px;
font-weight: 600;
font-family: DIN Alternate, system-ui;
font-family:
DIN Alternate,
system-ui;
}
.info-item {
@@ -988,7 +998,9 @@ onBeforeUnmount(() => {
.info-item .value {
font-size: 16px;
font-weight: 600;
font-family: DIN Alternate, system-ui;
font-family:
DIN Alternate,
system-ui;
}
.info-item .value.expense {