feat: 添加存款分类设置功能,优化预算管理界面
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 26s
Docker Build & Deploy / Deploy to Production (push) Successful in 8s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s

This commit is contained in:
孙诚
2026-01-07 20:31:12 +08:00
parent a1bb7ad5e1
commit aa8fc7a8b3
4 changed files with 300 additions and 15 deletions

View File

@@ -2,7 +2,18 @@
<div class="page-container-flex">
<van-nav-bar title="预算管理" placeholder>
<template #right>
<van-icon name="plus" size="20" @click="budgetEditRef.open({ category: activeTab })" />
<van-icon
v-if="activeTab !== BudgetCategory.Savings"
name="plus"
size="20"
@click="budgetEditRef.open({ category: activeTab })"
/>
<van-icon
v-else
name="info-o"
size="20"
@click="savingsConfigRef.open()"
/>
</template>
</van-nav-bar>
@@ -123,12 +134,15 @@
status-tag-text="积累中"
@toggle-stop="handleToggleStop"
@switch-period="(dir) => handleSwitchPeriod(budget, dir)"
@click="budgetEditRef.open({
data: budget,
isEditFlag: true,
category: budget.category
})"
>
<template #tag>
<!-- 占位,避免显示停止/恢复按钮 -->
<span />
</template>
<template #actions>
<!-- 占位,避免显示停止/恢复按钮 -->
<span />
</template>
<template #amount-info>
<div class="info-item">
<div class="label">已存</div>
@@ -164,6 +178,10 @@
ref="budgetEditRef"
@success="fetchBudgetList"
/>
<SavingsConfigPopup
ref="savingsConfigRef"
@success="fetchBudgetList"
/>
</div>
</div>
</template>
@@ -176,9 +194,11 @@ import { BudgetPeriodType, BudgetCategory } from '@/constants/enums'
import BudgetCard from '@/components/Budget/BudgetCard.vue'
import BudgetSummary from '@/components/Budget/BudgetSummary.vue'
import BudgetEditPopup from '@/components/Budget/BudgetEditPopup.vue'
import SavingsConfigPopup from '@/components/Budget/SavingsConfigPopup.vue'
const activeTab = ref(BudgetCategory.Expense)
const budgetEditRef = ref(null)
const savingsConfigRef = ref(null)
const expenseBudgets = ref([])
const incomeBudgets = ref([])