fix: 账目加载错误常驻显示(含完整堆栈)便于定位

This commit is contained in:
root
2026-10-16 13:59:05 +08:00
parent 4d2bea139a
commit e721c356af
8 changed files with 51 additions and 36 deletions
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./web-DOIpoVam.js","./index-Cy5zm918.js","./index-DWsZ3Bb0.css"])))=>i.map(i=>d[i]);
import{r as s,_ as i}from"./index-Cy5zm918.js";var t;(function(e){e.Documents="DOCUMENTS",e.Data="DATA",e.Library="LIBRARY",e.Cache="CACHE",e.External="EXTERNAL",e.ExternalStorage="EXTERNAL_STORAGE"})(t||(t={}));var a;(function(e){e.UTF8="utf8",e.ASCII="ascii",e.UTF16="utf16"})(a||(a={}));const E=s("Filesystem",{web:()=>i(()=>import("./web-DOIpoVam.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(e=>new e.FilesystemWeb)});export{t as Directory,a as Encoding,E as Filesystem};
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./web-DemcfbD8.js","./index-B9GSzgPK.js","./index-egFbJdki.css"])))=>i.map(i=>d[i]);
import{r as s,_ as i}from"./index-B9GSzgPK.js";var t;(function(e){e.Documents="DOCUMENTS",e.Data="DATA",e.Library="LIBRARY",e.Cache="CACHE",e.External="EXTERNAL",e.ExternalStorage="EXTERNAL_STORAGE"})(t||(t={}));var a;(function(e){e.UTF8="utf8",e.ASCII="ascii",e.UTF16="utf16"})(a||(a={}));const E=s("Filesystem",{web:()=>i(()=>import("./web-DemcfbD8.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(e=>new e.FilesystemWeb)});export{t as Directory,a as Encoding,E as Filesystem};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -8,8 +8,8 @@
<link rel="icon" href="./icons/icon.svg" type="image/svg+xml" />
<link rel="apple-touch-icon" href="./icons/icon-192.png" />
<title>实习工作日志</title>
<script type="module" crossorigin src="./assets/index-Cy5zm918.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-DWsZ3Bb0.css">
<script type="module" crossorigin src="./assets/index-B9GSzgPK.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-egFbJdki.css">
</head>
<body>
<div id="app"></div>
+12 -5
View File
@@ -6,14 +6,14 @@ async function main() {
const mod = await import('../src/db/schema')
const db = mod.db
await db.project.bulkAdd([{ name: 'P1', archived: 0, created_at: '2025-01-01T00:00:00' }])
await db.work_log.bulkAdd([{ date: '2025-01-02', created_at: '2025-01-02T00:00:00' }])
await db.setting.bulkAdd([
await db.project.bulkPut([{ name: 'P1', archived: 0, created_at: '2025-01-01T00:00:00' }])
await db.work_log.bulkPut([{ date: '2025-01-02', created_at: '2025-01-02T00:00:00' }])
await db.setting.bulkPut([
{ key: 'work_start', value: '09:00' },
{ key: 'sync_base_url', value: 'http://127.0.0.1:3780' }
])
await db.attendance.bulkAdd([{ date: '2025-01-02', clock_in_at: '2025-01-02T09:00:00', clock_out_at: '2025-01-02T18:00:00', kind: 'normal', note: null, created_at: '2025-01-02T09:00:00' }])
await db.table('transaction').bulkAdd([{ type: 'expense', category: '餐饮', amount: 2500, date: '2025-01-02', note: 'lunch', reimbursable: 1, reimbursed: 0, created_at: '2025-01-02T12:00:00' }])
await db.attendance.bulkPut([{ date: '2025-01-02', clock_in_at: '2025-01-02T09:00:00', clock_out_at: '2025-01-02T18:00:00', kind: 'normal', note: null, created_at: '2025-01-02T09:00:00' }])
await db.table('transaction').bulkPut([{ type: 'expense', category: '餐饮', amount: 2500, date: '2025-01-02', note: 'lunch', reimbursable: 1, reimbursed: 0, created_at: '2025-01-02T12:00:00' }])
const engine = await import('../src/sync/engine')
engine.enableRealtimeSync()
@@ -39,6 +39,13 @@ async function main() {
// 二次同步幂等验证
const r2 = await engine.runSync({ baseUrl: 'http://127.0.0.1:3780', username: 'rt', password: 'rt123456' })
console.log('SYNC2 OK:', JSON.stringify(r2))
// 记账加载路径验证(与 LedgerView 相同的查询)
const ledger = await import('./db/repo')
const ledgerRows = await ledger.listTransactionsBetween('2026-01-01', '2026-12-31')
console.log('LEDGER LOAD OK:', ledgerRows.length, '条')
const stats = await ledger.listTransactionsBetween('2025-01-01', '2026-12-31')
console.log('LEDGER RANGE OK:', stats.length, '条')
process.exit(0)
}
+9 -1
View File
@@ -25,6 +25,7 @@ const fDate = ref(todayStr())
const fNote = ref('')
const fReimb = ref(false)
const fError = ref('')
const loadError = ref('')
const submitting = ref(false)
const dialogOpen = ref(false)
@@ -45,8 +46,10 @@ async function load() {
loading.value = true
try {
rows.value = await listTransactionsBetween(monthStart.value, monthEnd.value)
loadError.value = ''
} catch (e) {
showToast('账目加载失败:' + (e instanceof Error ? e.message : String(e)))
loadError.value = '账目加载失败:' + (e instanceof Error ? (e.stack || e.message) : String(e))
showToast('账目加载失败')
}
loading.value = false
}
@@ -273,6 +276,11 @@ async function confirmDelete() {
</div>
</div>
<div v-if="loadError" class="card section">
<div class="form-error">{{ loadError }}</div>
<div class="muted loc-note">请将上方完整错误文字发送给开发者</div>
</div>
<div class="card table-card">
<table class="tx-table">
<thead>