Skip to content

Commit

Permalink
admin: Separate info panels into individual pages
Browse files Browse the repository at this point in the history
  • Loading branch information
somnisomni committed Dec 14, 2024
1 parent 32524ba commit e9451e3
Show file tree
Hide file tree
Showing 8 changed files with 203 additions and 6 deletions.
21 changes: 19 additions & 2 deletions projects/Admin/src/pages/AdminLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,25 @@
<VListSubheader>관리</VListSubheader>
<VListItem prepend-icon="mdi-view-dashboard" title="대시보드" value="dashboard"
:to="{ name: 'admin' }" exact />
<VListItem prepend-icon="mdi-store-cog" title="부스 정보 / 인포" value="info"
:to="{ name: 'admin-info' }" exact />
<!-- <VListItem prepend-icon="mdi-store-cog" title="부스 정보 / 인포" value="info"
:to="{ name: 'admin-info' }" exact /> -->
<VListGroup>
<template #activator="{ props }">
<VListItem v-bind="props"
prepend-icon="mdi-store-cog"
title="부스 정보" />
</template>
<VListItem title="배너 이미지" value="banner-image"
:to="{ name: 'admin-info-banner-image' }" exact />
<VListItem title="인포 이미지" value="info-image"
:to="{ name: 'admin-info-info-image' }" exact />
<VListItem title="부스 등록 정보" value="info"
:to="{ name: 'admin-info-info' }" exact />
<VListItem title="멤버" value="member"
:to="{ name: 'admin-info-member' }" exact />
<VListItem title="공지 사항" value="notice"
:to="{ name: 'admin-info-notice' }" exact />
</VListGroup>
<VListItem prepend-icon="mdi-gift-open" title="굿즈" value="goods"
:to="{ name: 'admin-goods' }" exact />
<VListItem prepend-icon="mdi-receipt-text" title="판매 기록" value="orders"
Expand Down
42 changes: 42 additions & 0 deletions projects/Admin/src/pages/subpages/info/InfoBannerImagePage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<template>
<VContainer>
<VCard class="pa-0 ma-0 rounded-lg"
elevation="4">
<ImageWithUpload :existingSrc="imagePath"
contextName="배너"
width="100%"
height="300px"
aspectRatio="3/1"
:uploadCallback="imageUploadCallback"
:deleteCallback="imageDeleteCallback" />
</VCard>
</VContainer>
</template>

<script lang="ts">
import { Component, toNative, Vue } from "vue-facing-decorator";
import ImageWithUpload from "@/components/common/ImageWithUpload.vue";
import { useAdminAPIStore } from "@/plugins/stores/api";
import { useAdminStore } from "@/plugins/stores/admin";
@Component({
components: {
ImageWithUpload,
},
})
class InfoBannerImagePage extends Vue {
get imagePath(): string | null {
return useAdminStore().currentBooth.booth!.bannerImage?.path ?? null;
}
async imageUploadCallback(file: File | Blob | null) {
return await useAdminAPIStore().uploadBoothBannerImage(file!);
}
async imageDeleteCallback() {
return await useAdminAPIStore().deleteBoothBannerImage();
}
}
export default toNative(InfoBannerImagePage);
</script>
42 changes: 42 additions & 0 deletions projects/Admin/src/pages/subpages/info/InfoInfoImagePage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<template>
<VContainer>
<VCard class="pa-0 ma-0 rounded-lg"
elevation="4">
<ImageWithUpload :existingSrc="imagePath"
contextName="인포"
width="100%"
height="auto"
aspectRatio="auto"
:uploadCallback="imageUploadCallback"
:deleteCallback="imageDeleteCallback" />
</VCard>
</VContainer>
</template>

<script lang="ts">
import { Component, toNative, Vue } from "vue-facing-decorator";
import ImageWithUpload from "@/components/common/ImageWithUpload.vue";
import { useAdminAPIStore } from "@/plugins/stores/api";
import { useAdminStore } from "@/plugins/stores/admin";
@Component({
components: {
ImageWithUpload,
},
})
class InfoInfoImagePage extends Vue {
get imagePath(): string | null {
return useAdminStore().currentBooth.booth!.infoImage?.path ?? null;
}
async imageUploadCallback(file: File | Blob | null) {
return await useAdminAPIStore().uploadBoothInfoImage(file!);
}
async imageDeleteCallback() {
return await useAdminAPIStore().deleteBoothInfoImage();
}
}
export default toNative(InfoInfoImagePage);
</script>
19 changes: 19 additions & 0 deletions projects/Admin/src/pages/subpages/info/InfoInfoPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<template>
<VContainer>
<BoothInfoPanel />
</VContainer>
</template>

<script lang="ts">
import { Component, toNative, Vue } from "vue-facing-decorator";
import BoothInfoPanel from "@/components/info/BoothInfoPanel.vue";
@Component({
components: {
BoothInfoPanel,
},
})
class InfoInfoPage extends Vue { }
export default toNative(InfoInfoPage);
</script>
19 changes: 19 additions & 0 deletions projects/Admin/src/pages/subpages/info/InfoMemberPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<template>
<VContainer>
<BoothMembersPanel />
</VContainer>
</template>

