更新 .gitignore,添加 .claude/ 目录;新增 MY_REQUIREMENTS.md 文件,记录个人需求清单;优化小键盘组件,调整布局并添加删除按钮;修改路由配置,禁用某些页面的动画效果;全局样式中调整过渡时长。

This commit is contained in:
2026-04-05 16:31:02 +08:00
parent 97fb73ad43
commit 285fef6eba
6 changed files with 261 additions and 14 deletions
@@ -459,10 +459,12 @@
<f7-actions-button @click="showTransactionPictures = true">{{ tt('Add Picture') }}</f7-actions-button>
</f7-actions-group>
<f7-actions-group v-if="pageTypeAndMode?.type === TransactionEditPageType.Transaction && mode === TransactionEditPageMode.View && transaction.type !== TransactionType.ModifyBalance">
<f7-actions-button @click="navigateToEdit()">{{ tt('Edit') }}</f7-actions-button>
<f7-actions-button @click="duplicate(false, false)">{{ tt('Duplicate') }}</f7-actions-button>
<f7-actions-button @click="duplicate(true, false)">{{ tt('Duplicate (With Time)') }}</f7-actions-button>
<f7-actions-button @click="duplicate(false, true)" v-if="transaction.geoLocation">{{ tt('Duplicate (With Geographic Location)') }}</f7-actions-button>
<f7-actions-button @click="duplicate(true, true)" v-if="transaction.geoLocation">{{ tt('Duplicate (With Time and Geographic Location)') }}</f7-actions-button>
<f7-actions-button color="red" @click="remove()">{{ tt('Delete') }}</f7-actions-button>
</f7-actions-group>
<f7-actions-group>
<f7-actions-button bold close>{{ tt('Cancel') }}</f7-actions-button>
@@ -640,6 +642,7 @@ const pictureInput = useTemplateRef<HTMLInputElement>('pictureInput');
const isSupportClipboard = !!navigator.clipboard;
const loadingError = ref<unknown | null>(null);
const isFirstEntry = ref<boolean>(true);
const removingPictureId = ref<string | null>(null);
const transactionDateTimeSheetMode = ref<string>('time');
const showTimeInDefaultTimezone = ref<boolean>(false);
@@ -1319,6 +1322,28 @@ function duplicate(withTime?: boolean, withGeoLocation?: boolean): void {
props.f7router.navigate(`/transaction/add?id=${transaction.value.id}&type=${transaction.value.type}&withTime=${withTime ?? false}&withGeoLocation=${withGeoLocation ?? false}`);
}
function navigateToEdit(): void {
props.f7router.navigate(`/transaction/edit?id=${transaction.value.id}&type=${transaction.value.type}`);
}
function remove(): void {
showConfirm('Are you sure you want to delete this transaction?', () => {
showLoading();
transactionsStore.deleteTransaction({
transaction: transaction.value,
defaultCurrency: defaultCurrency.value
}).then(() => {
hideLoading();
props.f7router.back();
}).catch(error => {
hideLoading();
if (!error.processed) {
showToast(error.message || error);
}
});
});
}
function onPageAfterIn(): void {
routeBackOnError(props.f7router, loadingError);
@@ -1326,6 +1351,21 @@ function onPageAfterIn(): void {
&& !geoLocationStatus.value && !transaction.value.geoLocation) {
updateGeoLocation(false);
}
if (isFirstEntry.value) {
isFirstEntry.value = false;
return;
}
if (mode.value === TransactionEditPageMode.View && query['id']) {
transactionsStore.getTransaction({ transactionId: query['id'], withPictures: true }).then(t => {
setTransactionModel(t, {}, true);
}).catch(error => {
if (!error.processed) {
showToast(error.message || error);
}
});
}
}
function onPageBeforeOut(): void {