From dd17fae5f4fe14085298a2d7d6e501415f2d11af Mon Sep 17 00:00:00 2001 From: ByungCheol Date: Wed, 24 Jun 2026 23:03:52 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EA=B8=B0=EB=B3=B8=20=EB=B6=84=EB=A5=98?= =?UTF-8?q?=20=E2=80=94=20=EA=B4=80=EB=A6=AC=EC=9E=90=20=EC=84=A4=EC=A0=95?= =?UTF-8?q?=20=ED=99=94=EB=A9=B4=20+=20=EC=82=AC=EC=9A=A9=EC=9E=90=20'?= =?UTF-8?q?=EA=B8=B0=EB=B3=B8=20=EB=B6=84=EB=A5=98=20=EB=B6=88=EB=9F=AC?= =?UTF-8?q?=EC=98=A4=EA=B8=B0'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 관리자 전용 기본 분류 관리 화면(DefaultCategoryView, 계층 드래그) + 라우트/사이드바 링크 - adminApi 기본분류 CRUD/reorder - CategoryView '기존 분류 불러오기' → '기본 분류 불러오기'(관리자 정의 분류 복사) Co-Authored-By: Claude Opus 4.8 --- src/api/adminApi.js | 17 ++ src/components/layout/AppSidebar.vue | 1 + src/router/index.js | 6 + src/views/account/CategoryView.vue | 6 +- src/views/admin/DefaultCategoryView.vue | 356 ++++++++++++++++++++++++ 5 files changed, 383 insertions(+), 3 deletions(-) create mode 100644 src/views/admin/DefaultCategoryView.vue 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 @@ + + + + +