调整
Some checks failed
Docker Build & Deploy / Build Docker Image (push) Failing after 9s
Docker Build & Deploy / Deploy to Production (push) Has been skipped

This commit is contained in:
2025-12-27 22:05:50 +08:00
parent 3b5675d50d
commit 1a805e51f7
6 changed files with 183 additions and 101 deletions

View File

@@ -191,8 +191,8 @@ const transactionList = ref([])
const loading = ref(false)
const refreshing = ref(false)
const finished = ref(false)
const lastId = ref(null)
const lastTime = ref(null)
const pageIndex = ref(1)
const pageSize = 20
const total = ref(0)
const detailVisible = ref(false)
const currentTransaction = ref(null)
@@ -251,18 +251,16 @@ const loadClassifyList = async (type = null) => {
// 加载数据
const loadData = async (isRefresh = false) => {
if (isRefresh) {
lastId.value = null
lastTime.value = null
pageIndex.value = 1
transactionList.value = []
finished.value = false
}
loading.value = true
try {
const params = {}
if (lastTime.value && lastId.value) {
params.lastOccurredAt = lastTime.value
params.lastId = lastId.value
const params = {
pageIndex: pageIndex.value,
pageSize: pageSize
}
// 添加搜索关键词
@@ -275,8 +273,6 @@ const loadData = async (isRefresh = false) => {
if (response.success) {
const newList = response.data || []
total.value = response.total || 0
const newLastId = response.lastId || 0
const newLastTime = response.lastTime
if (isRefresh) {
transactionList.value = newList
@@ -284,15 +280,11 @@ const loadData = async (isRefresh = false) => {
transactionList.value = [...(transactionList.value || []), ...newList]
}
if (newLastId > 0 && newLastTime) {
lastId.value = newLastId
lastTime.value = newLastTime
}
if (newList.length === 0 || newList.length < 20) {
if (newList.length === 0 || newList.length < pageSize) {
finished.value = true
} else {
finished.value = false
pageIndex.value++
}
} else {
showToast(response.message || '加载数据失败')