diff --git a/src/api/adminApi.js b/src/api/adminApi.js
index 2bf5c05..210277b 100644
--- a/src/api/adminApi.js
+++ b/src/api/adminApi.js
@@ -30,6 +30,23 @@ export const adminApi = {
return http.put('/admin/board-setting', { tagCategoryId })
},
+ // 기본(디폴트) 분류 관리 (관리자) — 사용자가 '기본 분류 불러오기'로 가져감
+ defaultCategories() {
+ return http.get('/admin/default-categories')
+ },
+ createDefaultCategory(payload) {
+ return http.post('/admin/default-categories', payload)
+ },
+ updateDefaultCategory(id, payload) {
+ return http.put(`/admin/default-categories/${id}`, payload)
+ },
+ removeDefaultCategory(id) {
+ return http.delete(`/admin/default-categories/${id}`)
+ },
+ reorderDefaultCategories(type, ids) {
+ return http.put('/admin/default-categories/reorder', { type, ids })
+ },
+
// 앱 설정 (관리자)
getSignupSetting() {
return http.get('/admin/signup-setting')
diff --git a/src/components/layout/AppSidebar.vue b/src/components/layout/AppSidebar.vue
index 3effd87..42c0b56 100644
--- a/src/components/layout/AppSidebar.vue
+++ b/src/components/layout/AppSidebar.vue
@@ -40,6 +40,7 @@ const ui = useUiStore()
+
diff --git a/src/router/index.js b/src/router/index.js
index 78810c0..eec1fa2 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -54,6 +54,12 @@ const router = createRouter({
component: () => import('../views/admin/TagAdminView.vue'),
meta: { requiresAuth: true, requiresAdmin: true },
},
+ {
+ path: '/admin/default-categories',
+ name: 'admin-default-categories',
+ component: () => import('../views/admin/DefaultCategoryView.vue'),
+ meta: { requiresAuth: true, requiresAdmin: true },
+ },
{
// 구 가계부 대시보드 → 내역으로 (대시보드 정보는 홈/통계로 이전)
path: '/account',
diff --git a/src/views/account/CategoryView.vue b/src/views/account/CategoryView.vue
index d7dd893..e96af66 100644
--- a/src/views/account/CategoryView.vue
+++ b/src/views/account/CategoryView.vue
@@ -157,8 +157,8 @@ function removeCategory(c) {
})
}
-function importExisting() {
- askConfirm('기존 분류 불러오기', '기존 내역에서 사용한 분류들을 목록으로 가져올까요?', async () => {
+function importDefaults() {
+ askConfirm('기본 분류 불러오기', '관리자가 설정한 기본 분류를 내 분류로 가져올까요?\n같은 이름은 건너뜁니다.', async () => {
error.value = null
try {
categories.value = await accountApi.importCategories()
@@ -187,7 +187,7 @@ onBeforeUnmount(destroySortables)
diff --git a/src/views/admin/DefaultCategoryView.vue b/src/views/admin/DefaultCategoryView.vue
new file mode 100644
index 0000000..cef1699
--- /dev/null
+++ b/src/views/admin/DefaultCategoryView.vue
@@ -0,0 +1,356 @@
+
+
+
+
+
+
+ 전체 사용자 공용 기본 분류 템플릿입니다. 사용자가 분류 관리에서 ‘기본 분류 불러오기’로 자기 분류에 복사해 씁니다.
+ 대분류 아래 소분류로 묶을 수 있습니다(2단계).
+
+
+
+
+
+
+
+
+ ≡ 손잡이로 순서 변경 — 대분류는 소분류와 함께, 소분류는 그 대분류 안에서만 이동합니다.
+
+ {{ error }}
+ 불러오는 중...
+
+
+
+ 등록된 {{ activeType === 'EXPENSE' ? '지출' : '수입' }} 기본 분류가 없습니다.
+
+
+
+
+