<script lang="ts">
import { Component, toNative, Vue } from "vue-facing-decorator";
import BoothMembersPanel from "@/components/info/BoothMembersPanel.vue";
@Component({
components: {
BoothMembersPanel,
},
})
class InfoMemberPage extends Vue { }
export default toNative(InfoMemberPage);
</script>
19 changes: 19 additions & 0 deletions projects/Admin/src/pages/subpages/info/InfoNoticePage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<template>
<VContainer>
<BoothNoticePanel />
</VContainer>
</template>

<script lang="ts">
import { Component, toNative, Vue } from "vue-facing-decorator";
import BoothNoticePanel from "@/components/info/BoothNoticePanel.vue";
@Component({
components: {
BoothNoticePanel,
},
})
class InfoNoticePage extends Vue { }
export default toNative(InfoNoticePage);
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
</template>

<script lang="ts">
import { Component, Vue } from "vue-facing-decorator";
import { Component, toNative, Vue } from "vue-facing-decorator";
import GoodsOrdersListPage from "./GoodsOrderListPage.vue";
@Component({})
export default class GoodsOrdersRootPage extends Vue {
class GoodsOrdersRootPage extends Vue {
get keepAliveIncludeNames() {
return [ GoodsOrdersListPage.name ];
}
}
export default toNative(GoodsOrdersRootPage);
</script>
41 changes: 39 additions & 2 deletions projects/Admin/src/plugins/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const AdminRoot = () => import(/* webpackChunkName: "pages/admin-booth" */ "
const AdminLayout = () => import(/* webpackChunkName: "pages/admin-booth" */ "@/pages/AdminLayout.vue");
const GoodsPage = () => import(/* webpackChunkName: "pages/admin-booth" */ "@/pages/subpages/GoodsPage.vue");
const POSPage = () => import(/* webpackChunkName: "pages/admin-booth" */ "@/pages/subpages/POSPage.vue");
const InfoPage = () => import(/* webpackChunkName: "pages/admin-booth" */ "@/pages/subpages/InfoPage.vue");
const DashboardPage = () => import(/* webpackChunkName: "pages/admin-booth" */ "@/pages/subpages/DashboardPage.vue");
const AnalyticsPage = () => import(/* webpackChunkName: "pages/admin-booth" */ "@/pages/subpages/AnalyticsPage.vue");
const ClosingPage = () => import(/* webpackChunkName: "pages/admin-booth" */ "@/pages/subpages/ClosingPage.vue");
Expand All @@ -23,6 +22,13 @@ const GoodsOrdersRootPage = () => import(/* webpackChunkName: "pages/admin-good
const GoodsOrdersListPage = () => import(/* webpackChunkName: "pages/admin-goods-order" */ "@/pages/subpages/orders/GoodsOrderListPage.vue");
const GoodsOrderDetailPage = () => import(/* webpackChunkName: "pages/admin-goods-order" */ "@/pages/subpages/orders/GoodsOrderDetailPage.vue");

const LegacyInfoPage = () => import(/* webpackChunkName: "pages/admin-info" */ "@/pages/subpages/InfoPage.vue");
const InfoBannerImagePage = () => import(/* webpackChunkName: "pages/admin-info" */ "@/pages/subpages/info/InfoBannerImagePage.vue");
const InfoInfoImagePage = () => import(/* webpackChunkName: "pages/admin-info" */ "@/pages/subpages/info/InfoInfoImagePage.vue");
const InfoInfoPage = () => import(/* webpackChunkName: "pages/admin-info" */ "@/pages/subpages/info/InfoInfoPage.vue");
const InfoMemberPage = () => import(/* webpackChunkName: "pages/admin-info" */ "@/pages/subpages/info/InfoMemberPage.vue");
const InfoNoticePage = () => import(/* webpackChunkName: "pages/admin-info" */ "@/pages/subpages/info/InfoNoticePage.vue");

const HelpPage = () => import(/* webpackChunkName: "pages/support" */ "@/pages/support/help/HelpRootPage.vue");
/* === */

Expand Down Expand Up @@ -82,7 +88,38 @@ const router = createRouter({
{
path: "info",
name: "admin-info",
component: InfoPage,
component: LegacyInfoPage,
},
{
path: "info",
name: "admin-info-root",
children: [
{
path: "bannerimage",
name: "admin-info-banner-image",
component: InfoBannerImagePage,
},
{
path: "infoimage",
name: "admin-info-info-image",
component: InfoInfoImagePage,
},
{
path: "info",
name: "admin-info-info",
component: InfoInfoPage,
},
{
path: "member",
name: "admin-info-member",
component: InfoMemberPage,
},
{
path: "notice",
name: "admin-info-notice",
component: InfoNoticePage,
},
],
},
{
path: "goods",
Expand Down

0 comments on commit e9451e3

Please sign in to comment.