feat: Refactor transaction handling and add new features

- Updated ReasonGroupList.vue to modify classify button behavior for adding new classifications.
- Refactored TransactionDetail.vue to integrate PopupContainer and enhance transaction detail display.
- Improved TransactionDetailDialog.vue with updated classify button functionality.
- Simplified BalanceView.vue by removing manual entry button.
- Enhanced PeriodicRecord.vue to update classify button interactions.
- Removed unused add transaction dialog from TransactionsRecord.vue.
- Added new API endpoints in TransactionRecordController for parsing transactions and handling offsets.
- Introduced BillForm.vue and ManualBillAdd.vue for streamlined bill entry.
- Implemented OneLineBillAdd.vue for intelligent transaction parsing.
- Created GlobalAddBill.vue for a unified bill addition interface.
This commit is contained in:
2026-01-01 14:43:43 +08:00
parent 8dfe7f1688
commit e00b5cffb7
18 changed files with 977 additions and 384 deletions

View File

@@ -0,0 +1,80 @@
<template>
<div class="global-add-bill">
<!-- Floating Add Bill Button -->
<div class="floating-add" @click="openAddBill">
<van-icon name="plus" />
</div>
<!-- Add Bill Modal -->
<PopupContainer
v-model="showAddBill"
title="记一笔"
height="85%"
>
<van-tabs v-model:active="activeTab" shrink>
<van-tab title="一句话录账" name="one">
<OneLineBillAdd @success="handleSuccess" />
</van-tab>
<van-tab title="手动录账" name="manual">
<ManualBillAdd @success="handleSuccess" />
</van-tab>
</van-tabs>
</PopupContainer>
</div>
</template>
<script setup>
import { ref, defineEmits } from 'vue'
import PopupContainer from '@/components/PopupContainer.vue'
import OneLineBillAdd from '@/components/Bill/OneLineBillAdd.vue'
import ManualBillAdd from '@/components/Bill/ManualBillAdd.vue'
const emit = defineEmits(['success'])
const showAddBill = ref(false)
const activeTab = ref('one')
const openAddBill = () => {
showAddBill.value = true
// Reset to default tab if needed, or keep last used
// activeTab.value = 'one'
}
const handleSuccess = () => {
showAddBill.value = false
emit('success')
}
</script>
<style scoped>
.floating-add {
position: fixed;
bottom: 80px; /* Above tabbar */
right: 20px;
width: 50px;
height: 50px;
background-color: var(--van-primary-color);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 24px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
z-index: 999;
cursor: pointer;
transition: transform 0.2s;
}
.floating-add:active {
transform: scale(0.9);
}
:deep(.van-tabs__wrap) {
position: sticky;
top: 0;
z-index: 10;
background-color: #fff;
}
</style>