feat: 银行端

This commit is contained in:
FlowerWater
2025-12-20 12:43:50 +08:00
parent 9591234e70
commit 06df763ed4
21 changed files with 3473 additions and 230 deletions

33
src/store/bank.ts Normal file
View File

@@ -0,0 +1,33 @@
import { defineStore } from 'pinia'
import { getBankStats } from '@/pagesBank/api'
import type { BankStats } from '@/typings/bank'
export const useBankStore = defineStore('bank', () => {
const stats = ref<BankStats | null>(null)
const loading = ref(false)
/** 获取银行统计数据 */
async function fetchStats() {
loading.value = true
try {
const res = await getBankStats()
stats.value = res
} catch (error) {
console.error('Fetch bank stats failed:', error)
} finally {
loading.value = false
}
}
/** 重置状态 */
function reset() {
stats.value = null
}
return {
stats,
loading,
fetchStats,
reset
}
})