feat: update VSCode settings for ESLint and Prettier integration
chore: refactor ESLint configuration for improved linting rules and performance fix: handle push event data parsing in service worker style: adjust tabbar item properties for better readability in App.vue refactor: remove unused functions and improve code clarity in TransactionDetail.vue fix: ensure consistent event handling in CalendarView.vue style: clean up component structure and formatting in various Vue files chore: update launch script for better command execution feat: add ESLint configuration file for consistent code style across the project fix: resolve issues with button click events in multiple components
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="input-section" v-if="!parseResult" style="margin: 12px 12px 0 16px;">
|
||||
<div v-if="!parseResult" class="input-section" style="margin: 12px 12px 0 16px;">
|
||||
<van-field
|
||||
v-model="text"
|
||||
type="textarea"
|
||||
@@ -14,9 +14,9 @@
|
||||
type="primary"
|
||||
round
|
||||
block
|
||||
@click="handleParse"
|
||||
:loading="parsing"
|
||||
:loading="parsing"
|
||||
:disabled="!text.trim()"
|
||||
@click="handleParse"
|
||||
>
|
||||
智能解析
|
||||
</van-button>
|
||||
@@ -35,8 +35,8 @@
|
||||
plain
|
||||
round
|
||||
block
|
||||
@click="parseResult = null"
|
||||
class="mt-2"
|
||||
class="mt-2"
|
||||
@click="parseResult = null"
|
||||
>
|
||||
重新输入
|
||||
</van-button>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<template>
|
||||
<!-- eslint-disable vue/no-v-html -->
|
||||
<template>
|
||||
<van-popup
|
||||
v-model:show="visible"
|
||||
position="bottom"
|
||||
@@ -17,7 +18,7 @@
|
||||
<slot name="header-actions"></slot>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 子标题/统计信息 -->
|
||||
<div v-if="subtitle" class="header-stats">
|
||||
<span class="stats-text" v-html="subtitle" />
|
||||
@@ -45,24 +46,24 @@ import { computed, useSlots } from 'vue'
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
default: '',
|
||||
},
|
||||
subtitle: {
|
||||
type: String,
|
||||
default: ''
|
||||
default: '',
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '80%'
|
||||
default: '80%',
|
||||
},
|
||||
closeable: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
default: true,
|
||||
},
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
@@ -72,7 +73,7 @@ const slots = useSlots()
|
||||
// 双向绑定
|
||||
const visible = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (value) => emit('update:modelValue', value)
|
||||
set: (value) => emit('update:modelValue', value),
|
||||
})
|
||||
|
||||
// 判断是否有操作按钮
|
||||
@@ -121,10 +122,9 @@ const hasActions = computed(() => !!slots['header-actions'])
|
||||
text-align: center;
|
||||
color: var(--van-text-color, #323233);
|
||||
/*超出长度*/
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.header-stats {
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
{{ group.sampleClassify }}
|
||||
</van-tag>
|
||||
<span class="count-text">{{ group.count }} 条</span>
|
||||
<span class="amount-text" v-if="group.totalAmount">
|
||||
<span v-if="group.totalAmount" class="amount-text">
|
||||
¥{{ Math.abs(group.totalAmount).toFixed(2) }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
size="small"
|
||||
:loading="loading || saving"
|
||||
:disabled="loading || saving"
|
||||
@click="handleClick"
|
||||
class="smart-classify-btn"
|
||||
@click="handleClick"
|
||||
>
|
||||
<template v-if="!loading && !saving">
|
||||
<van-icon :name="buttonIcon" />
|
||||
|
||||
@@ -292,16 +292,6 @@ const clearClassify = () => {
|
||||
showToast('已清空分类')
|
||||
}
|
||||
|
||||
// 获取交易类型名称
|
||||
const getTypeName = (type) => {
|
||||
const typeMap = {
|
||||
0: '支出',
|
||||
1: '收入',
|
||||
2: '不计入收支'
|
||||
}
|
||||
return typeMap[type] || '未知'
|
||||
}
|
||||
|
||||
// 格式化日期
|
||||
const formatDate = (dateString) => {
|
||||
if (!dateString) return ''
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
<van-checkbox
|
||||
v-if="showCheckbox"
|
||||
:model-value="isSelected(transaction.id)"
|
||||
@update:model-value="toggleSelection(transaction)"
|
||||
class="checkbox-col"
|
||||
@update:model-value="toggleSelection(transaction)"
|
||||
/>
|
||||
<div
|
||||
class="transaction-card"
|
||||
@@ -66,10 +66,10 @@
|
||||
<div :class="['amount', getAmountClass(transaction.type)]">
|
||||
{{ formatAmount(transaction.amount, transaction.type) }}
|
||||
</div>
|
||||
<div class="balance" v-if="transaction.balance && transaction.balance > 0">
|
||||
<div v-if="transaction.balance && transaction.balance > 0" class="balance">
|
||||
余额: {{ formatMoney(transaction.balance) }}
|
||||
</div>
|
||||
<div class="balance" v-if="transaction.refundAmount && transaction.refundAmount > 0">
|
||||
<div v-if="transaction.refundAmount && transaction.refundAmount > 0" class="balance">
|
||||
退款: {{ formatMoney(transaction.refundAmount) }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -77,7 +77,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template #right v-if="showDelete">
|
||||
<template v-if="showDelete" #right>
|
||||
<van-button
|
||||
square
|
||||
type="danger"
|
||||
@@ -161,6 +161,7 @@ const handleDeleteClick = async (transaction) => {
|
||||
window.dispatchEvent(new CustomEvent('transaction-deleted', { detail: transaction.id }))
|
||||
} catch (e) {
|
||||
// ignore in non-browser environment
|
||||
console.log('非浏览器环境,跳过派发 transaction-deleted 事件', e)
|
||||
}
|
||||
} else {
|
||||
showToast(response.message || '删除失败')
|
||||
|
||||
Reference in New Issue
Block a user