添加功能
This commit is contained in:
@@ -142,6 +142,11 @@
|
|||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 禁止在导航栏上进行拖动操作 */
|
||||||
|
.page-container-flex :deep(.van-nav-bar) {
|
||||||
|
touch-action: none;
|
||||||
|
}
|
||||||
|
|
||||||
/* 修复表单字段过长时的换行显示 */
|
/* 修复表单字段过长时的换行显示 */
|
||||||
:deep(.van-field__control) {
|
:deep(.van-field__control) {
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
@click-left="onClickLeft"
|
@click-left="onClickLeft"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div class="analysis-content">
|
<div class="scroll-content analysis-content">
|
||||||
<!-- 输入区域 -->
|
<!-- 输入区域 -->
|
||||||
<div class="input-section">
|
<div class="input-section">
|
||||||
<van-field
|
<van-field
|
||||||
|
|||||||
@@ -154,6 +154,36 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 不计收支分类统计 -->
|
||||||
|
<div class="common-card" v-if="noneCategories.length > 0">
|
||||||
|
<div class="card-header">
|
||||||
|
<h3 class="card-title">不计收支分类统计</h3>
|
||||||
|
<van-tag type="info" size="medium">{{ noneCategories.length }}类</van-tag>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="category-list">
|
||||||
|
<div
|
||||||
|
v-for="category in noneCategories"
|
||||||
|
:key="category.classify"
|
||||||
|
class="category-item clickable"
|
||||||
|
@click="goToCategoryBills(category.classify, 2)"
|
||||||
|
>
|
||||||
|
<div class="category-info">
|
||||||
|
<div class="category-color none-color"></div>
|
||||||
|
<div class="category-name-with-count">
|
||||||
|
<span class="category-name">{{ category.classify || '未分类' }}</span>
|
||||||
|
<span class="category-count">{{ category.count }}笔</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="category-stats">
|
||||||
|
<div class="category-amount none-text">¥{{ formatMoney(category.amount) }}</div>
|
||||||
|
<div class="category-percent">{{ category.percent }}%</div>
|
||||||
|
</div>
|
||||||
|
<van-icon name="arrow" class="category-arrow" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 趋势统计 -->
|
<!-- 趋势统计 -->
|
||||||
<div class="common-card">
|
<div class="common-card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
@@ -332,6 +362,7 @@ const monthlyData = ref({
|
|||||||
// 分类数据
|
// 分类数据
|
||||||
const expenseCategories = ref([])
|
const expenseCategories = ref([])
|
||||||
const incomeCategories = ref([])
|
const incomeCategories = ref([])
|
||||||
|
const noneCategories = ref([])
|
||||||
|
|
||||||
// 趋势数据
|
// 趋势数据
|
||||||
const trendData = ref([])
|
const trendData = ref([])
|
||||||
@@ -518,6 +549,22 @@ const fetchCategoryData = async () => {
|
|||||||
percent: item.percent
|
percent: item.percent
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取不计收支分类
|
||||||
|
const noneResponse = await getCategoryStatistics({
|
||||||
|
year: currentYear.value,
|
||||||
|
month: currentMonth.value,
|
||||||
|
type: 2 // 不计收支
|
||||||
|
})
|
||||||
|
|
||||||
|
if (noneResponse.success && noneResponse.data) {
|
||||||
|
noneCategories.value = noneResponse.data.map(item => ({
|
||||||
|
classify: item.classify,
|
||||||
|
amount: item.amount,
|
||||||
|
count: item.count,
|
||||||
|
percent: item.percent
|
||||||
|
}))
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取分类数据失败:', error)
|
console.error('获取分类数据失败:', error)
|
||||||
showToast('获取分类数据失败')
|
showToast('获取分类数据失败')
|
||||||
@@ -918,6 +965,15 @@ onActivated(() => {
|
|||||||
color: #51cf66;
|
color: #51cf66;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 不计收支颜色 */
|
||||||
|
.none-color {
|
||||||
|
background-color: #909399;
|
||||||
|
}
|
||||||
|
|
||||||
|
.none-text {
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
|
||||||
.expense-color {
|
.expense-color {
|
||||||
background-color: #ff6b6b;
|
background-color: #ff6b6b;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user