Compare commits
2 Commits
7151e7d311
...
043f97743c
| Author | SHA1 | Date | |
|---|---|---|---|
| 043f97743c | |||
| dffbe39fa6 |
@@ -1,78 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
import { getInputValue } from "@/utils/parseSQL";
|
|
||||||
const props = defineProps<{
|
|
||||||
layout?: any,
|
|
||||||
label?:any
|
|
||||||
}>()
|
|
||||||
|
|
||||||
const CLASS_FOR_LAYOUT = computed(() => {
|
|
||||||
let _classForLayout = {};
|
|
||||||
switch (props.layout) {
|
|
||||||
case 'Full_Page':
|
|
||||||
_classForLayout = {
|
|
||||||
page_container: 'page_container full-size-page',
|
|
||||||
layout_container: 'layout_container full-size-layout',
|
|
||||||
};
|
|
||||||
break;
|
|
||||||
case 'Center_Page':
|
|
||||||
_classForLayout = {
|
|
||||||
page_container: 'page_container full-size-page',
|
|
||||||
layout_container: 'layout_container center-layout',
|
|
||||||
};
|
|
||||||
break;
|
|
||||||
case 'Background_Page':
|
|
||||||
_classForLayout = {
|
|
||||||
page_container: 'page_container full-size-page background-container',
|
|
||||||
layout_container: 'layout_container center-layout',
|
|
||||||
};
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
_classForLayout = {
|
|
||||||
page_container: 'page_container',
|
|
||||||
layout_container: 'layout_container',
|
|
||||||
};
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return _classForLayout;
|
|
||||||
})
|
|
||||||
|
|
||||||
const LAYOUT_PARSE = computed(() => {
|
|
||||||
return props?.label ? getInputValue(props.label, "OBJECT") : {};
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div :class="[CLASS_FOR_LAYOUT.page_container]" :style="LAYOUT_PARSE['div.page_container']">
|
|
||||||
<div :class="[CLASS_FOR_LAYOUT.layout_container]" class="grid-container">
|
|
||||||
<slot />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.page_container {
|
|
||||||
// padding: 20px 0;
|
|
||||||
&.full-size-page {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
// .full-size-layout {
|
|
||||||
// padding-left: 20px;
|
|
||||||
// padding-right: 20px;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
.layout_container {
|
|
||||||
padding-top: 20px;
|
|
||||||
|
|
||||||
&.center-layout {
|
|
||||||
max-width: 1440px;
|
|
||||||
padding: 0 27.5px;
|
|
||||||
margin: auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.grid-container {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { getInputValue } from "@/utils/parseSQL";
|
||||||
|
import { enumPageLayouts, enumPageTemplate, enumPageKey } from "@/definitions/enum";
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
layout?: any,
|
||||||
|
label?:any
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const CLASS_FOR_LAYOUT = computed(() => {
|
||||||
|
let _classForLayout = {};
|
||||||
|
switch (props.layout) {
|
||||||
|
case enumPageLayouts[enumPageTemplate[enumPageKey.HOME]['DEFAULT']]['DEFAULT']:
|
||||||
|
_classForLayout = {
|
||||||
|
page_container: "page_container full-size-page",
|
||||||
|
layout_container: "layout_container center-layout",
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
case enumPageLayouts[enumPageTemplate[enumPageKey.HOME]['DEFAULT']]['FULL']:
|
||||||
|
_classForLayout = {
|
||||||
|
page_container: "page_container full-size-page",
|
||||||
|
layout_container: "layout_container full-size-layout",
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
case enumPageLayouts[enumPageTemplate[enumPageKey.HOME]['DEFAULT']]['BACKGROUND_PAGE']:
|
||||||
|
_classForLayout = {
|
||||||
|
page_container: "page_container full-size-page background-container",
|
||||||
|
layout_container: "layout_container center-layout",
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
_classForLayout = {
|
||||||
|
page_container: "page_container",
|
||||||
|
layout_container: "layout_container",
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return _classForLayout;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div :class="[CLASS_FOR_LAYOUT.page_container]">
|
||||||
|
<div :class="[CLASS_FOR_LAYOUT.layout_container]" class="grid-container">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.page_container {
|
||||||
|
// padding: 20px 0;
|
||||||
|
&.full-size-page {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
// .full-size-layout {
|
||||||
|
// padding-left: 20px;
|
||||||
|
// padding-right: 20px;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
.layout_container {
|
||||||
|
padding-top: 20px;
|
||||||
|
|
||||||
|
&.center-layout {
|
||||||
|
max-width: 1440px;
|
||||||
|
padding: 0 27.5px;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-container {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(1, minmax(0, 1fr));
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
export { default as BASE_LAYOUT } from './Default.vue'
|
export { default as Home_Default } from './homes/Default.vue'
|
||||||
|
|
||||||
// Article
|
// Article
|
||||||
export { default as ARTICLE_LONG_LAYOUT } from './articles/Long.vue'
|
export { default as ARTICLE_LONG_LAYOUT } from './articles/Long.vue'
|
||||||
|
|||||||
@@ -1,33 +1,24 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { layouts } from "@/definitions/enum";
|
import { enumPageKey, enumPageTemplate, enumPageLayouts } from "@/definitions/enum";
|
||||||
|
import { Home_Default, ARTICLE_LONG_LAYOUT, ARTICLE_NONE_LAYOUT, ARTICLE_NORMAL_LAYOUT, ARTICLE_PAGE_LAYOUT, ARTICLE_SHORT_LAYOUT } from "./index";
|
||||||
import {
|
|
||||||
BASE_LAYOUT,
|
|
||||||
ARTICLE_SHORT_LAYOUT,
|
|
||||||
ARTICLE_PAGE_LAYOUT,
|
|
||||||
ARTICLE_NORMAL_LAYOUT,
|
|
||||||
ARTICLE_NONE_LAYOUT,
|
|
||||||
ARTICLE_LONG_LAYOUT,
|
|
||||||
} from './index';
|
|
||||||
|
|
||||||
const _props = defineProps<{
|
const _props = defineProps<{
|
||||||
settings?: any,
|
settings?: any;
|
||||||
}>()
|
}>();
|
||||||
|
|
||||||
const definedDynamicPageLayout: Record<string, any> = {
|
const definedDynamicPageLayout: Record<string, any> = {
|
||||||
'Default': BASE_LAYOUT,
|
[enumPageLayouts[enumPageTemplate[enumPageKey.HOME]["DEFAULT"]]["DEFAULT"]]: Home_Default,
|
||||||
[layouts.FULL_PAGE]: BASE_LAYOUT,
|
[enumPageLayouts[enumPageTemplate[enumPageKey.HOME]["DEFAULT"]]["FULL"]]: Home_Default,
|
||||||
[layouts.CENTER_PAGE]: BASE_LAYOUT,
|
[enumPageLayouts[enumPageTemplate[enumPageKey.HOME]["DEFAULT"]]["BACKGROUND_PAGE"]]: Home_Default,
|
||||||
[layouts.BACKGROUND_PAGE]: BASE_LAYOUT,
|
|
||||||
|
|
||||||
'ARTICLE_SHORT': ARTICLE_SHORT_LAYOUT,
|
[enumPageLayouts[enumPageTemplate[enumPageKey.ARTICLE]["DETAIL"]]["ARTICLE_SHORT"]]: ARTICLE_SHORT_LAYOUT,
|
||||||
'ARTICLE_PAGE': ARTICLE_PAGE_LAYOUT,
|
[enumPageLayouts[enumPageTemplate[enumPageKey.ARTICLE]["DETAIL"]]["ARTICLE_PAGE"]]: ARTICLE_PAGE_LAYOUT,
|
||||||
'ARTICLE_NORMAL': ARTICLE_NORMAL_LAYOUT,
|
[enumPageLayouts[enumPageTemplate[enumPageKey.ARTICLE]["DETAIL"]]["ARTICLE_NORMAL"]]: ARTICLE_NORMAL_LAYOUT,
|
||||||
'ARTICLE_NONE': ARTICLE_NONE_LAYOUT,
|
[enumPageLayouts[enumPageTemplate[enumPageKey.ARTICLE]["DETAIL"]]["ARTICLE_NONE"]]: ARTICLE_NONE_LAYOUT,
|
||||||
'ARTICLE_LONG': ARTICLE_LONG_LAYOUT,
|
[enumPageLayouts[enumPageTemplate[enumPageKey.ARTICLE]["DETAIL"]]["ARTICLE_LONG"]]: ARTICLE_LONG_LAYOUT,
|
||||||
}
|
};
|
||||||
|
|
||||||
const getCurrentLayout = computed(() => _props.settings.layout);
|
const getCurrentLayout = computed(() => _props.settings?.layout);
|
||||||
|
|
||||||
const GET_PROPS = computed(() => {
|
const GET_PROPS = computed(() => {
|
||||||
return () => {
|
return () => {
|
||||||
@@ -35,12 +26,12 @@ const GET_PROPS = computed(() => {
|
|||||||
for (const [key, value] of Object.entries(_props.settings)) {
|
for (const [key, value] of Object.entries(_props.settings)) {
|
||||||
props = {
|
props = {
|
||||||
...props,
|
...props,
|
||||||
[key]: value
|
[key]: value,
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
return props;
|
return props;
|
||||||
};
|
};
|
||||||
})
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ const props = defineProps<{
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="h-100 overflow-y-auto">
|
<div class="h-full overflow-y-auto">
|
||||||
<HeaderHomeTemplate />
|
<HeaderHomeTemplate />
|
||||||
<DynamicLayout :settings="props.settings">
|
<DynamicLayout :settings="props.settings">
|
||||||
<slot />
|
<slot />
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default as DetailDefault } from './DetailDefault.vue';
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import { DetailDefault } from './index';
|
||||||
|
import { enumPageKey, enumPageTemplate } from "@/definitions/enum";
|
||||||
|
|
||||||
|
const _props = defineProps<{
|
||||||
|
settings: any
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const definedDynamicPage: Record<string, any> = {
|
||||||
|
[enumPageTemplate[enumPageKey.ARTICLE]['DETAIL']]: DetailDefault,
|
||||||
|
}
|
||||||
|
|
||||||
|
const getCurrentTemplate = computed(() => {
|
||||||
|
return _props.settings?.template || '';
|
||||||
|
});
|
||||||
|
|
||||||
|
const GET_PROPS = computed(() => {
|
||||||
|
return () => {
|
||||||
|
let props : any = {};
|
||||||
|
if (_props.settings) {
|
||||||
|
for (const [key, value] of Object.entries(_props.settings)) {
|
||||||
|
props = {
|
||||||
|
...props,
|
||||||
|
[key]: value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return props;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<component v-if="definedDynamicPage[getCurrentTemplate]" :is="definedDynamicPage[getCurrentTemplate]" v-bind="{...(GET_PROPS()), settings: _props.settings}">
|
||||||
|
<slot />
|
||||||
|
</component>
|
||||||
|
</template>
|
||||||
+6
-9
@@ -2,22 +2,19 @@
|
|||||||
import DynamicLayout from "~/components/dynamic-page/page/layouts/index.vue";
|
import DynamicLayout from "~/components/dynamic-page/page/layouts/index.vue";
|
||||||
import HeaderHomeTemplate from "~/components/dynamic-page/page/templates/components/headers/HeaderHomeTemplate.vue";
|
import HeaderHomeTemplate from "~/components/dynamic-page/page/templates/components/headers/HeaderHomeTemplate.vue";
|
||||||
import FooterHomeTemplate from "~/components/dynamic-page/page/templates/components/footers/FooterHomeTemplate.vue";
|
import FooterHomeTemplate from "~/components/dynamic-page/page/templates/components/footers/FooterHomeTemplate.vue";
|
||||||
const props = defineProps<{
|
|
||||||
settings?: any;
|
|
||||||
}>();
|
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
settings?: any
|
||||||
|
}>()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="h-full overflow-y-auto">
|
||||||
<HeaderHomeTemplate>
|
<HeaderHomeTemplate />
|
||||||
<DynamicLayout :settings="props.settings">
|
|
||||||
<slot />
|
|
||||||
</DynamicLayout>
|
|
||||||
</HeaderHomeTemplate>
|
|
||||||
<DynamicLayout :settings="props.settings">
|
<DynamicLayout :settings="props.settings">
|
||||||
<slot />
|
<slot />
|
||||||
</DynamicLayout>
|
</DynamicLayout>
|
||||||
<FooterHomeTemplate />
|
<FooterHomeTemplate />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default as Home } from './Home.vue';
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import { Home } from './index';
|
||||||
|
import { enumPageKey, enumPageTemplate } from "@/definitions/enum";
|
||||||
|
|
||||||
|
const _props = defineProps<{
|
||||||
|
settings: any
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const definedDynamicPage: Record<string, any> = {
|
||||||
|
[enumPageTemplate[enumPageKey.HOME]['DEFAULT']]: Home,
|
||||||
|
}
|
||||||
|
|
||||||
|
const getCurrentTemplate = computed(() => {
|
||||||
|
return _props.settings?.template || '';
|
||||||
|
});
|
||||||
|
|
||||||
|
const GET_PROPS = computed(() => {
|
||||||
|
return () => {
|
||||||
|
let props : any = {};
|
||||||
|
if (_props.settings) {
|
||||||
|
for (const [key, value] of Object.entries(_props.settings)) {
|
||||||
|
props = {
|
||||||
|
...props,
|
||||||
|
[key]: value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return props;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<component v-if="definedDynamicPage[getCurrentTemplate]" :is="definedDynamicPage[getCurrentTemplate]" v-bind="{...(GET_PROPS()), settings: _props.settings}">
|
||||||
|
<slot />
|
||||||
|
</component>
|
||||||
|
</template>
|
||||||
@@ -1 +1,2 @@
|
|||||||
export { default as HomeBasic } from './homes/Basic.vue'
|
export { default as Home } from './homes/index.vue'
|
||||||
|
export { default as Article } from './articles/index.vue'
|
||||||
@@ -1,34 +1,36 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { HomeBasic } from './index';
|
import { Home, Article } from "./index";
|
||||||
|
import type { Page } from "@/models/cms";
|
||||||
|
import { enumPageKey } from "@/definitions/enum";
|
||||||
|
|
||||||
const _props = defineProps<{
|
const _props = defineProps<{
|
||||||
settings: any
|
settings: any;
|
||||||
}>()
|
page: Page;
|
||||||
|
}>();
|
||||||
|
|
||||||
const definedDynamicPage: Record<string, any> = {
|
const definedDynamicPage: Record<string, any> = {
|
||||||
'Home' : HomeBasic,
|
[enumPageKey.HOME]: Home,
|
||||||
'Article': HomeBasic
|
[enumPageKey.ARTICLE]: Article,
|
||||||
}
|
};
|
||||||
|
|
||||||
const getCurrentTemplate = computed(() => {
|
const getCurrentTemplate = computed(() => {
|
||||||
return _props.settings && _props.settings.template || '';
|
return _props.page?.taxonomy || "";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
const GET_PROPS = computed(() => {
|
const GET_PROPS = computed(() => {
|
||||||
return () => {
|
return () => {
|
||||||
let props: any = {};
|
let props: any = {};
|
||||||
if (_props.settings) {
|
if (_props.settings) {
|
||||||
for (const [key, value] of _props.settings ? Object.entries(_props.settings) : []) {
|
for (const [key, value] of Object.entries(_props.settings)) {
|
||||||
props = {
|
props = {
|
||||||
...props,
|
...props,
|
||||||
[key]: value
|
[key]: value,
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return props;
|
return props;
|
||||||
};
|
};
|
||||||
})
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -35,11 +35,13 @@ export {
|
|||||||
pageTypes,
|
pageTypes,
|
||||||
pageComponentTypes,
|
pageComponentTypes,
|
||||||
pageSectionTypes,
|
pageSectionTypes,
|
||||||
pageTaxonomy,
|
|
||||||
pageDataQuery,
|
pageDataQuery,
|
||||||
pageDataType,
|
pageDataType,
|
||||||
pageLayouts,
|
|
||||||
|
/* PAGE SETTINGS */
|
||||||
|
pageTaxonomy,
|
||||||
pageTemplates,
|
pageTemplates,
|
||||||
|
pageLayouts,
|
||||||
|
|
||||||
/* SECTION SETTINGS */
|
/* SECTION SETTINGS */
|
||||||
pageSectionTaxonomy,
|
pageSectionTaxonomy,
|
||||||
@@ -50,6 +52,7 @@ export {
|
|||||||
pageComponentTaxonomy,
|
pageComponentTaxonomy,
|
||||||
pageComponentTemplates,
|
pageComponentTemplates,
|
||||||
pageComponentLayouts,
|
pageComponentLayouts,
|
||||||
|
|
||||||
} from "./page.type";
|
} from "./page.type";
|
||||||
export { placementType } from "./placement.type";
|
export { placementType } from "./placement.type";
|
||||||
export { pollType, pollParticipantType, pollOptionType, pollResultPublication } from "./poll.type";
|
export { pollType, pollParticipantType, pollOptionType, pollResultPublication } from "./poll.type";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { enumPageComponentLayouts, enumPageSectionLayouts, templates, enumPageComponentKey, enumPageComponentTemplate, enumPageSectionKey, enumPageSectionTemplate } from "@/definitions/enum";
|
import { enumPageKey, enumPageTemplate, enumPageLayouts, enumPageComponentLayouts, enumPageSectionLayouts, enumPageComponentKey, enumPageComponentTemplate, enumPageSectionKey, enumPageSectionTemplate } from "@/definitions/enum";
|
||||||
|
|
||||||
export const pageTypes = [
|
export const pageTypes = [
|
||||||
{ title: "None", value: 0 }, // Không xác định
|
{ title: "None", value: 0 }, // Không xác định
|
||||||
@@ -24,49 +24,6 @@ export const pageTypes = [
|
|||||||
];
|
];
|
||||||
// LayoutType: None=0 | Normal=1 | Short=2 | Long=3 | Page=4
|
// LayoutType: None=0 | Normal=1 | Short=2 | Long=3 | Page=4
|
||||||
|
|
||||||
export const pageLayouts = (key: string) => {
|
|
||||||
if (key === templates.ARTICLE) {
|
|
||||||
return [
|
|
||||||
{ title: "None", key: 0, value: "ARTICLE_NONE" },
|
|
||||||
{ title: "Normal", key: 1, value: "ARTICLE_NORMAL" },
|
|
||||||
{ title: "Short", key: 2, value: "ARTICLE_SHORT" },
|
|
||||||
{ title: "Long", key: 3, value: "ARTICLE_LONG" },
|
|
||||||
{ title: "Page", key: 4, value: "ARTICLE_PAGE" },
|
|
||||||
];
|
|
||||||
} else {
|
|
||||||
return [
|
|
||||||
{ title: "None", value: 0 },
|
|
||||||
{ title: "Cơ bản", value: "Default" },
|
|
||||||
{ title: "Full Page", value: "Full_Page" }, // full with 100%
|
|
||||||
{ title: "Center Page", value: "Center_Page" }, // ở giữa
|
|
||||||
{ title: "Backgroud Page", value: "Backgroud_Page" }, // Phân trang
|
|
||||||
];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const pageTemplates = [
|
|
||||||
{ title: "None", value: "None" }, // Không xác định
|
|
||||||
{ title: "Home", value: "Home" }, // Trang chủ
|
|
||||||
{ title: "Section", value: "Section" }, // Chuyên trang
|
|
||||||
{ title: "Category", value: "Category" }, // Trang danh mục
|
|
||||||
{ title: "Topic", value: "Topic" }, // Trang chủ đề
|
|
||||||
{ title: "Event", value: "Event" }, // Trang sự kiện
|
|
||||||
{ title: "Collection", value: "Collection" }, // Trang sưu tập
|
|
||||||
{ title: "Article", value: "Article" }, // Trang bài viết
|
|
||||||
{ title: "Tag", value: "Tag" }, // Trang từ khóa
|
|
||||||
{ title: "Author", value: "Author" }, // Trang tác giả
|
|
||||||
{ title: "Search", value: "Search" }, // Trang tìm kiếm
|
|
||||||
{ title: "Contact", value: "Contact" }, // Trang liên hệ
|
|
||||||
{ title: "About", value: "About" }, // Trang giới thiệu
|
|
||||||
{ title: "Service", value: "Service" }, // Trang dịch vụ
|
|
||||||
{ title: "Policy", value: "Policy" }, // Trang chính sách
|
|
||||||
{ title: "Terms", value: "Terms" }, // Trang điều khoản
|
|
||||||
{ title: "Privacy", value: "Privacy" }, // Trang bảo mật
|
|
||||||
{ title: "Error", value: "Error" }, // Trang lỗi
|
|
||||||
{ title: "Maintenance", value: "Maintenance" }, // Trang bảo trì
|
|
||||||
{ title: "Custom", value: "Custom" }, // Trang tùy chỉnh
|
|
||||||
];
|
|
||||||
|
|
||||||
export const pageComponentTypes = [
|
export const pageComponentTypes = [
|
||||||
{ title: "None", value: 0 }, // Không xác định
|
{ title: "None", value: 0 }, // Không xác định
|
||||||
{ title: "Individual", value: 1 }, // Đơn lẻ
|
{ title: "Individual", value: 1 }, // Đơn lẻ
|
||||||
@@ -103,6 +60,7 @@ export const pageDataQuery = [
|
|||||||
{ title: "REQUEST", value: "REQUEST" },
|
{ title: "REQUEST", value: "REQUEST" },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/* PAGE SETTINGS */
|
||||||
export const pageTaxonomy = [
|
export const pageTaxonomy = [
|
||||||
{ title: "Home", value: "Home" }, // Trang khác
|
{ title: "Home", value: "Home" }, // Trang khác
|
||||||
{ title: "Section", value: "Section" }, // Chuyên trang
|
{ title: "Section", value: "Section" }, // Chuyên trang
|
||||||
@@ -121,6 +79,31 @@ export const pageTaxonomy = [
|
|||||||
{ title: "Navigation", value: "Navigation" }, // Navigation
|
{ title: "Navigation", value: "Navigation" }, // Navigation
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const pageTemplates = {
|
||||||
|
[enumPageKey.HOME]: [
|
||||||
|
{ title: "Trang chủ - Báo Tiền Phong", value: enumPageTemplate[enumPageKey.HOME]['DEFAULT'] },
|
||||||
|
{ title: "Trang chủ - Báo Kinh tế đô thị", value: enumPageTemplate[enumPageKey.HOME]['DEFAULT'] },
|
||||||
|
],
|
||||||
|
[enumPageKey.ARTICLE]: [
|
||||||
|
{ title: "Chi tiết bài viết", value: enumPageTemplate[enumPageKey.ARTICLE]['DETAIL'] },
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export const pageLayouts = {
|
||||||
|
[enumPageTemplate[enumPageKey.HOME]['DEFAULT']]: [
|
||||||
|
{ title: "Giới hạn chiều rộng", value: enumPageLayouts[enumPageTemplate[enumPageKey.HOME]['DEFAULT']]['DEFAULT'] },
|
||||||
|
{ title: "Không giới hạn chiều rộng", value: enumPageLayouts[enumPageTemplate[enumPageKey.HOME]['DEFAULT']]['FULL'] },
|
||||||
|
{ title: "Giới hạn chiều rộng có Quảng cáo", value: enumPageLayouts[enumPageTemplate[enumPageKey.HOME]['DEFAULT']]['BACKGROUND_PAGE'] },
|
||||||
|
],
|
||||||
|
[enumPageTemplate[enumPageKey.ARTICLE]['DETAIL']]: [
|
||||||
|
{ title: "Không có", value: enumPageLayouts[enumPageTemplate[enumPageKey.ARTICLE]['DETAIL']]['ARTICLE_NONE'] },
|
||||||
|
{ title: "Bài viết thường", value: enumPageLayouts[enumPageTemplate[enumPageKey.ARTICLE]['DETAIL']]['ARTICLE_NORMAL'] },
|
||||||
|
{ title: "Bài viết ngắn", value: enumPageLayouts[enumPageTemplate[enumPageKey.ARTICLE]['DETAIL']]['ARTICLE_SHORT'] },
|
||||||
|
{ title: "Bài viết dài", value: enumPageLayouts[enumPageTemplate[enumPageKey.ARTICLE]['DETAIL']]['ARTICLE_LONG'] },
|
||||||
|
{ title: "Bài viết toàn trang", value: enumPageLayouts[enumPageTemplate[enumPageKey.ARTICLE]['DETAIL']]['ARTICLE_PAGE'] },
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
/* SECTION SETTINGS */
|
/* SECTION SETTINGS */
|
||||||
export const pageSectionTaxonomy = [
|
export const pageSectionTaxonomy = [
|
||||||
{ title: "None", value: "None" }, // Phân vùng của Chuyên trang
|
{ title: "None", value: "None" }, // Phân vùng của Chuyên trang
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
export { PublishTypes as publishTypes, sharingTypes } from "./publishTypes.enum";
|
export { PublishTypes as publishTypes, sharingTypes } from "./publishTypes.enum";
|
||||||
export { categoryTypes } from "./categoryTypes.enum";
|
export { categoryTypes } from "./categoryTypes.enum";
|
||||||
export {
|
export {
|
||||||
templates, layouts, dataTypes, dataQuery, sectionTypes, sectionTaxonomy, enumPageType, enumPageSectionLayouts, enumPageComponentLayouts, enumPageComponentTemplates, enumPageComponentStaticChild,
|
dataTypes, dataQuery, sectionTypes, sectionTaxonomy, enumPageType, enumPageSectionLayouts, enumPageComponentLayouts, enumPageComponentTemplates, enumPageComponentStaticChild,
|
||||||
dataTypeSort, dataTypeKeyInSort, dataTypeKeyInWith, dataSelectQuery, dataTypeTTL, dataMethodRequest, dataDesignLayout, dataBorderDesign, dataHideDesign, dataFontWeightDesign, dataPaddingDesign,
|
dataTypeSort, dataTypeKeyInSort, dataTypeKeyInWith, dataSelectQuery, dataTypeTTL, dataMethodRequest, dataDesignLayout, dataBorderDesign, dataHideDesign, dataFontWeightDesign, dataPaddingDesign,
|
||||||
enumPageComponentKey, enumPageComponentTemplate, dataStaticType, enumPageSectionKey, enumPageSectionTemplate, enumPageComponentDefaultSetting
|
enumPageComponentKey, enumPageComponentTemplate, dataStaticType, enumPageSectionKey, enumPageSectionTemplate, enumPageComponentDefaultSetting, enumPageComponentDefaultStyle,
|
||||||
|
enumPageKey, enumPageTemplate, enumPageLayouts
|
||||||
} from "./page.enum";
|
} from "./page.enum";
|
||||||
export { enumStatus } from "./status.enum";
|
export { enumStatus } from "./status.enum";
|
||||||
export { actionCommands } from "./actionCommands.enum";
|
export { actionCommands } from "./actionCommands.enum";
|
||||||
|
|||||||
@@ -1,33 +1,3 @@
|
|||||||
export const templates = {
|
|
||||||
NONE: "None", // Không xác định
|
|
||||||
HOME: "Home", // Trang chủ
|
|
||||||
SECTION: "Section", // Chuyên trang
|
|
||||||
CATEGORY: "Category", // Trang danh mục
|
|
||||||
TOPIC: "Topic", // Trang chủ đề
|
|
||||||
EVENT: "Event", // Trang sự kiện
|
|
||||||
COLLECTION: "Collection", // Trang sưu tập
|
|
||||||
ARTICLE: "Article", // Trang bài viết
|
|
||||||
TAG: "Tag", // Trang từ khóa
|
|
||||||
AUTHOR: "Author", // Trang tác giả
|
|
||||||
SEARCH: "Search", // Trang tìm kiếm
|
|
||||||
CONTACT: "Contact", // Trang liên hệ
|
|
||||||
ABOUT: "About", // Trang giới thiệu
|
|
||||||
SERVICE: "Service", // Trang dịch vụ
|
|
||||||
POLICY: "Policy", // Trang chính sách
|
|
||||||
TERMS: "Terms", // Trang điều khoản
|
|
||||||
PRIVACY: "Privacy", // Trang bảo mật
|
|
||||||
ERROR: "Error", // Trang lỗi
|
|
||||||
MAINTENANCE: "Maintenance", // Trang bảo trì
|
|
||||||
CUSTOM: "Custom", // Trang tùy chỉnh
|
|
||||||
};
|
|
||||||
|
|
||||||
export const layouts = {
|
|
||||||
NONE: "None", // Không xác định
|
|
||||||
FULL_PAGE: "Full_Page", // full width 100%
|
|
||||||
CENTER_PAGE: "Center_Page", // ở giữa
|
|
||||||
BACKGROUND_PAGE: "Background_Page", // Phân trang
|
|
||||||
};
|
|
||||||
|
|
||||||
export const dataTypes = {
|
export const dataTypes = {
|
||||||
SECTION: "Section",
|
SECTION: "Section",
|
||||||
CATEGORY: "Category",
|
CATEGORY: "Category",
|
||||||
@@ -86,25 +56,6 @@ export const enumPageType = {
|
|||||||
CUSTOM: 99, // Trang tùy chỉnh
|
CUSTOM: 99, // Trang tùy chỉnh
|
||||||
};
|
};
|
||||||
|
|
||||||
export const enumPageComponentTemplates = { // KHÔNG ĐƯỢC XÓA KEY - BIẾN này
|
|
||||||
NONE: "None", // Không xác định
|
|
||||||
SECTION: "Section", // Chuyên trang
|
|
||||||
CATEGORY: "Category", // Trang danh mục
|
|
||||||
TOPIC: "Topic", // Trang chủ đề
|
|
||||||
EVENT: "Event", // Trang sự kiện
|
|
||||||
COLLECTION: "Collection", // Trang sưu tập
|
|
||||||
ARTICLE: "Article", // Trang bài viết
|
|
||||||
TAG: "Tag", // Trang từ khóa
|
|
||||||
AUTHOR: "Author", // Trang tác giả
|
|
||||||
POLL: "Poll", // Trang poll
|
|
||||||
QUIZ: "Quiz", // Trang quiz
|
|
||||||
SURVEY: "Survey", // Trang survey
|
|
||||||
ADVERTISING: "Advertising", // Trang quảng cáo
|
|
||||||
OTHER: "Other", // Trang khác
|
|
||||||
NAVIGATION: "Navigation", // Navigation
|
|
||||||
LOCATION: 'Location', // Location
|
|
||||||
FIGURE: 'Figure', // Figure
|
|
||||||
};
|
|
||||||
export const dataTypeKeyInSort = [
|
export const dataTypeKeyInSort = [
|
||||||
{ title: "Thời gian tạo", value: "CreatedOn" },
|
{ title: "Thời gian tạo", value: "CreatedOn" },
|
||||||
{ title: "Lượt xem", value: "Views" },
|
{ title: "Lượt xem", value: "Views" },
|
||||||
@@ -203,6 +154,56 @@ export const enumPageComponentStaticChild = {
|
|||||||
DEFAULT: "Default", // Chuyên trang
|
DEFAULT: "Default", // Chuyên trang
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* PAGE SETTINGS */
|
||||||
|
// KHÔNG ĐƯỢC XÓA KEY - BIẾN này
|
||||||
|
export const enumPageKey = {
|
||||||
|
NONE: "None", // Không xác định
|
||||||
|
HOME: "Home", // Trang chủ
|
||||||
|
SECTION: "Section", // Chuyên trang
|
||||||
|
CATEGORY: "Category", // Trang danh mục
|
||||||
|
TOPIC: "Topic", // Trang chủ đề
|
||||||
|
EVENT: "Event", // Trang sự kiện
|
||||||
|
COLLECTION: "Collection", // Trang sưu tập
|
||||||
|
ARTICLE: "Article", // Trang bài viết
|
||||||
|
TAG: "Tag", // Trang từ khóa
|
||||||
|
AUTHOR: "Author", // Trang tác giả
|
||||||
|
SEARCH: "Search", // Trang tìm kiếm
|
||||||
|
CONTACT: "Contact", // Trang liên hệ
|
||||||
|
ABOUT: "About", // Trang giới thiệu
|
||||||
|
SERVICE: "Service", // Trang dịch vụ
|
||||||
|
POLICY: "Policy", // Trang chính sách
|
||||||
|
TERMS: "Terms", // Trang điều khoản
|
||||||
|
PRIVACY: "Privacy", // Trang bảo mật
|
||||||
|
ERROR: "Error", // Trang lỗi
|
||||||
|
MAINTENANCE: "Maintenance", // Trang bảo trì
|
||||||
|
CUSTOM: "Custom", // Trang tùy chỉnh
|
||||||
|
};
|
||||||
|
|
||||||
|
export const enumPageTemplate = {
|
||||||
|
[enumPageKey.HOME]: {
|
||||||
|
'DEFAULT': "TYPE:Default",
|
||||||
|
},
|
||||||
|
[enumPageKey.ARTICLE]: {
|
||||||
|
'DETAIL': "TYPE:Article_Detail",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const enumPageLayouts = {
|
||||||
|
/* Home */
|
||||||
|
[`${enumPageTemplate[enumPageKey.HOME]['DEFAULT']}`]: {
|
||||||
|
'DEFAULT': 'TYPE:Center_Page',
|
||||||
|
'FULL': 'TYPE:Full_Page',
|
||||||
|
// 'CENTER_PAGE': 'TYPE:Center_Page',
|
||||||
|
'BACKGROUND_PAGE': 'TYPE:Background_Page'
|
||||||
|
},
|
||||||
|
[`${enumPageTemplate[enumPageKey.ARTICLE]['DETAIL']}`]: {
|
||||||
|
'ARTICLE_NONE': 'TYPE:ARTICLE_NONE',
|
||||||
|
'ARTICLE_NORMAL': 'TYPE:ARTICLE_NORMAL',
|
||||||
|
'ARTICLE_SHORT': 'TYPE:ARTICLE_SHORT',
|
||||||
|
'ARTICLE_LONG': 'TYPE:ARTICLE_LONG',
|
||||||
|
'ARTICLE_PAGE': 'TYPE:ARTICLE_PAGE',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
/* SECTION SETTINGS */
|
/* SECTION SETTINGS */
|
||||||
// KHÔNG ĐƯỢC XÓA KEY - BIẾN này
|
// KHÔNG ĐƯỢC XÓA KEY - BIẾN này
|
||||||
@@ -304,6 +305,26 @@ export const enumPageComponentKey = {
|
|||||||
FIGURE: 'Figure', // Figure
|
FIGURE: 'Figure', // Figure
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const enumPageComponentTemplates = { // KHÔNG ĐƯỢC XÓA KEY - BIẾN này
|
||||||
|
NONE: "None", // Không xác định
|
||||||
|
SECTION: "Section", // Chuyên trang
|
||||||
|
CATEGORY: "Category", // Trang danh mục
|
||||||
|
TOPIC: "Topic", // Trang chủ đề
|
||||||
|
EVENT: "Event", // Trang sự kiện
|
||||||
|
COLLECTION: "Collection", // Trang sưu tập
|
||||||
|
ARTICLE: "Article", // Trang bài viết
|
||||||
|
TAG: "Tag", // Trang từ khóa
|
||||||
|
AUTHOR: "Author", // Trang tác giả
|
||||||
|
POLL: "Poll", // Trang poll
|
||||||
|
QUIZ: "Quiz", // Trang quiz
|
||||||
|
SURVEY: "Survey", // Trang survey
|
||||||
|
ADVERTISING: "Advertising", // Trang quảng cáo
|
||||||
|
OTHER: "Other", // Trang khác
|
||||||
|
NAVIGATION: "Navigation", // Navigation
|
||||||
|
LOCATION: 'Location', // Location
|
||||||
|
FIGURE: 'Figure', // Figure
|
||||||
|
};
|
||||||
|
|
||||||
export const enumPageComponentTemplate = {
|
export const enumPageComponentTemplate = {
|
||||||
[enumPageComponentKey.ARTICLE]: {
|
[enumPageComponentKey.ARTICLE]: {
|
||||||
'ARTICLE_CARD': "TYPE:Card",
|
'ARTICLE_CARD': "TYPE:Card",
|
||||||
@@ -398,6 +419,7 @@ export const enumPageComponentLayouts = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const defaultArticle = {
|
const defaultArticle = {
|
||||||
WidthImg: 40,
|
WidthImg: 40,
|
||||||
layout: "column",
|
layout: "column",
|
||||||
@@ -485,7 +507,6 @@ export const enumPageComponentDefaultSetting = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const enumPageComponentDefaultStyle = {
|
export const enumPageComponentDefaultStyle = {
|
||||||
[enumPageComponentKey.ARTICLE]: {
|
[enumPageComponentKey.ARTICLE]: {
|
||||||
"TYPE:Card_Default": `#cpn_[] {}
|
"TYPE:Card_Default": `#cpn_[] {}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ useHead({
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<main class="h-screen" v-if="asycnCurrentPage">
|
<main class="h-screen" v-if="asycnCurrentPage">
|
||||||
<DynamicTemplate :settings="asycnCurrentPage.settings">
|
<DynamicTemplate :page="asycnCurrentPage" :settings="asycnCurrentPage.settings">
|
||||||
<DynamicSection
|
<DynamicSection
|
||||||
v-for="(section, index) in asycnSectionPublished"
|
v-for="(section, index) in asycnSectionPublished"
|
||||||
:key="index"
|
:key="index"
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ useSeoMeta({
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<main class="h-screen" v-if="asycnCurrentPage">
|
<main class="h-screen" v-if="asycnCurrentPage">
|
||||||
<DynamicTemplate :settings="asycnCurrentPage.settings">
|
<DynamicTemplate :page="asycnCurrentPage" :settings="asycnCurrentPage.settings">
|
||||||
<DynamicSection
|
<DynamicSection
|
||||||
v-for="(section, index) in asycnSectionPublished"
|
v-for="(section, index) in asycnSectionPublished"
|
||||||
:key="index"
|
:key="index"
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,7 @@ useHead({
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<main class="h-screen" v-if="asycnCurrentPage">
|
<main class="h-screen" v-if="asycnCurrentPage">
|
||||||
<DynamicTemplate :settings="asycnCurrentPage.settings">
|
<DynamicTemplate :page="asycnCurrentPage" :settings="asycnCurrentPage.settings">
|
||||||
<DynamicSection
|
<DynamicSection
|
||||||
class="mb-10"
|
class="mb-10"
|
||||||
v-for="(section, index) in asycnSectionPublished"
|
v-for="(section, index) in asycnSectionPublished"
|
||||||
|
|||||||
Reference in New Issue
Block a user