fix: 数据大屏自测问题修复。

This commit is contained in:
tianyongbao
2026-03-05 23:52:33 +08:00
parent 2c1968d7d6
commit afc67ab4da

View File

@@ -304,7 +304,7 @@
<view class="section" v-if="openCardData.length > 0"> <view class="section" v-if="openCardData.length > 0">
<view class="section-title">近两年储蓄卡开卡统计</view> <view class="section-title">近两年储蓄卡开卡统计</view>
<view class="chart-container"> <view class="chart-container">
<qiun-data-charts type="column" :opts="openCardChartOpts" :chartData="openCardChartData" /> <qiun-data-charts type="area" :opts="openCardChartOpts" :chartData="openCardChartData" />
</view> </view>
</view> </view>
<!-- 近15天净资产趋势 --> <!-- 近15天净资产趋势 -->
@@ -889,9 +889,12 @@ const openCardChartData = computed(() => {
return { categories: [], series: [{ name: '开卡数量', data: [] }] } return { categories: [], series: [{ name: '开卡数量', data: [] }] }
} }
// 按时间排序
const sortedData = openCardData.value.slice().sort((a, b) => a.time.localeCompare(b.time))
return { return {
categories: openCardData.value.map(item => item.time), categories: sortedData.map(item => item.time),
series: [{ name: '开卡数量', data: openCardData.value.map(item => Number(item.value) || 0) }] series: [{ name: '开卡数量', data: sortedData.map(item => Number(item.value) || 0) }]
} }
}) })
@@ -915,8 +918,12 @@ const openCardChartOpts = ref({
showTitle: false showTitle: false
}, },
extra: { extra: {
column: { area: {
width: 20 type: 'curve',
opacity: 0.2,
addLine: true,
width: 2,
gradient: true
} }
} }
}) })
@@ -980,6 +987,9 @@ const loadAllData = async () => {
const monthStartDay = `${year}-${month}-01` const monthStartDay = `${year}-${month}-01`
const todayStr = `${year}-${month}-${day}` const todayStr = `${year}-${month}-${day}`
const monthKey = `${year}-${month}` const monthKey = `${year}-${month}`
// 当月最后一天
const lastDayOfMonth = new Date(year, today.getMonth() + 1, 0)
const monthEndDay = `${year}-${month}-${String(lastDayOfMonth.getDate()).padStart(2, '0')}`
// 计算近7天 // 计算近7天
const weekAgo = new Date(today) const weekAgo = new Date(today)
@@ -1075,7 +1085,7 @@ const loadAllData = async () => {
getAcccountsOutInAnalysis({ getAcccountsOutInAnalysis({
type: 1, type: 1,
startTime: monthStartDay, startTime: monthStartDay,
endTime: todayStr endTime: monthEndDay
}).then(res => { }).then(res => {
monthlyBalance.value = (res && res.data && res.data.balance) || 0 monthlyBalance.value = (res && res.data && res.data.balance) || 0
monthlyTotalOutcome.value = (res && res.data && res.data.totalOutcome) || 0 monthlyTotalOutcome.value = (res && res.data && res.data.totalOutcome) || 0
@@ -1086,7 +1096,7 @@ const loadAllData = async () => {
getInstallmentHistoryAnalysis({ getInstallmentHistoryAnalysis({
type: 1, type: 1,
startTime: monthStartDay, startTime: monthStartDay,
endTime: todayStr, endTime: monthEndDay,
dataType: '2' dataType: '2'
}).then(res => { }).then(res => {
const dueDetail = Number(res.data.dueDetail) || 0 const dueDetail = Number(res.data.dueDetail) || 0
@@ -1101,7 +1111,7 @@ const loadAllData = async () => {
getInstallmentHistoryAnalysis({ getInstallmentHistoryAnalysis({
type: 1, type: 1,
startTime: monthStartDay, startTime: monthStartDay,
endTime: todayStr, endTime: monthEndDay,
dataType: '3' dataType: '3'
}).then(res => { }).then(res => {
monthlyLendDue.value = (res && res.data && res.data.dueDetail) || 0 monthlyLendDue.value = (res && res.data && res.data.dueDetail) || 0
@@ -1267,7 +1277,10 @@ const loadAllData = async () => {
dataType: '1' dataType: '1'
}) })
if (openRes && openRes.data && openRes.data.debitList) { if (openRes && openRes.data && openRes.data.debitList) {
openCardData.value = openRes.data.debitList openCardData.value = openRes.data.debitList || []
console.log('储蓄卡开卡数据:', openCardData.value)
} else {
openCardData.value = []
} }
} catch (err) { } catch (err) {
// 忽略错误 // 忽略错误