feat: 설정 - 엑셀 데이터 내보내기(백업)
CI / build (push) Successful in 44s

- utils/backup.js: 가계부 전체(내역·계좌·분류·고정지출·예산·태그·자주내역)를
  이름 기준 참조로 .xlsx 다중 시트 생성. xlsx 동적 import(별도 청크)
- 웹/PC=다운로드, 앱(네이티브)=Filesystem 저장 + Share
- SettingsView: '데이터 백업' 카드(엑셀로 내보내기 동작 / 가져오기 버튼=준비중)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ByungCheol
2026-06-28 08:14:19 +09:00
parent 4ffc01f484
commit 457fd8127a
6 changed files with 289 additions and 8 deletions
+35
View File
@@ -4,9 +4,26 @@ import { RouterLink } from 'vue-router'
import { Preferences } from '@capacitor/preferences'
import { useDialog } from '@/composables/dialog'
import { useUiStore } from '@/stores/ui'
import { exportBackup } from '@/utils/backup'
const dialog = useDialog()
const ui = useUiStore()
const exporting = ref(false)
async function doExport() {
if (exporting.value) return
exporting.value = true
try {
await exportBackup()
} catch (e) {
window.alert(e?.message || '내보내기에 실패했습니다.')
} finally {
exporting.value = false
}
}
function importBackup() {
dialog.alert('가져오기(복구)는 준비 중입니다. 곧 제공됩니다.')
}
const THEMES = [
{ value: 'system', label: '시스템' },
{ value: 'light', label: '라이트' },
@@ -92,6 +109,24 @@ async function clearAppData() {
</div>
</section>
<!-- 데이터 백업 -->
<section class="card">
<button type="button" class="row row-btn" :disabled="exporting" @click="doExport">
<div class="row-main">
<span class="row-label">엑셀로 내보내기</span>
<span class="row-sub">가계부 전체 데이터를 .xlsx 파일로 저장</span>
</div>
<span class="row-value">{{ exporting ? '내보내는 중…' : '내보내기' }}</span>
</button>
<button type="button" class="row row-btn" @click="importBackup">
<div class="row-main">
<span class="row-label">엑셀에서 가져오기</span>
<span class="row-sub">백업 파일로 데이터 복구</span>
</div>
<span class="row-value">가져오기</span>
</button>
</section>
<section class="card">
<RouterLink to="/settings/account" class="row row-link">
<div class="row-main">