2026-05-31 15:42:52 +09:00
|
|
|
|
<script setup>
|
2026-06-01 22:54:41 +09:00
|
|
|
|
import { onBeforeUnmount, onMounted, reactive, ref, watch, nextTick } from 'vue'
|
|
|
|
|
|
import Sortable from 'sortablejs'
|
2026-05-31 15:42:52 +09:00
|
|
|
|
import { accountApi } from '@/api/accountApi'
|
2026-06-24 21:57:50 +09:00
|
|
|
|
import { useDialog } from '@/composables/dialog'
|
2026-05-31 15:42:52 +09:00
|
|
|
|
import IconBtn from '@/components/ui/IconBtn.vue'
|
2026-07-04 01:24:15 +09:00
|
|
|
|
import AppModal from '@/components/ui/AppModal.vue'
|
2026-05-31 15:42:52 +09:00
|
|
|
|
|
2026-06-24 21:57:50 +09:00
|
|
|
|
const dialog = useDialog()
|
2026-05-31 15:42:52 +09:00
|
|
|
|
|
|
|
|
|
|
const TABS = [
|
|
|
|
|
|
{ key: 'BANK', label: '은행계좌' },
|
2026-06-14 15:43:45 +09:00
|
|
|
|
{ key: 'CASH', label: '현금' },
|
2026-05-31 15:42:52 +09:00
|
|
|
|
{ key: 'CARD', label: '신용/체크카드' },
|
|
|
|
|
|
{ key: 'LOAN', label: '대출' },
|
2026-07-04 01:24:15 +09:00
|
|
|
|
{ key: 'MINUS', label: '마이너스통장' },
|
2026-05-31 15:42:52 +09:00
|
|
|
|
{ key: 'INVEST', label: '투자' },
|
|
|
|
|
|
]
|
2026-07-04 01:24:15 +09:00
|
|
|
|
const CARD_TYPES = [
|
|
|
|
|
|
{ value: 'CREDIT', label: '신용카드' },
|
|
|
|
|
|
{ value: 'CHECK', label: '체크카드' },
|
|
|
|
|
|
]
|
|
|
|
|
|
const LOAN_METHODS = [
|
|
|
|
|
|
{ value: 'EQUAL_PAYMENT', label: '원리금균등' },
|
|
|
|
|
|
{ value: 'EQUAL_PRINCIPAL', label: '원금균등' },
|
|
|
|
|
|
{ value: 'BULLET', label: '만기일시' },
|
|
|
|
|
|
{ value: '', label: '선택안함' },
|
|
|
|
|
|
]
|
2026-05-31 15:42:52 +09:00
|
|
|
|
|
|
|
|
|
|
const wallets = ref([])
|
|
|
|
|
|
const networth = ref({ totalAssets: 0, totalLiabilities: 0, netWorth: 0 })
|
|
|
|
|
|
const loading = ref(false)
|
|
|
|
|
|
const error = ref(null)
|
|
|
|
|
|
const activeType = ref('BANK')
|
|
|
|
|
|
|
|
|
|
|
|
const formOpen = ref(false)
|
|
|
|
|
|
const editId = ref(null)
|
|
|
|
|
|
// openingBalance 는 화면 입력값(부채는 갚을 금액의 절대값). 서버 저장 시 부호 변환.
|
|
|
|
|
|
const form = reactive({
|
|
|
|
|
|
type: 'BANK',
|
|
|
|
|
|
name: '',
|
|
|
|
|
|
issuer: '',
|
|
|
|
|
|
accountNumber: '',
|
|
|
|
|
|
cardType: 'CREDIT',
|
|
|
|
|
|
openingBalance: 0,
|
|
|
|
|
|
openingDate: '',
|
|
|
|
|
|
currentValue: null,
|
2026-07-02 00:02:10 +09:00
|
|
|
|
// 대출(LOAN) 전용
|
2026-07-02 00:31:50 +09:00
|
|
|
|
loanAmount: null,
|
2026-07-02 00:02:10 +09:00
|
|
|
|
loanRate: null,
|
|
|
|
|
|
loanMethod: '',
|
|
|
|
|
|
loanMonths: null,
|
|
|
|
|
|
loanStart: '',
|
2026-05-31 15:42:52 +09:00
|
|
|
|
})
|
|
|
|
|
|
const submitting = ref(false)
|
|
|
|
|
|
const formError = ref(null)
|
|
|
|
|
|
|
2026-06-07 16:29:54 +09:00
|
|
|
|
// 드롭다운(계좌별 내역) — 월별로 표시
|
2026-05-31 15:42:52 +09:00
|
|
|
|
const expandedId = ref(null)
|
|
|
|
|
|
const entriesByWallet = reactive({})
|
|
|
|
|
|
const loadingEntries = ref(false)
|
2026-06-07 16:29:54 +09:00
|
|
|
|
const entryMonth = reactive({}) // 계좌별 선택 월(YYYY-MM)
|
|
|
|
|
|
|
|
|
|
|
|
function currentYm() {
|
|
|
|
|
|
const d = new Date()
|
|
|
|
|
|
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}`
|
|
|
|
|
|
}
|
|
|
|
|
|
function ymLabel(ym) {
|
|
|
|
|
|
return ym ? ym.replace('-', '.') : ''
|
|
|
|
|
|
}
|
|
|
|
|
|
// 데이터가 있는 월 목록(오름차순)
|
|
|
|
|
|
function monthList(w) {
|
|
|
|
|
|
const set = new Set((entriesByWallet[w.id] || []).map((e) => (e.entryDate || '').slice(0, 7)).filter(Boolean))
|
|
|
|
|
|
return [...set].sort()
|
|
|
|
|
|
}
|
|
|
|
|
|
function monthEntries(w) {
|
|
|
|
|
|
const ym = entryMonth[w.id]
|
|
|
|
|
|
return (entriesByWallet[w.id] || []).filter((e) => (e.entryDate || '').slice(0, 7) === ym)
|
|
|
|
|
|
}
|
|
|
|
|
|
function monthSum(w) {
|
|
|
|
|
|
return monthEntries(w).reduce((s, e) => s + effectAmount(e, w.id), 0)
|
|
|
|
|
|
}
|
|
|
|
|
|
function canPrev(w) {
|
|
|
|
|
|
return monthList(w).indexOf(entryMonth[w.id]) > 0
|
|
|
|
|
|
}
|
|
|
|
|
|
function canNext(w) {
|
|
|
|
|
|
const ms = monthList(w)
|
|
|
|
|
|
const i = ms.indexOf(entryMonth[w.id])
|
|
|
|
|
|
return i >= 0 && i < ms.length - 1
|
|
|
|
|
|
}
|
|
|
|
|
|
// 데이터가 있는 월 사이로만 이동(빈 달 건너뜀)
|
|
|
|
|
|
function shiftMonth(w, delta) {
|
|
|
|
|
|
const ms = monthList(w)
|
|
|
|
|
|
if (!ms.length) return
|
|
|
|
|
|
const i = ms.indexOf(entryMonth[w.id])
|
|
|
|
|
|
const j = Math.min(ms.length - 1, Math.max(0, (i === -1 ? ms.length - 1 : i) + delta))
|
|
|
|
|
|
entryMonth[w.id] = ms[j]
|
|
|
|
|
|
}
|
2026-05-31 15:42:52 +09:00
|
|
|
|
|
2026-07-04 01:24:15 +09:00
|
|
|
|
const isLiability = (t) => t === 'CARD' || t === 'LOAN' || t === 'MINUS'
|
2026-05-31 15:42:52 +09:00
|
|
|
|
|
2026-06-01 22:54:41 +09:00
|
|
|
|
// 현재 탭(activeType)의 계좌 — 드래그 정렬 대상 (백엔드가 sort_order 순 정렬)
|
|
|
|
|
|
const rows = ref([])
|
|
|
|
|
|
function syncRows() {
|
|
|
|
|
|
rows.value = wallets.value.filter((w) => w.type === activeType.value)
|
|
|
|
|
|
}
|
|
|
|
|
|
watch([wallets, activeType], syncRows, { immediate: true })
|
|
|
|
|
|
|
2026-06-09 23:12:22 +09:00
|
|
|
|
// 탭 선택 (투자 계좌는 평가액 직접입력 방식 — 별도 시세갱신 없음)
|
|
|
|
|
|
function selectTab(key) {
|
2026-06-04 05:01:33 +09:00
|
|
|
|
activeType.value = key
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-06-01 22:54:41 +09:00
|
|
|
|
// ===== 드래그앤드랍 순서 변경 (SortableJS, 터치 지원) =====
|
|
|
|
|
|
const listEl = ref(null)
|
|
|
|
|
|
let sortable = null
|
|
|
|
|
|
function initSortable() {
|
|
|
|
|
|
if (sortable) {
|
|
|
|
|
|
sortable.destroy()
|
|
|
|
|
|
sortable = null
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!listEl.value) return
|
|
|
|
|
|
sortable = Sortable.create(listEl.value, {
|
|
|
|
|
|
handle: '.drag-handle',
|
|
|
|
|
|
animation: 150,
|
|
|
|
|
|
onEnd: (evt) => {
|
|
|
|
|
|
if (evt.oldIndex === evt.newIndex) return
|
|
|
|
|
|
const arr = rows.value
|
|
|
|
|
|
const moved = arr.splice(evt.oldIndex, 1)[0]
|
|
|
|
|
|
arr.splice(evt.newIndex, 0, moved)
|
|
|
|
|
|
persistOrder(arr.map((r) => r.id))
|
|
|
|
|
|
},
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
async function persistOrder(ids) {
|
|
|
|
|
|
try {
|
|
|
|
|
|
await accountApi.reorderWallets(activeType.value, ids)
|
|
|
|
|
|
await load()
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
alert(e.response?.data?.message || '순서 저장에 실패했습니다.')
|
|
|
|
|
|
await load()
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-31 15:42:52 +09:00
|
|
|
|
async function toggleExpand(w) {
|
|
|
|
|
|
if (expandedId.value === w.id) {
|
|
|
|
|
|
expandedId.value = null
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
expandedId.value = w.id
|
|
|
|
|
|
if (w.type === 'INVEST') return // 포트폴리오 컴포넌트가 자체 로드
|
|
|
|
|
|
loadingEntries.value = true
|
|
|
|
|
|
try {
|
|
|
|
|
|
entriesByWallet[w.id] = await accountApi.walletEntries(w.id)
|
2026-06-07 16:29:54 +09:00
|
|
|
|
// 기본 선택 월 = 내역이 있는 가장 최근 월(없으면 이번 달)
|
|
|
|
|
|
const ms = monthList(w)
|
|
|
|
|
|
entryMonth[w.id] = ms.length ? ms[ms.length - 1] : currentYm()
|
2026-05-31 15:42:52 +09:00
|
|
|
|
} catch {
|
|
|
|
|
|
entriesByWallet[w.id] = []
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
loadingEntries.value = false
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 이 계좌 기준 증감(+입금/상환, -지출/출금)
|
|
|
|
|
|
function effectAmount(e, walletId) {
|
|
|
|
|
|
if (e.type === 'TRANSFER') return e.toWalletId === walletId ? e.amount : -e.amount
|
|
|
|
|
|
return e.type === 'INCOME' ? e.amount : -e.amount
|
|
|
|
|
|
}
|
|
|
|
|
|
function entryDesc(e, w) {
|
|
|
|
|
|
const m = e.memo ? ` · ${e.memo}` : ''
|
|
|
|
|
|
if (e.type === 'TRANSFER') {
|
|
|
|
|
|
if (e.toWalletId === w.id) {
|
|
|
|
|
|
// 이 계좌로 들어온 이체: 부채는 상환/납부, 그 외(은행·투자)는 입금
|
2026-07-04 01:24:15 +09:00
|
|
|
|
const inLabel = w.type === 'CARD' || w.type === 'LOAN' || w.type === 'MINUS' ? '상환/납부' : '입금'
|
2026-05-31 15:42:52 +09:00
|
|
|
|
return `${inLabel} ← ${e.walletName || '계좌'}${m}`
|
|
|
|
|
|
}
|
|
|
|
|
|
return `이체 → ${e.toWalletName || '계좌'}${m}`
|
|
|
|
|
|
}
|
|
|
|
|
|
if (e.type === 'INCOME') return `수입${e.category ? ' · ' + e.category : ''}${m}`
|
|
|
|
|
|
return `${e.category || '지출'}${m}`
|
|
|
|
|
|
}
|
|
|
|
|
|
function entryDate(v) {
|
|
|
|
|
|
if (!v) return '-'
|
|
|
|
|
|
const d = new Date(v)
|
|
|
|
|
|
return Number.isNaN(d.getTime())
|
|
|
|
|
|
? v
|
|
|
|
|
|
: `${String(d.getMonth() + 1).padStart(2, '0')}.${String(d.getDate()).padStart(2, '0')}`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function won(n) {
|
|
|
|
|
|
return (n ?? 0).toLocaleString('ko-KR')
|
|
|
|
|
|
}
|
2026-06-04 05:01:33 +09:00
|
|
|
|
|
|
|
|
|
|
// 계좌번호 마스킹: 끝 4자리만 노출(구분자 유지), 눈 버튼으로 전체 보기 토글
|
|
|
|
|
|
const revealedAccts = ref(new Set())
|
|
|
|
|
|
function maskAccount(num) {
|
|
|
|
|
|
if (!num) return ''
|
|
|
|
|
|
const digitCount = (num.match(/\d/g) || []).length
|
|
|
|
|
|
if (digitCount <= 4) return num
|
|
|
|
|
|
const keep = digitCount - 4
|
|
|
|
|
|
let seen = 0
|
|
|
|
|
|
return num.replace(/\d/g, (d) => {
|
|
|
|
|
|
seen += 1
|
|
|
|
|
|
return seen <= keep ? '*' : d
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
function toggleReveal(id) {
|
|
|
|
|
|
const s = new Set(revealedAccts.value)
|
|
|
|
|
|
s.has(id) ? s.delete(id) : s.add(id)
|
|
|
|
|
|
revealedAccts.value = s
|
|
|
|
|
|
}
|
2026-05-31 15:42:52 +09:00
|
|
|
|
function issuerLabel(t) {
|
2026-07-04 01:24:15 +09:00
|
|
|
|
return t === 'BANK' || t === 'MINUS' ? '은행명' : t === 'CARD' ? '카드사' : t === 'INVEST' ? '증권사' : '대출기관'
|
2026-05-31 15:42:52 +09:00
|
|
|
|
}
|
|
|
|
|
|
function openingLabel(t) {
|
2026-07-04 01:24:15 +09:00
|
|
|
|
if (t === 'BANK' || t === 'CASH') return '초기 잔액'
|
|
|
|
|
|
if (t === 'CARD') return '초기 미결제 금액'
|
|
|
|
|
|
if (t === 'INVEST') return '투자금(투입원금)'
|
|
|
|
|
|
if (t === 'MINUS') return '기록 시작 시 사용 잔액'
|
|
|
|
|
|
return '기록 시작 시 잔액'
|
2026-05-31 15:42:52 +09:00
|
|
|
|
}
|
|
|
|
|
|
// 투자 수익률(%) — 투입원금 대비 평가손익
|
|
|
|
|
|
function returnPct(w) {
|
|
|
|
|
|
if (w.type !== 'INVEST' || !w.investedAmount || w.valuationGain == null) return null
|
|
|
|
|
|
return Math.round((w.valuationGain / w.investedAmount) * 1000) / 10
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function load() {
|
|
|
|
|
|
loading.value = true
|
|
|
|
|
|
error.value = null
|
|
|
|
|
|
try {
|
|
|
|
|
|
const [ws, nw] = await Promise.all([accountApi.wallets(), accountApi.netWorth()])
|
|
|
|
|
|
wallets.value = ws
|
|
|
|
|
|
networth.value = nw
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
error.value = e.response?.data?.message || '불러오지 못했습니다.'
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
loading.value = false
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function openCreate() {
|
|
|
|
|
|
editId.value = null
|
|
|
|
|
|
Object.assign(form, {
|
|
|
|
|
|
type: activeType.value,
|
|
|
|
|
|
name: '',
|
|
|
|
|
|
issuer: '',
|
|
|
|
|
|
accountNumber: '',
|
|
|
|
|
|
cardType: 'CREDIT',
|
|
|
|
|
|
openingBalance: 0,
|
|
|
|
|
|
openingDate: '',
|
|
|
|
|
|
currentValue: null,
|
2026-07-02 00:31:50 +09:00
|
|
|
|
loanAmount: null,
|
2026-07-02 00:02:10 +09:00
|
|
|
|
loanRate: null,
|
|
|
|
|
|
loanMethod: '',
|
|
|
|
|
|
loanMonths: null,
|
|
|
|
|
|
loanStart: '',
|
2026-05-31 15:42:52 +09:00
|
|
|
|
})
|
|
|
|
|
|
formError.value = null
|
|
|
|
|
|
formOpen.value = true
|
|
|
|
|
|
}
|
|
|
|
|
|
function openEdit(w) {
|
|
|
|
|
|
editId.value = w.id
|
|
|
|
|
|
Object.assign(form, {
|
|
|
|
|
|
type: w.type,
|
|
|
|
|
|
name: w.name,
|
|
|
|
|
|
issuer: w.issuer || '',
|
|
|
|
|
|
accountNumber: w.accountNumber || '',
|
|
|
|
|
|
cardType: w.cardType || 'CREDIT',
|
|
|
|
|
|
// 부채는 음수 저장값 → 화면엔 절대값(갚을 금액)으로
|
|
|
|
|
|
openingBalance: isLiability(w.type) ? -(w.openingBalance || 0) : w.openingBalance || 0,
|
|
|
|
|
|
openingDate: w.openingDate || '',
|
|
|
|
|
|
currentValue: w.currentValue ?? null,
|
2026-07-02 00:31:50 +09:00
|
|
|
|
loanAmount: w.loanAmount ?? null,
|
2026-07-02 00:02:10 +09:00
|
|
|
|
loanRate: w.loanRate ?? null,
|
|
|
|
|
|
loanMethod: w.loanMethod || '',
|
|
|
|
|
|
loanMonths: w.loanMonths ?? null,
|
|
|
|
|
|
loanStart: w.loanStart || '',
|
2026-05-31 15:42:52 +09:00
|
|
|
|
})
|
|
|
|
|
|
formError.value = null
|
|
|
|
|
|
formOpen.value = true
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function submit() {
|
|
|
|
|
|
formError.value = null
|
|
|
|
|
|
if (!form.name.trim()) {
|
|
|
|
|
|
formError.value = '이름을 입력하세요.'
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
submitting.value = true
|
|
|
|
|
|
const magnitude = Number(form.openingBalance) || 0
|
2026-07-02 00:02:10 +09:00
|
|
|
|
const isLoan = form.type === 'LOAN'
|
2026-05-31 15:42:52 +09:00
|
|
|
|
const payload = {
|
|
|
|
|
|
type: form.type,
|
|
|
|
|
|
name: form.name.trim(),
|
|
|
|
|
|
issuer: form.issuer || null,
|
|
|
|
|
|
accountNumber: form.type === 'BANK' ? form.accountNumber || null : null,
|
|
|
|
|
|
cardType: form.type === 'CARD' ? form.cardType : null,
|
|
|
|
|
|
// 부채는 음수로 저장 (갚을 금액)
|
|
|
|
|
|
openingBalance: isLiability(form.type) ? -magnitude : magnitude,
|
|
|
|
|
|
openingDate: form.openingDate || null,
|
|
|
|
|
|
currentValue:
|
|
|
|
|
|
form.type === 'INVEST' && form.currentValue !== '' && form.currentValue != null
|
|
|
|
|
|
? Number(form.currentValue)
|
|
|
|
|
|
: null,
|
2026-07-02 00:31:50 +09:00
|
|
|
|
loanAmount: isLoan && form.loanAmount ? Number(form.loanAmount) : null,
|
2026-07-02 00:02:10 +09:00
|
|
|
|
loanRate: isLoan && form.loanRate !== null && form.loanRate !== '' ? Number(form.loanRate) : null,
|
|
|
|
|
|
loanMethod: isLoan && form.loanMethod ? form.loanMethod : null,
|
|
|
|
|
|
loanMonths: isLoan && form.loanMonths ? Number(form.loanMonths) : null,
|
|
|
|
|
|
loanStart: isLoan && form.loanStart ? form.loanStart : null,
|
2026-05-31 15:42:52 +09:00
|
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
|
|
|
if (editId.value) await accountApi.updateWallet(editId.value, payload)
|
|
|
|
|
|
else await accountApi.createWallet(payload)
|
|
|
|
|
|
formOpen.value = false
|
|
|
|
|
|
await load()
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
formError.value = e.response?.data?.message || '저장에 실패했습니다.'
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
submitting.value = false
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function remove(w) {
|
2026-06-24 21:57:50 +09:00
|
|
|
|
if (!(await dialog.confirm(`'${w.name}' 을(를) 삭제할까요?`, { title: '삭제', danger: true }))) return
|
2026-05-31 15:42:52 +09:00
|
|
|
|
try {
|
|
|
|
|
|
await accountApi.removeWallet(w.id)
|
|
|
|
|
|
await load()
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
alert(e.response?.data?.message || '삭제에 실패했습니다.')
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function cardTypeLabel(v) {
|
|
|
|
|
|
return v === 'CHECK' ? '체크' : v === 'CREDIT' ? '신용' : ''
|
|
|
|
|
|
}
|
2026-07-02 00:02:10 +09:00
|
|
|
|
function loanMethodLabel(v) {
|
|
|
|
|
|
return v === 'EQUAL_PAYMENT' ? '원리금균등' : v === 'EQUAL_PRINCIPAL' ? '원금균등' : v === 'BULLET' ? '만기일시' : ''
|
|
|
|
|
|
}
|
2026-05-31 15:42:52 +09:00
|
|
|
|
|
2026-06-01 22:54:41 +09:00
|
|
|
|
onMounted(async () => {
|
|
|
|
|
|
await load()
|
|
|
|
|
|
await nextTick()
|
|
|
|
|
|
initSortable()
|
|
|
|
|
|
})
|
|
|
|
|
|
onBeforeUnmount(() => sortable?.destroy())
|
2026-05-31 15:42:52 +09:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
|
<section class="wallet">
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 순자산 요약 -->
|
|
|
|
|
|
<div class="networth">
|
|
|
|
|
|
<div class="nw-card">
|
|
|
|
|
|
<span class="label">총자산</span>
|
|
|
|
|
|
<span class="value asset">{{ won(networth.totalAssets) }}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="nw-card">
|
|
|
|
|
|
<span class="label">총부채</span>
|
|
|
|
|
|
<span class="value debt">{{ won(networth.totalLiabilities) }}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="nw-card">
|
|
|
|
|
|
<span class="label">순자산</span>
|
|
|
|
|
|
<span class="value">{{ won(networth.netWorth) }}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-06-03 16:42:07 +09:00
|
|
|
|
<div class="tabbar">
|
|
|
|
|
|
<div class="tabs">
|
|
|
|
|
|
<button
|
|
|
|
|
|
v-for="t in TABS"
|
|
|
|
|
|
:key="t.key"
|
|
|
|
|
|
type="button"
|
|
|
|
|
|
:class="{ active: activeType === t.key }"
|
2026-06-04 05:01:33 +09:00
|
|
|
|
@click="selectTab(t.key)"
|
2026-06-03 16:42:07 +09:00
|
|
|
|
>{{ t.label }}</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<IconBtn class="tab-add" icon="plus" title="추가" variant="primary" @click="openCreate" />
|
2026-05-31 15:42:52 +09:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<p v-if="error" class="msg error">{{ error }}</p>
|
|
|
|
|
|
<p v-if="loading" class="msg">불러오는 중...</p>
|
|
|
|
|
|
|
2026-06-01 22:54:41 +09:00
|
|
|
|
<ul v-show="!loading && rows.length" ref="listEl" class="wallet-list">
|
|
|
|
|
|
<li v-for="w in rows" :key="w.id" :data-id="w.id" class="wallet-item">
|
2026-05-31 15:42:52 +09:00
|
|
|
|
<div class="wallet-row" @click="toggleExpand(w)">
|
2026-06-01 22:54:41 +09:00
|
|
|
|
<span class="drag-handle" title="드래그하여 순서 변경" @click.stop>≡</span>
|
2026-05-31 15:42:52 +09:00
|
|
|
|
<span class="chevron">{{ expandedId === w.id ? '▾' : '▸' }}</span>
|
|
|
|
|
|
<div class="info">
|
|
|
|
|
|
<div class="line1">
|
|
|
|
|
|
<span class="name">{{ w.name }}</span>
|
|
|
|
|
|
<span v-if="w.type === 'CARD'" class="badge">{{ cardTypeLabel(w.cardType) }}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span class="sub">
|
|
|
|
|
|
{{ w.issuer }}
|
2026-07-04 01:24:15 +09:00
|
|
|
|
<template v-if="(w.type === 'BANK' || w.type === 'MINUS') && w.accountNumber">
|
2026-06-04 05:01:33 +09:00
|
|
|
|
· {{ revealedAccts.has(w.id) ? w.accountNumber : maskAccount(w.accountNumber) }}
|
|
|
|
|
|
<button
|
|
|
|
|
|
type="button" class="acct-eye"
|
|
|
|
|
|
:title="revealedAccts.has(w.id) ? '가리기' : '전체 보기'"
|
|
|
|
|
|
@click.stop="toggleReveal(w.id)"
|
|
|
|
|
|
>{{ revealedAccts.has(w.id) ? '🙈' : '👁' }}</button>
|
|
|
|
|
|
</template>
|
2026-06-09 23:12:22 +09:00
|
|
|
|
<template v-if="w.type === 'INVEST'"> · 투자금 {{ won(w.investedAmount) }}</template>
|
2026-07-02 00:31:50 +09:00
|
|
|
|
<template v-if="w.type === 'LOAN'">
|
|
|
|
|
|
<span v-if="w.loanAmount"> · 실행 {{ won(w.loanAmount) }}원</span>
|
|
|
|
|
|
<span v-if="w.loanRate"> · {{ w.loanRate }}%<span v-if="w.loanMethod"> / {{ loanMethodLabel(w.loanMethod) }}</span></span>
|
2026-07-02 00:02:10 +09:00
|
|
|
|
</template>
|
2026-05-31 15:42:52 +09:00
|
|
|
|
</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="balance-wrap">
|
|
|
|
|
|
<div class="balance" :class="{ neg: w.balance < 0 }">{{ won(w.balance) }}</div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
v-if="w.type === 'INVEST' && w.valuationGain != null"
|
|
|
|
|
|
class="gain" :class="w.valuationGain < 0 ? 'neg' : 'pos'"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{ w.valuationGain >= 0 ? '+' : '' }}{{ won(w.valuationGain) }}<span v-if="returnPct(w) != null"> ({{ returnPct(w) }}%)</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="actions" @click.stop>
|
|
|
|
|
|
<IconBtn icon="edit" title="수정" size="sm" @click="openEdit(w)" />
|
|
|
|
|
|
<IconBtn icon="trash" title="삭제" variant="danger" size="sm" @click="remove(w)" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-06-09 23:12:22 +09:00
|
|
|
|
<!-- 드롭다운: 투자는 투자금·평가액 요약, 그 외는 계좌별 내역 -->
|
2026-05-31 15:42:52 +09:00
|
|
|
|
<div v-if="expandedId === w.id" class="entry-drop">
|
2026-06-09 23:12:22 +09:00
|
|
|
|
<div v-if="w.type === 'INVEST'" class="manual-note">
|
|
|
|
|
|
<div class="invest-figs">
|
|
|
|
|
|
<div class="fig"><span class="fig-k">투자금</span><span class="fig-v">{{ won(w.investedAmount) }}</span></div>
|
|
|
|
|
|
<div class="fig"><span class="fig-k">평가액</span><span class="fig-v">{{ won(w.balance) }}</span></div>
|
|
|
|
|
|
<div class="fig"><span class="fig-k">손익</span>
|
|
|
|
|
|
<span class="fig-v" :class="(w.valuationGain || 0) < 0 ? 'neg' : 'pos'">
|
|
|
|
|
|
{{ (w.valuationGain || 0) >= 0 ? '+' : '' }}{{ won(w.valuationGain || 0) }}<span v-if="returnPct(w) != null"> ({{ returnPct(w) }}%)</span>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<p class="manual-sub">평가액을 갱신하려면 위 <b>수정</b>에서 ‘현재 평가액’을 바꾸세요.</p>
|
2026-06-04 05:01:33 +09:00
|
|
|
|
</div>
|
2026-05-31 15:42:52 +09:00
|
|
|
|
<template v-else>
|
|
|
|
|
|
<p v-if="loadingEntries" class="drop-msg">불러오는 중...</p>
|
2026-06-07 16:29:54 +09:00
|
|
|
|
<template v-else-if="(entriesByWallet[w.id] || []).length">
|
|
|
|
|
|
<!-- 월 네비게이션 + 그 달 합계 -->
|
|
|
|
|
|
<div class="month-nav">
|
|
|
|
|
|
<button type="button" class="mn-btn" :disabled="!canPrev(w)" aria-label="이전 달" @click="shiftMonth(w, -1)">◀</button>
|
|
|
|
|
|
<span class="mn-label">{{ ymLabel(entryMonth[w.id]) }}</span>
|
|
|
|
|
|
<button type="button" class="mn-btn" :disabled="!canNext(w)" aria-label="다음 달" @click="shiftMonth(w, 1)">▶</button>
|
|
|
|
|
|
<span class="mn-sum" :class="monthSum(w) < 0 ? 'neg' : 'pos'">
|
|
|
|
|
|
합계 {{ monthSum(w) >= 0 ? '+' : '' }}{{ won(monthSum(w)) }}
|
2026-05-31 15:42:52 +09:00
|
|
|
|
</span>
|
2026-06-07 16:29:54 +09:00
|
|
|
|
</div>
|
|
|
|
|
|
<ul v-if="monthEntries(w).length" class="drop-list">
|
|
|
|
|
|
<li v-for="e in monthEntries(w)" :key="e.id" class="drop-row">
|
|
|
|
|
|
<span class="d-date">{{ entryDate(e.entryDate) }}</span>
|
|
|
|
|
|
<span class="d-desc">{{ entryDesc(e, w) }}</span>
|
|
|
|
|
|
<span class="d-amount" :class="effectAmount(e, w.id) < 0 ? 'neg' : 'pos'">
|
|
|
|
|
|
{{ effectAmount(e, w.id) >= 0 ? '+' : '' }}{{ won(effectAmount(e, w.id)) }}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
<p v-else class="drop-msg">이 달 내역이 없습니다.</p>
|
|
|
|
|
|
</template>
|
2026-05-31 15:42:52 +09:00
|
|
|
|
<p v-else class="drop-msg">연관 내역이 없습니다.</p>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
2026-06-29 08:26:02 +09:00
|
|
|
|
<div v-if="!loading && !rows.length" class="empty-state">
|
|
|
|
|
|
<p class="empty-emoji">🏦</p>
|
|
|
|
|
|
<p class="empty-title">아직 등록된 계좌가 없어요</p>
|
2026-07-04 01:24:15 +09:00
|
|
|
|
<p class="empty-desc">은행·카드·현금·대출·마이너스통장·투자를 추가해보세요.</p>
|
2026-06-29 08:26:02 +09:00
|
|
|
|
<button type="button" class="empty-cta" @click="openCreate">+ 계좌 추가</button>
|
|
|
|
|
|
</div>
|
2026-05-31 15:42:52 +09:00
|
|
|
|
|
|
|
|
|
|
<!-- 추가/수정 모달 -->
|
2026-07-04 01:24:15 +09:00
|
|
|
|
<AppModal v-model="formOpen" :title="`${TABS.find((t) => t.key === form.type)?.label} ${editId ? '수정' : '추가'}`">
|
|
|
|
|
|
<form class="wallet-form" @submit.prevent="submit">
|
|
|
|
|
|
<label>이름(별칭)<input v-model="form.name" type="text" placeholder="예: 월급통장 / 메인카드 / 신용대출" :disabled="submitting" /></label>
|
|
|
|
|
|
<label v-if="form.type !== 'CASH'">{{ issuerLabel(form.type) }}<input v-model="form.issuer" type="text" :disabled="submitting" /></label>
|
|
|
|
|
|
<label v-if="form.type === 'BANK' || form.type === 'MINUS'">계좌번호<input v-model="form.accountNumber" type="text" placeholder="(선택)" :disabled="submitting" /></label>
|
|
|
|
|
|
<div v-if="form.type === 'CARD'" class="field">
|
|
|
|
|
|
<span class="field-label">카드 종류</span>
|
|
|
|
|
|
<div class="chip-group">
|
|
|
|
|
|
<button
|
|
|
|
|
|
v-for="c in CARD_TYPES" :key="c.value"
|
|
|
|
|
|
type="button" class="chip" :class="{ active: form.cardType === c.value }"
|
|
|
|
|
|
:disabled="submitting" @click="form.cardType = c.value"
|
|
|
|
|
|
>{{ c.label }}</button>
|
2026-05-31 15:42:52 +09:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2026-07-04 01:24:15 +09:00
|
|
|
|
<label>{{ openingLabel(form.type) }}<input v-model.number="form.openingBalance" type="number" min="0" :disabled="submitting" /></label>
|
|
|
|
|
|
<template v-if="form.type === 'INVEST'">
|
|
|
|
|
|
<label>현재 평가액
|
|
|
|
|
|
<input v-model.number="form.currentValue" type="number" min="0" placeholder="예: 현재 계좌 평가금액" :disabled="submitting" />
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<p class="form-hint">
|
|
|
|
|
|
<b>투자금</b>(투입원금)과 <b>현재 평가액</b>만 입력하면 손익이 자동 계산됩니다. (퇴직연금·연금·증권계좌 공통)<br />
|
|
|
|
|
|
평가액은 위 <b>수정</b>에서 주기적으로 갱신하세요.
|
|
|
|
|
|
</p>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<label>기준일<input v-model="form.openingDate" type="date" :disabled="submitting" /></label>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 대출 전용 -->
|
|
|
|
|
|
<template v-if="form.type === 'LOAN'">
|
|
|
|
|
|
<label>대출 실행 금액(원금)
|
|
|
|
|
|
<input v-model.number="form.loanAmount" type="number" min="0"
|
|
|
|
|
|
placeholder="처음 빌린 금액 (예: 10000000)" :disabled="submitting" />
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<label>연이자율(%)
|
|
|
|
|
|
<input v-model.number="form.loanRate" type="number" min="0" max="100" step="0.01"
|
|
|
|
|
|
placeholder="예: 5.25" :disabled="submitting" />
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<div class="field">
|
|
|
|
|
|
<span class="field-label">상환방식</span>
|
|
|
|
|
|
<div class="chip-group">
|
|
|
|
|
|
<button
|
|
|
|
|
|
v-for="m in LOAN_METHODS" :key="m.value"
|
|
|
|
|
|
type="button" class="chip" :class="{ active: form.loanMethod === m.value }"
|
|
|
|
|
|
:disabled="submitting" @click="form.loanMethod = m.value"
|
|
|
|
|
|
>{{ m.label }}</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<label>대출기간(개월)
|
|
|
|
|
|
<input v-model.number="form.loanMonths" type="number" min="1"
|
|
|
|
|
|
placeholder="예: 120 (10년)" :disabled="submitting" />
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<label>대출시작일
|
|
|
|
|
|
<input v-model="form.loanStart" type="date" :disabled="submitting" />
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<p v-if="formError" class="msg error">{{ formError }}</p>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="buttons">
|
|
|
|
|
|
<IconBtn icon="close" title="취소" @click="formOpen = false" />
|
|
|
|
|
|
<IconBtn icon="save" :title="editId ? '수정' : '등록'" variant="primary" type="submit" :disabled="submitting" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
</AppModal>
|
2026-05-31 15:42:52 +09:00
|
|
|
|
</section>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
.wallet {
|
|
|
|
|
|
max-width: 640px;
|
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
|
}
|
|
|
|
|
|
.head {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
margin-bottom: 1rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
h1 {
|
|
|
|
|
|
font-size: 1.5rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
button {
|
|
|
|
|
|
padding: 0.45rem 0.9rem;
|
|
|
|
|
|
border: 1px solid var(--color-border);
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
background: var(--color-background-soft);
|
|
|
|
|
|
color: var(--color-text);
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
button:disabled {
|
|
|
|
|
|
opacity: 0.5;
|
|
|
|
|
|
cursor: not-allowed;
|
|
|
|
|
|
}
|
|
|
|
|
|
button.danger {
|
|
|
|
|
|
border-color: #c0392b;
|
|
|
|
|
|
color: #c0392b;
|
|
|
|
|
|
}
|
|
|
|
|
|
button.primary {
|
|
|
|
|
|
border-color: hsla(160, 100%, 37%, 1);
|
|
|
|
|
|
color: hsla(160, 100%, 37%, 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
.networth {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
gap: 0.75rem;
|
|
|
|
|
|
margin-bottom: 1.25rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.nw-card {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
border: 1px solid var(--color-border);
|
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
padding: 0.7rem 1rem;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
gap: 0.3rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.nw-card .label {
|
|
|
|
|
|
font-size: 0.82rem;
|
|
|
|
|
|
opacity: 0.7;
|
|
|
|
|
|
}
|
|
|
|
|
|
.nw-card .value {
|
|
|
|
|
|
font-size: 1.1rem;
|
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
|
}
|
|
|
|
|
|
.nw-card .value.asset {
|
|
|
|
|
|
color: #2e7d32;
|
|
|
|
|
|
}
|
|
|
|
|
|
.nw-card .value.debt {
|
|
|
|
|
|
color: #c0392b;
|
|
|
|
|
|
}
|
2026-06-03 16:42:07 +09:00
|
|
|
|
.tabbar {
|
2026-05-31 15:42:52 +09:00
|
|
|
|
display: flex;
|
2026-06-03 16:42:07 +09:00
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
gap: 0.5rem;
|
2026-05-31 15:42:52 +09:00
|
|
|
|
border-bottom: 1px solid var(--color-border);
|
|
|
|
|
|
margin-bottom: 1rem;
|
|
|
|
|
|
}
|
2026-06-03 16:42:07 +09:00
|
|
|
|
.tabs {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
gap: 0.25rem;
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
overflow-x: auto;
|
2026-06-22 22:38:22 +09:00
|
|
|
|
-webkit-overflow-scrolling: touch;
|
|
|
|
|
|
scrollbar-width: none; /* 한 줄 유지(넘치면 가로 스크롤), 스크롤바 숨김 */
|
|
|
|
|
|
}
|
|
|
|
|
|
.tabs::-webkit-scrollbar {
|
|
|
|
|
|
display: none;
|
2026-06-03 16:42:07 +09:00
|
|
|
|
}
|
|
|
|
|
|
.tab-add {
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
}
|
2026-05-31 15:42:52 +09:00
|
|
|
|
.tabs button {
|
|
|
|
|
|
border: 0;
|
|
|
|
|
|
border-bottom: 2px solid transparent;
|
|
|
|
|
|
border-radius: 0;
|
|
|
|
|
|
background: transparent;
|
2026-06-22 22:38:22 +09:00
|
|
|
|
padding: 0.6rem 0.7rem;
|
|
|
|
|
|
white-space: nowrap; /* 버튼 안 글자가 줄바꿈되지 않도록(두 줄 방지) */
|
|
|
|
|
|
flex-shrink: 0;
|
2026-05-31 15:42:52 +09:00
|
|
|
|
}
|
|
|
|
|
|
.tabs button.active {
|
|
|
|
|
|
border-bottom-color: hsla(160, 100%, 37%, 1);
|
|
|
|
|
|
color: hsla(160, 100%, 37%, 1);
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
}
|
|
|
|
|
|
.wallet-list {
|
|
|
|
|
|
list-style: none;
|
2026-06-03 16:42:07 +09:00
|
|
|
|
padding-left: 0;
|
|
|
|
|
|
margin: 0;
|
2026-05-31 15:42:52 +09:00
|
|
|
|
}
|
|
|
|
|
|
.wallet-item {
|
|
|
|
|
|
border-bottom: 1px solid var(--color-border);
|
|
|
|
|
|
}
|
|
|
|
|
|
.wallet-row {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 0.6rem;
|
|
|
|
|
|
padding: 0.7rem 0;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
.wallet-row:hover {
|
|
|
|
|
|
background: var(--color-background-soft);
|
|
|
|
|
|
}
|
2026-06-01 22:54:41 +09:00
|
|
|
|
.drag-handle {
|
|
|
|
|
|
cursor: grab;
|
|
|
|
|
|
user-select: none;
|
|
|
|
|
|
opacity: 0.45;
|
|
|
|
|
|
font-size: 1.1rem;
|
|
|
|
|
|
padding: 0 0.15rem;
|
|
|
|
|
|
touch-action: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
.drag-handle:active {
|
|
|
|
|
|
cursor: grabbing;
|
|
|
|
|
|
}
|
2026-05-31 15:42:52 +09:00
|
|
|
|
.chevron {
|
|
|
|
|
|
width: 1rem;
|
|
|
|
|
|
opacity: 0.6;
|
|
|
|
|
|
font-size: 0.8rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.entry-drop {
|
|
|
|
|
|
padding: 0.25rem 0 0.75rem 1.6rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.drop-msg {
|
|
|
|
|
|
font-size: 0.85rem;
|
|
|
|
|
|
opacity: 0.65;
|
|
|
|
|
|
padding: 0.5rem 0;
|
|
|
|
|
|
}
|
2026-06-04 05:01:33 +09:00
|
|
|
|
.refresh-note {
|
|
|
|
|
|
font-size: 0.82rem;
|
|
|
|
|
|
opacity: 0.6;
|
|
|
|
|
|
}
|
|
|
|
|
|
.manual-note {
|
|
|
|
|
|
padding: 0.6rem 0.2rem;
|
|
|
|
|
|
font-size: 0.85rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.manual-note p {
|
|
|
|
|
|
margin: 0 0 0.3rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.manual-note .manual-sub {
|
|
|
|
|
|
opacity: 0.6;
|
|
|
|
|
|
font-size: 0.78rem;
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
}
|
2026-06-09 23:12:22 +09:00
|
|
|
|
.invest-figs {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
gap: 0.5rem;
|
|
|
|
|
|
margin-bottom: 0.5rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.invest-figs .fig {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
gap: 0.15rem;
|
|
|
|
|
|
padding: 0.5rem 0.6rem;
|
|
|
|
|
|
background: var(--color-background-soft, #f4f5f7);
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.invest-figs .fig-k {
|
|
|
|
|
|
font-size: 0.72rem;
|
|
|
|
|
|
opacity: 0.6;
|
|
|
|
|
|
}
|
|
|
|
|
|
.invest-figs .fig-v {
|
|
|
|
|
|
font-size: 0.95rem;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
}
|
|
|
|
|
|
.invest-figs .fig-v.pos {
|
|
|
|
|
|
color: #1a7f37;
|
|
|
|
|
|
}
|
|
|
|
|
|
.invest-figs .fig-v.neg {
|
|
|
|
|
|
color: #cf222e;
|
|
|
|
|
|
}
|
2026-06-07 16:29:54 +09:00
|
|
|
|
.month-nav {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 0.5rem;
|
|
|
|
|
|
padding: 0.3rem 0 0.4rem;
|
|
|
|
|
|
border-bottom: 1px solid var(--color-border);
|
|
|
|
|
|
margin-bottom: 0.3rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.mn-btn {
|
|
|
|
|
|
width: 1.8rem;
|
|
|
|
|
|
height: 1.8rem;
|
|
|
|
|
|
border: 1px solid var(--color-border);
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
background: var(--color-background-soft);
|
|
|
|
|
|
color: var(--color-text);
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
line-height: 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
.mn-btn:disabled {
|
|
|
|
|
|
opacity: 0.35;
|
|
|
|
|
|
cursor: not-allowed;
|
|
|
|
|
|
}
|
|
|
|
|
|
.mn-label {
|
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
|
font-size: 0.9rem;
|
|
|
|
|
|
min-width: 4.2rem;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
.mn-sum {
|
|
|
|
|
|
margin-left: auto;
|
|
|
|
|
|
font-size: 0.82rem;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
}
|
|
|
|
|
|
.mn-sum.pos {
|
|
|
|
|
|
color: #2e7d32;
|
|
|
|
|
|
}
|
|
|
|
|
|
.mn-sum.neg {
|
|
|
|
|
|
color: #c0392b;
|
|
|
|
|
|
}
|
2026-05-31 15:42:52 +09:00
|
|
|
|
.drop-list {
|
|
|
|
|
|
list-style: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
.drop-row {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 0.6rem;
|
|
|
|
|
|
padding: 0.35rem 0;
|
|
|
|
|
|
font-size: 0.85rem;
|
|
|
|
|
|
border-top: 1px dashed var(--color-border);
|
|
|
|
|
|
}
|
|
|
|
|
|
.d-date {
|
|
|
|
|
|
width: 3rem;
|
|
|
|
|
|
opacity: 0.7;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
}
|
|
|
|
|
|
.d-desc {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
}
|
|
|
|
|
|
.d-amount {
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
}
|
|
|
|
|
|
.d-amount.pos {
|
|
|
|
|
|
color: #2e7d32;
|
|
|
|
|
|
}
|
|
|
|
|
|
.d-amount.neg {
|
|
|
|
|
|
color: #c0392b;
|
|
|
|
|
|
}
|
|
|
|
|
|
.info {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
.line1 {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 0.4rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.name {
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
}
|
|
|
|
|
|
.badge {
|
|
|
|
|
|
font-size: 0.72rem;
|
|
|
|
|
|
border: 1px solid var(--color-border);
|
|
|
|
|
|
border-radius: 3px;
|
|
|
|
|
|
padding: 0.05rem 0.35rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.sub {
|
|
|
|
|
|
font-size: 0.82rem;
|
|
|
|
|
|
opacity: 0.7;
|
|
|
|
|
|
}
|
2026-06-04 05:01:33 +09:00
|
|
|
|
.acct-eye {
|
|
|
|
|
|
border: 0;
|
|
|
|
|
|
background: transparent;
|
|
|
|
|
|
padding: 0 0.15rem;
|
|
|
|
|
|
font-size: 0.78rem;
|
|
|
|
|
|
line-height: 1;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
opacity: 0.7;
|
|
|
|
|
|
}
|
|
|
|
|
|
.acct-eye:hover {
|
|
|
|
|
|
opacity: 1;
|
|
|
|
|
|
}
|
2026-05-31 15:42:52 +09:00
|
|
|
|
.balance-wrap {
|
|
|
|
|
|
text-align: right;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
}
|
|
|
|
|
|
.balance {
|
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
}
|
|
|
|
|
|
.balance.neg {
|
|
|
|
|
|
color: #c0392b;
|
|
|
|
|
|
}
|
|
|
|
|
|
.gain {
|
|
|
|
|
|
font-size: 0.76rem;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
}
|
|
|
|
|
|
.gain.pos {
|
|
|
|
|
|
color: #2e7d32;
|
|
|
|
|
|
}
|
|
|
|
|
|
.gain.neg {
|
|
|
|
|
|
color: #c0392b;
|
|
|
|
|
|
}
|
|
|
|
|
|
.form-hint {
|
|
|
|
|
|
font-size: 0.76rem;
|
|
|
|
|
|
opacity: 0.65;
|
|
|
|
|
|
margin: -0.2rem 0 0.1rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.actions {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
gap: 0.4rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.actions button {
|
|
|
|
|
|
padding: 0.2rem 0.55rem;
|
|
|
|
|
|
font-size: 0.82rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.msg {
|
|
|
|
|
|
margin: 1rem 0;
|
|
|
|
|
|
}
|
2026-06-29 08:26:02 +09:00
|
|
|
|
/* 신규 유저 빈 상태 */
|
|
|
|
|
|
.empty-state {
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
padding: 2.4rem 1rem 2rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.empty-emoji {
|
|
|
|
|
|
font-size: 2.6rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.empty-title {
|
|
|
|
|
|
margin-top: 0.6rem;
|
|
|
|
|
|
font-size: 1.05rem;
|
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
|
color: var(--color-heading);
|
|
|
|
|
|
}
|
|
|
|
|
|
.empty-desc {
|
|
|
|
|
|
margin-top: 0.3rem;
|
|
|
|
|
|
font-size: 0.88rem;
|
|
|
|
|
|
opacity: 0.7;
|
|
|
|
|
|
}
|
|
|
|
|
|
.empty-cta {
|
|
|
|
|
|
margin-top: 1.1rem;
|
|
|
|
|
|
padding: 0.7rem 1.6rem;
|
|
|
|
|
|
border: 0;
|
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
|
background: hsla(160, 100%, 37%, 1);
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
font-size: 0.95rem;
|
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
.empty-cta:hover {
|
|
|
|
|
|
background: hsla(160, 100%, 32%, 1);
|
|
|
|
|
|
}
|
2026-05-31 15:42:52 +09:00
|
|
|
|
.msg.error {
|
|
|
|
|
|
color: #c0392b;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.wallet-form {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
gap: 0.6rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.wallet-form label {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
gap: 0.25rem;
|
|
|
|
|
|
font-size: 0.85rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.wallet-form input,
|
|
|
|
|
|
.wallet-form select {
|
|
|
|
|
|
padding: 0.5rem 0.7rem;
|
|
|
|
|
|
border: 1px solid var(--color-border);
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
background: var(--color-background-soft);
|
|
|
|
|
|
color: var(--color-text);
|
|
|
|
|
|
}
|
2026-07-04 01:24:15 +09:00
|
|
|
|
/* 배지형 선택 */
|
|
|
|
|
|
.field {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
gap: 0.3rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.field-label {
|
|
|
|
|
|
font-size: 0.82rem;
|
|
|
|
|
|
opacity: 0.7;
|
|
|
|
|
|
}
|
|
|
|
|
|
.chip-group {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
gap: 0.35rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.chip {
|
|
|
|
|
|
padding: 0.28rem 0.75rem;
|
|
|
|
|
|
border: 1.5px solid var(--color-border);
|
|
|
|
|
|
border-radius: 100px;
|
|
|
|
|
|
background: var(--color-background-soft);
|
|
|
|
|
|
color: var(--color-text);
|
|
|
|
|
|
font-size: 0.82rem;
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
line-height: 1.4;
|
|
|
|
|
|
transition: border-color 0.12s, background 0.12s, color 0.12s;
|
|
|
|
|
|
}
|
|
|
|
|
|
.chip:disabled { opacity: 0.45; cursor: not-allowed; }
|
|
|
|
|
|
.chip.active {
|
|
|
|
|
|
border-color: hsla(160, 100%, 37%, 1);
|
|
|
|
|
|
background: hsla(160, 100%, 37%, 1);
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
}
|
2026-05-31 15:42:52 +09:00
|
|
|
|
.buttons {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
|
gap: 0.5rem;
|
|
|
|
|
|
margin-top: 0.5rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
@media (max-width: 768px) {
|
|
|
|
|
|
.wallet {
|
|
|
|
|
|
max-width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
.networth {
|
|
|
|
|
|
gap: 0.5rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.nw-card {
|
|
|
|
|
|
padding: 0.5rem 0.6rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.nw-card .value {
|
|
|
|
|
|
font-size: 0.95rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.tabs button {
|
|
|
|
|
|
padding: 0.55rem 0.6rem;
|
|
|
|
|
|
font-size: 0.9rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
/* 한 줄 유지: 이름(축소) · 잔액 · 아이콘 */
|
|
|
|
|
|
.wallet-row {
|
|
|
|
|
|
column-gap: 0.4rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.info {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
/* 이름은 한 줄(말줄임), sub(예수금·주식 등)는 자연 줄바꿈 — 손익과 겹치지 않게 */
|
|
|
|
|
|
.line1 {
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
}
|
|
|
|
|
|
.sub {
|
|
|
|
|
|
word-break: break-all;
|
|
|
|
|
|
}
|
|
|
|
|
|
.wallet-row {
|
|
|
|
|
|
align-items: flex-start;
|
|
|
|
|
|
}
|
|
|
|
|
|
.balance {
|
|
|
|
|
|
font-size: 0.95rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.balance-wrap {
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
padding-left: 0.3rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.actions {
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
gap: 0.3rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|