feat: 优化预算管理界面,增强预算编辑功能,添加预算删除接口
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 24s
Docker Build & Deploy / Deploy to Production (push) Successful in 7s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 24s
Docker Build & Deploy / Deploy to Production (push) Successful in 7s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<div class="page-container-flex">
|
||||
<van-nav-bar title="预算管理" placeholder>
|
||||
<template #right>
|
||||
<van-icon name="plus" size="20" @click="budgetEditRef.open()" />
|
||||
<van-icon name="plus" size="20" @click="budgetEditRef.open({ category: activeTab })" />
|
||||
</template>
|
||||
</van-nav-bar>
|
||||
|
||||
@@ -25,7 +25,11 @@
|
||||
:period-label="getPeriodLabel(budget.type)"
|
||||
@toggle-stop="handleToggleStop"
|
||||
@switch-period="(dir) => handleSwitchPeriod(budget, dir)"
|
||||
@click="budgetEditRef.open(budget)"
|
||||
@click="budgetEditRef.open({
|
||||
data: budget,
|
||||
isEditFlag: true,
|
||||
category: budget.category
|
||||
})"
|
||||
>
|
||||
<template #amount-info>
|
||||
<div class="info-item">
|
||||
@@ -88,12 +92,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #progress-info>
|
||||
<span class="period-type">{{ getPeriodLabel(budget.type) }}达成度</span>
|
||||
<span class="percent" :class="{ 'income': (budget.current / budget.limit) >= 1 }">
|
||||
{{ Math.round((budget.current / budget.limit) * 100) }}%
|
||||
</span>
|
||||
</template>
|
||||
</BudgetCard>
|
||||
<template #right>
|
||||
<van-button square text="删除" type="danger" class="delete-button" @click="handleDelete(budget)" />
|
||||
@@ -117,6 +115,7 @@
|
||||
:budget="budget"
|
||||
progress-color="#07c160"
|
||||
:percent-class="{ 'income': (budget.current / budget.limit) >= 1 }"
|
||||
:period-label="getPeriodLabel(budget.type)"
|
||||
status-tag-text="积累中"
|
||||
@toggle-stop="handleToggleStop"
|
||||
@switch-period="(dir) => handleSwitchPeriod(budget, dir)"
|
||||
@@ -138,12 +137,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #progress-info>
|
||||
<span class="period-type">储蓄进度</span>
|
||||
<span class="percent" :class="{ 'income': (budget.current / budget.limit) >= 1 }">
|
||||
{{ Math.round((budget.current / budget.limit) * 100) }}%
|
||||
</span>
|
||||
</template>
|
||||
</BudgetCard>
|
||||
<template #right>
|
||||
<van-button square text="删除" type="danger" class="delete-button" @click="handleDelete(budget)" />
|
||||
@@ -168,7 +161,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, computed, onMounted, watch } from 'vue'
|
||||
import { ref, computed, onMounted, watch } from 'vue'
|
||||
import { showToast, showConfirmDialog } from 'vant'
|
||||
import { getBudgetList, deleteBudget, toggleStopBudget, getBudgetStatistics } from '@/api/budget'
|
||||
import { BudgetPeriodType, BudgetCategory } from '@/constants/enums'
|
||||
|
||||
Reference in New Issue
Block a user