fix
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 25s
Docker Build & Deploy / Deploy to Production (push) Successful in 18s
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 25s
Docker Build & Deploy / Deploy to Production (push) Successful in 18s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
This commit is contained in:
@@ -247,7 +247,7 @@
|
||||
|
||||
<div class="category-list">
|
||||
<div
|
||||
v-for="category in incomeCategoriesSimpView"
|
||||
v-for="category in incomeCategoriesView"
|
||||
:key="category.classify"
|
||||
class="category-item clickable"
|
||||
@click="goToCategoryBills(category.classify, 1)"
|
||||
@@ -272,14 +272,6 @@
|
||||
class="category-arrow"
|
||||
/>
|
||||
</div>
|
||||
<!-- 展开/收起按钮 -->
|
||||
<div
|
||||
v-if="incomeCategoriesView.length > 1"
|
||||
class="expand-toggle"
|
||||
@click="showAllIncome = !showAllIncome"
|
||||
>
|
||||
<van-icon :name="showAllIncome ? 'arrow-up' : 'arrow-down'" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 不计收支分类统计 -->
|
||||
@@ -292,7 +284,7 @@
|
||||
不计收支分类统计
|
||||
</h3>
|
||||
<van-tag
|
||||
type="info"
|
||||
type="warning"
|
||||
size="medium"
|
||||
>
|
||||
{{ noneCategoriesView.length }}类
|
||||
@@ -301,7 +293,7 @@
|
||||
|
||||
<div class="category-list">
|
||||
<div
|
||||
v-for="category in noneCategoriesSimpView"
|
||||
v-for="category in noneCategoriesView"
|
||||
:key="category.classify"
|
||||
class="category-item clickable"
|
||||
@click="goToCategoryBills(category.classify, 2)"
|
||||
@@ -326,14 +318,6 @@
|
||||
class="category-arrow"
|
||||
/>
|
||||
</div>
|
||||
<!-- 展开/收起按钮 -->
|
||||
<div
|
||||
v-if="noneCategoriesView.length > 1"
|
||||
class="expand-toggle"
|
||||
@click="showAllNone = !showAllNone"
|
||||
>
|
||||
<van-icon :name="showAllNone ? 'arrow-up' : 'arrow-down'" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 其他统计 -->
|
||||
@@ -464,8 +448,6 @@ const firstLoading = ref(true)
|
||||
const refreshing = ref(false)
|
||||
const showMonthPicker = ref(false)
|
||||
const showAllExpense = ref(false)
|
||||
const showAllIncome = ref(false)
|
||||
const showAllNone = ref(false)
|
||||
const currentYear = ref(new Date().getFullYear())
|
||||
const currentMonth = ref(new Date().getMonth() + 1)
|
||||
const selectedDate = ref([
|
||||
@@ -535,21 +517,6 @@ const expenseCategoriesView = computed(() => {
|
||||
return list
|
||||
})
|
||||
|
||||
const incomeCategoriesSimpView = computed(() => {
|
||||
const list = incomeCategoriesView.value
|
||||
|
||||
if (showAllIncome.value) {
|
||||
return list
|
||||
}
|
||||
|
||||
// 只展示未分类
|
||||
const unclassified = list.filter((c) => c.classify === '未分类' || !c.classify)
|
||||
if (unclassified.length > 0) {
|
||||
return [...unclassified]
|
||||
}
|
||||
return []
|
||||
})
|
||||
|
||||
const incomeCategoriesView = computed(() => {
|
||||
const list = [...incomeCategories.value]
|
||||
const unclassifiedIndex = list.findIndex((c) => !c.classify)
|
||||
@@ -561,21 +528,6 @@ const incomeCategoriesView = computed(() => {
|
||||
return list
|
||||
})
|
||||
|
||||
const noneCategoriesSimpView = computed(() => {
|
||||
const list = noneCategoriesView.value
|
||||
|
||||
if (showAllNone.value) {
|
||||
return list
|
||||
}
|
||||
|
||||
// 只展示未分类
|
||||
const unclassified = list.filter((c) => c.classify === '未分类' || !c.classify)
|
||||
if (unclassified.length > 0) {
|
||||
return [...unclassified]
|
||||
}
|
||||
return []
|
||||
})
|
||||
|
||||
const noneCategoriesView = computed(() => {
|
||||
const list = [...noneCategories.value]
|
||||
const unclassifiedIndex = list.findIndex((c) => !c.classify)
|
||||
@@ -698,8 +650,6 @@ const changeMonth = (offset) => {
|
||||
|
||||
// 重置展开状态
|
||||
showAllExpense.value = false
|
||||
showAllIncome.value = false
|
||||
showAllNone.value = false
|
||||
|
||||
fetchStatistics()
|
||||
}
|
||||
@@ -725,8 +675,6 @@ const onMonthConfirm = ({ selectedValues }) => {
|
||||
|
||||
// 重置展开状态
|
||||
showAllExpense.value = false
|
||||
showAllIncome.value = false
|
||||
showAllNone.value = false
|
||||
|
||||
fetchStatistics()
|
||||
}
|
||||
@@ -950,18 +898,6 @@ const renderChart = (data) => {
|
||||
return accumulatedBalance
|
||||
})
|
||||
|
||||
// 计算最大绝对值,用于动态设置Y轴间隔
|
||||
const allValues = [...expenses, ...incomes, ...balances]
|
||||
const maxValue = Math.max(...allValues.map(Math.abs), 1000)
|
||||
|
||||
// 动态计算间隔:目标是大约5-8个刻度
|
||||
// 比如最大值是 11k,间隔可以是 2k (11/2 = 5.5)
|
||||
// 最大值是 3k,间隔可以是 0.5k 或 1k
|
||||
let interval = 1000
|
||||
if (maxValue > 8000) {
|
||||
interval = Math.ceil(maxValue / 6 / 1000) * 1000
|
||||
}
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
@@ -1083,29 +1019,12 @@ const renderPieChart = () => {
|
||||
// 按照金额排序
|
||||
list.sort((a, b) => b.amount - a.amount)
|
||||
|
||||
if (list.length <= 8) {
|
||||
if (list.length > 0) {
|
||||
chartData = list.map((item, index) => ({
|
||||
value: item.amount,
|
||||
name: item.classify || '未分类',
|
||||
itemStyle: { color: colors[index % colors.length] }
|
||||
}))
|
||||
} else {
|
||||
const top = list.slice(0, 7)
|
||||
const rest = list.slice(7)
|
||||
chartData = top.map((item, index) => ({
|
||||
value: item.amount,
|
||||
name: item.classify || '未分类',
|
||||
itemStyle: { color: colors[index % colors.length] }
|
||||
}))
|
||||
|
||||
const otherAmount = rest.reduce((s, c) => s + c.amount, 0)
|
||||
if (otherAmount > 0) {
|
||||
chartData.push({
|
||||
value: otherAmount,
|
||||
name: '其他',
|
||||
itemStyle: { color: '#AAB7B8' }
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const option = {
|
||||
|
||||
Reference in New Issue
Block a user