@@ -288,7 +332,7 @@ onMounted(load)
-
등록된 항목이 없습니다.
+
등록된 항목이 없습니다.
@@ -427,6 +471,17 @@ button.primary {
.wallet-row:hover {
background: var(--color-background-soft);
}
+.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;
+}
.chevron {
width: 1rem;
opacity: 0.6;
diff --git a/src/views/account/BudgetView.vue b/src/views/account/BudgetView.vue
index f423df0..84e3e61 100644
--- a/src/views/account/BudgetView.vue
+++ b/src/views/account/BudgetView.vue
@@ -86,17 +86,18 @@ const expectedIncome = ref(null)
const incomeDraft = ref('')
async function loadIncome() {
try {
- const r = await accountApi.expectedIncome()
+ const r = await accountApi.expectedIncome({ year: year.value, month: month.value })
expectedIncome.value = r.expectedIncome
incomeDraft.value = r.expectedIncome ?? ''
} catch {
expectedIncome.value = null
+ incomeDraft.value = ''
}
}
async function saveIncome() {
try {
const v = incomeDraft.value === '' || incomeDraft.value == null ? 0 : Number(incomeDraft.value)
- const r = await accountApi.setExpectedIncome(v)
+ const r = await accountApi.setExpectedIncome({ year: year.value, month: month.value, expectedIncome: v })
expectedIncome.value = r.expectedIncome
} catch (e) {
alert(e.response?.data?.message || '저장에 실패했습니다.')
@@ -128,6 +129,7 @@ function prevMonth() {
year.value -= 1
} else month.value -= 1
load()
+ loadIncome()
}
function nextMonth() {
if (month.value === 12) {
@@ -135,6 +137,7 @@ function nextMonth() {
year.value += 1
} else month.value += 1
load()
+ loadIncome()
}
function openCreate() {