Compare commits
13 Commits
7151e7d311
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| b4aa3e45d1 | |||
| a63155a782 | |||
| 45f21ba187 | |||
| 795cd47e41 | |||
| 5f9525371d | |||
| 6f571d9549 | |||
| 174a596db9 | |||
| 5f72a107ce | |||
| 5a041acd54 | |||
| 9cc998e0bf | |||
| 7565a37d60 | |||
| 043f97743c | |||
| dffbe39fa6 |
@@ -208,6 +208,11 @@ div[layout="ARTICLE_PAGE"] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.emagazine {
|
||||||
|
h1,h2,h3,h4,h5,h6,span,em {
|
||||||
|
@apply w-full max-w-660px mx-auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
.detail-default {
|
.detail-default {
|
||||||
p {
|
p {
|
||||||
@apply text-18px font-raleway leading-180% my-10px;
|
@apply text-18px font-raleway leading-180% my-10px;
|
||||||
|
|||||||
@@ -15,14 +15,14 @@ const store = reactive({
|
|||||||
});
|
});
|
||||||
const { currentPoll } = storeToRefs(store.poll);
|
const { currentPoll } = storeToRefs(store.poll);
|
||||||
const { currentPollOptions } = storeToRefs(store.pollOptions);
|
const { currentPollOptions } = storeToRefs(store.pollOptions);
|
||||||
const { currentPollResponses } = storeToRefs(store.pollResponse);
|
// const { currentPollResponses } = storeToRefs(store.pollResponse);
|
||||||
const poll = reactive<Poll | any>({});
|
const poll = reactive<Poll | any>({});
|
||||||
const options = ref<PollOption[] | any[]>([]);
|
const options = ref<PollOption[] | any[]>([]);
|
||||||
|
|
||||||
async function loadData() {
|
async function loadData() {
|
||||||
await store.poll.fetchById(String(props.dataId));
|
await store.poll.fetchById(String(props.dataId));
|
||||||
await store.pollOptions.fetchByPollId(String(props.dataId));
|
await store.pollOptions.fetchByPollId(String(props.dataId));
|
||||||
await store.pollResponse.fetchByPollId(String(props.dataId));
|
// await store.pollResponse.fetchByPollId(String(props.dataId));
|
||||||
assignData();
|
assignData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,6 +78,8 @@ async function submitVote() {
|
|||||||
switch (poll.type) {
|
switch (poll.type) {
|
||||||
case 1:
|
case 1:
|
||||||
if(singleSelect.value >= 0) {
|
if(singleSelect.value >= 0) {
|
||||||
|
const result = await store.pollResponse.create({ optionId: singleSelect.value })
|
||||||
|
if(result?.id) {
|
||||||
totalResponses.value = options.value?.reduce((sum, option) => sum + Number(option.responseCount ?? 0), 1);
|
totalResponses.value = options.value?.reduce((sum, option) => sum + Number(option.responseCount ?? 0), 1);
|
||||||
options?.value?.forEach((option: PollOption | any) => {
|
options?.value?.forEach((option: PollOption | any) => {
|
||||||
if (option.id === singleSelect.value) {
|
if (option.id === singleSelect.value) {
|
||||||
@@ -88,6 +90,7 @@ async function submitVote() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ const props = defineProps<{
|
|||||||
type?: any; // [TOP_NAVIGATION, BOTTOM_NAVIGATION]
|
type?: any; // [TOP_NAVIGATION, BOTTOM_NAVIGATION]
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
const contentParse = computed(() => (currentPage.value.content ? JSON.parse(currentPage.value.content) : {}));
|
||||||
const defineTypeRecusive = {
|
const defineTypeRecusive = {
|
||||||
TOP_NAVIGATION: enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.NAVIGATION]['TOP']}`]['NAVIGATION_TOP_DEFAULT'],
|
TOP_NAVIGATION: enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.NAVIGATION]['TOP']}`]['NAVIGATION_TOP_DEFAULT'],
|
||||||
BOTTOM_NAVIGATION: enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.NAVIGATION]['BOTTOM']}`]['NAVIGATION_BOTTOM_DEFAULT'],
|
BOTTOM_NAVIGATION: enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.NAVIGATION]['BOTTOM']}`]['NAVIGATION_BOTTOM_DEFAULT'],
|
||||||
@@ -16,14 +17,22 @@ const findDataPosition = computed<any>(() => {
|
|||||||
let result = {};
|
let result = {};
|
||||||
switch (props.type) {
|
switch (props.type) {
|
||||||
case defineTypeRecusive.TOP_NAVIGATION:
|
case defineTypeRecusive.TOP_NAVIGATION:
|
||||||
result = currentPage.value.components && currentPage.value.components.find((component: any) => {
|
if (contentParse.value.navigationTop) {
|
||||||
return component.taxonomy === enumPageComponentKey.NAVIGATION && component.settings?.layout === defineTypeRecusive.TOP_NAVIGATION
|
result =
|
||||||
|
currentPage.value.components &&
|
||||||
|
currentPage.value.components.find((component: any) => {
|
||||||
|
return component.id === contentParse.value.navigationTop;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case defineTypeRecusive.BOTTOM_NAVIGATION:
|
case defineTypeRecusive.BOTTOM_NAVIGATION:
|
||||||
result = currentPage.value.components && currentPage.value.components.find((component: any) => {
|
if (contentParse.value.navigationBottom) {
|
||||||
return component.taxonomy === enumPageComponentKey.NAVIGATION && component.settings?.layout === defineTypeRecusive.BOTTOM_NAVIGATION
|
result =
|
||||||
|
currentPage.value.components &&
|
||||||
|
currentPage.value.components.find((component: any) => {
|
||||||
|
return component.id === contentParse.value.navigationBottom;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
result = {};
|
result = {};
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ const props = defineProps<{
|
|||||||
dataQuery?: any;
|
dataQuery?: any;
|
||||||
layout?: string;
|
layout?: string;
|
||||||
label?: any;
|
label?: any;
|
||||||
|
component?: any;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const LAYOUT_PARSE = computed(() => {
|
const LAYOUT_PARSE = computed(() => {
|
||||||
@@ -51,8 +52,10 @@ const parseData = computed(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<article class="card-audio" :class="LAYOUT_PARSE['article_Class']" :style="LAYOUT_PARSE['article']">
|
<article :id="`cpn_${props.component.id}`" class="card-audio" :class="LAYOUT_PARSE['article_Class']" :style="LAYOUT_PARSE['article']">
|
||||||
|
<nuxt-link :to="`/bai-viet/${parseData?.slug}`" class="article-thumbnail">
|
||||||
<img :src="parseData?.thumbnail ? parseData?.thumbnail : 'https://indiaeducationdiary.in/wp-content/uploads/2021/02/SD-default-image.png'" :alt="parseData?.title?.replace(/<[^>]+>/g, '')" />
|
<img :src="parseData?.thumbnail ? parseData?.thumbnail : 'https://indiaeducationdiary.in/wp-content/uploads/2021/02/SD-default-image.png'" :alt="parseData?.title?.replace(/<[^>]+>/g, '')" />
|
||||||
|
</nuxt-link>
|
||||||
<div class="card-audio__content">
|
<div class="card-audio__content">
|
||||||
<span class="flex justify-center">
|
<span class="flex justify-center">
|
||||||
<template v-if="['Image', 'Infographics', 'Emagazine'].includes(type)">
|
<template v-if="['Image', 'Infographics', 'Emagazine'].includes(type)">
|
||||||
@@ -92,12 +95,18 @@ const parseData = computed(() => {
|
|||||||
padding-bottom: calc((16 / 9) * 100%);
|
padding-bottom: calc((16 / 9) * 100%);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
img {
|
.article-thumbnail {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
object-fit: cover;
|
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
|
||||||
|
& img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-audio__content {
|
.card-audio__content {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ const props = defineProps<{
|
|||||||
dataQuery?: any;
|
dataQuery?: any;
|
||||||
layout?: string;
|
layout?: string;
|
||||||
label?: any;
|
label?: any;
|
||||||
|
component?: any;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const LAYOUT_PARSE = computed(() => {
|
const LAYOUT_PARSE = computed(() => {
|
||||||
@@ -27,11 +28,12 @@ const parseData = computed(() => {
|
|||||||
<template>
|
<template>
|
||||||
<article
|
<article
|
||||||
v-if="parseData"
|
v-if="parseData"
|
||||||
|
:id="`cpn_${props.component.id}`"
|
||||||
class="basic-article border-custom"
|
class="basic-article border-custom"
|
||||||
:class="LAYOUT_PARSE['article_Class']"
|
:class="LAYOUT_PARSE['article_Class']"
|
||||||
:style="LAYOUT_PARSE['article']"
|
:style="LAYOUT_PARSE['article']"
|
||||||
>
|
>
|
||||||
<div class="basic-article_thumbnail" :class="LAYOUT_PARSE['thumbnail_Class']" :style="LAYOUT_PARSE['div.basic-article_thumbnail']">
|
<div class="basic-article_thumbnail article-thumbnail" :class="LAYOUT_PARSE['thumbnail_Class']" :style="LAYOUT_PARSE['div.basic-article_thumbnail']">
|
||||||
<template v-if="parseData">
|
<template v-if="parseData">
|
||||||
<nuxt-link :to="`${parseData.code}`">
|
<nuxt-link :to="`${parseData.code}`">
|
||||||
<img class="object-fit-cover" :src="parseData.thumbnail ? parseData.thumbnail : '/images/default-thumbnail.jpg'" :alt="parseData.title?.replace(/<[^>]+>/g, '')" />
|
<img class="object-fit-cover" :src="parseData.thumbnail ? parseData.thumbnail : '/images/default-thumbnail.jpg'" :alt="parseData.title?.replace(/<[^>]+>/g, '')" />
|
||||||
@@ -55,19 +57,19 @@ const parseData = computed(() => {
|
|||||||
<span v-else class="empty-block" style="height: 8px"></span>
|
<span v-else class="empty-block" style="height: 8px"></span>
|
||||||
</h3>
|
</h3>
|
||||||
<div class="article-card-default__bottom" v-if="LAYOUT_PARSE.layout === 'row'">
|
<div class="article-card-default__bottom" v-if="LAYOUT_PARSE.layout === 'row'">
|
||||||
<span :style="LAYOUT_PARSE['time']" style="margin-right: 5px" :class="LAYOUT_PARSE['time_Class']">{{
|
<span :style="LAYOUT_PARSE['time']" style="margin-right: 5px" :class="[LAYOUT_PARSE['time_Class'], 'article-time']">{{
|
||||||
formatDate(String(parseData?.createdOn), "DD/MM/YYYY | HH:mm")
|
formatDate(String(parseData?.createdOn), "DD/MM/YYYY | HH:mm")
|
||||||
}}</span>
|
}}</span>
|
||||||
<nuxt-link :style="LAYOUT_PARSE['category-article']" :class="LAYOUT_PARSE['category-article_Class']">{{ parseData?.category?.title }}</nuxt-link>
|
<nuxt-link :style="LAYOUT_PARSE['category-article']" :class="LAYOUT_PARSE['category-article_Class']">{{ parseData?.category?.title }}</nuxt-link>
|
||||||
</div>
|
</div>
|
||||||
<p class="mb-0 line-clamp-5" :class="LAYOUT_PARSE['paragraph_Class']" :style="LAYOUT_PARSE['p.paragraph']">
|
<p class="mb-0 line-clamp-5 article-intro" :class="LAYOUT_PARSE['paragraph_Class']" :style="LAYOUT_PARSE['p.paragraph']">
|
||||||
<template v-if="parseData">
|
<template v-if="parseData">
|
||||||
{{ parseData.intro?.replace(/<[^>]+>/g, "") }}
|
{{ parseData.intro?.replace(/<[^>]+>/g, "") }}
|
||||||
</template>
|
</template>
|
||||||
<span v-else class="empty-block" style="height: 5px"></span>
|
<span v-else class="empty-block" style="height: 5px"></span>
|
||||||
</p>
|
</p>
|
||||||
<div class="article-card-default__bottom" v-if="LAYOUT_PARSE?.layout !== 'row'" :style="LAYOUT_PARSE['metadata']">
|
<div class="article-card-default__bottom" v-if="LAYOUT_PARSE?.layout !== 'row'" :style="LAYOUT_PARSE['metadata']">
|
||||||
<span :style="LAYOUT_PARSE['time']" style="margin-right: 5px" :class="LAYOUT_PARSE['time_Class']">{{
|
<span :style="LAYOUT_PARSE['time']" style="margin-right: 5px" :class="[LAYOUT_PARSE['time_Class'], 'article-time']">{{
|
||||||
formatDate(String(parseData?.createdOn), "DD/MM/YYYY | HH:mm")
|
formatDate(String(parseData?.createdOn), "DD/MM/YYYY | HH:mm")
|
||||||
}}</span>
|
}}</span>
|
||||||
<nuxt-link :style="LAYOUT_PARSE['category-article']" :class="LAYOUT_PARSE['category-article_Class']">{{ parseData?.category?.title }}</nuxt-link>
|
<nuxt-link :style="LAYOUT_PARSE['category-article']" :class="LAYOUT_PARSE['category-article_Class']">{{ parseData?.category?.title }}</nuxt-link>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ const props = defineProps<{
|
|||||||
dataQuery?: any;
|
dataQuery?: any;
|
||||||
layout?: string;
|
layout?: string;
|
||||||
label?: string;
|
label?: string;
|
||||||
|
component?: any;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const LAYOUT_PARSE = computed(() => {
|
const LAYOUT_PARSE = computed(() => {
|
||||||
@@ -44,14 +45,21 @@ const drop = (e: any) => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<article class="basic-article border-custom" :class="LAYOUT_PARSE['article_Class']" :style="LAYOUT_PARSE['article']">
|
<article :id="`cpn_${props.component.id}`" class="basic-article border-custom" :class="LAYOUT_PARSE['article_Class']" :style="LAYOUT_PARSE['article']">
|
||||||
<div class="article_miss">
|
<div class="article_miss">
|
||||||
<template v-if="parseData">
|
<template v-if="parseData">
|
||||||
|
<nuxt-link :to="`/bai-viet/${parseData.slug}`">
|
||||||
<div class="article_miss_thumb custom-thumb" :style="{ backgroundImage: `url('${parseData.thumbnail ? parseData.thumbnail : '/images/default-thumbnail.jpg'}')` }"></div>
|
<div class="article_miss_thumb custom-thumb" :style="{ backgroundImage: `url('${parseData.thumbnail ? parseData.thumbnail : '/images/default-thumbnail.jpg'}')` }"></div>
|
||||||
|
</nuxt-link>
|
||||||
|
|
||||||
|
|
||||||
<div class="article_miss_content" :style="LAYOUT_PARSE['content']">
|
<div class="article_miss_content" :style="LAYOUT_PARSE['content']">
|
||||||
|
<nuxt-link :to="`/bai-viet/${parseData.slug}`">
|
||||||
|
|
||||||
<h3 class="line-clamp text-white" :class="LAYOUT_PARSE['title_Class']" :style="LAYOUT_PARSE['h3.title']">
|
<h3 class="line-clamp text-white" :class="LAYOUT_PARSE['title_Class']" :style="LAYOUT_PARSE['h3.title']">
|
||||||
{{ parseData.title?.replace(/<[^>]+>/g, "") }}
|
{{ parseData.title?.replace(/<[^>]+>/g, "") }}
|
||||||
</h3>
|
</h3>
|
||||||
|
</nuxt-link>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div v-else class="empty-box"></div>
|
<div v-else class="empty-box"></div>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ const props = defineProps<{
|
|||||||
dataQuery?: any;
|
dataQuery?: any;
|
||||||
layout?: string;
|
layout?: string;
|
||||||
label?: any;
|
label?: any;
|
||||||
|
component?: any;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const LAYOUT_PARSE = computed(() => {
|
const LAYOUT_PARSE = computed(() => {
|
||||||
@@ -24,6 +25,7 @@ const parseData = computed(() => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<article
|
<article
|
||||||
|
:id="`cpn_${props.component.id}`"
|
||||||
class="basic-article border-custom"
|
class="basic-article border-custom"
|
||||||
:class="LAYOUT_PARSE['article_Class']"
|
:class="LAYOUT_PARSE['article_Class']"
|
||||||
:style="LAYOUT_PARSE['article']"
|
:style="LAYOUT_PARSE['article']"
|
||||||
|
|||||||
@@ -12,18 +12,83 @@ console.log(currentArticle.value, 'currentArticle')
|
|||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="overflow-hidden emagazine">
|
<div class="overflow-hidden emagazine">
|
||||||
<!-- bổ sung sau -->
|
<h2 class="font-gelasio text-center text-44px font-bold leading-130%" v-if="currentArticle?.title" v-html="currentArticle?.title"></h2>
|
||||||
<!-- <img :src="currentArticle.thumbnail" alt="" class="w-full object-cover">
|
<div class="article-detail" v-html="currentArticle.detail"></div>
|
||||||
|
|
||||||
<div class="px-44px pb-30px my-30px max-w-660px mx-auto border-b-1px border-#000">
|
|
||||||
|
|
||||||
</div> -->
|
|
||||||
|
|
||||||
<div v-html="currentArticle.detail"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.breadcrumb {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
|
||||||
|
&__list {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0px;
|
||||||
|
display: flex;
|
||||||
|
overflow-x: auto;
|
||||||
|
gap: 1.5rem;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 0.875rem;
|
||||||
|
line-height: 1.25rem;
|
||||||
|
|
||||||
|
&__item {
|
||||||
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&__title {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 18px;
|
||||||
|
color: #000;
|
||||||
|
font-weight: 500;
|
||||||
|
text-transform: uppercase;
|
||||||
|
line-height: 180%;
|
||||||
|
}
|
||||||
|
// &:first-child {
|
||||||
|
// color: blue;
|
||||||
|
// }
|
||||||
|
|
||||||
|
&:not(:first-child):before {
|
||||||
|
content: "\\";
|
||||||
|
position: absolute;
|
||||||
|
left: -18px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.article-card-default__topic {
|
||||||
|
position: relative;
|
||||||
|
// background-color: #151411;
|
||||||
|
display: inline-block;
|
||||||
|
|
||||||
|
h5 {
|
||||||
|
font-size: 12px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
text-transform: uppercase;
|
||||||
|
// color: #fff;
|
||||||
|
padding: 0 12px;
|
||||||
|
height: 100%;
|
||||||
|
margin: 0;
|
||||||
|
border: 1px solid #000;
|
||||||
|
line-height: 180%;
|
||||||
|
font-weight: 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
position: absolute;
|
||||||
|
content: "";
|
||||||
|
display: block;
|
||||||
|
width: 12px;
|
||||||
|
height: 100%;
|
||||||
|
background-color: #ed1c24;
|
||||||
|
left: -12px;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
.content {
|
.content {
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,13 +18,83 @@ console.log(currentArticle.value, 'currentArticle')
|
|||||||
<div class="px-44px pb-30px my-30px max-w-660px mx-auto border-b-1px border-#000">
|
<div class="px-44px pb-30px my-30px max-w-660px mx-auto border-b-1px border-#000">
|
||||||
|
|
||||||
</div> -->
|
</div> -->
|
||||||
|
<h2 class="font-gelasio text-center text-44px font-bold leading-130%" v-if="currentArticle?.title" v-html="currentArticle?.title"></h2>
|
||||||
<div v-html="currentArticle.detail"></div>
|
<div v-html="currentArticle.detail"></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.breadcrumb {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
|
||||||
|
&__list {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0px;
|
||||||
|
display: flex;
|
||||||
|
overflow-x: auto;
|
||||||
|
gap: 1.5rem;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 0.875rem;
|
||||||
|
line-height: 1.25rem;
|
||||||
|
|
||||||
|
&__item {
|
||||||
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&__title {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 18px;
|
||||||
|
color: #000;
|
||||||
|
font-weight: 500;
|
||||||
|
text-transform: uppercase;
|
||||||
|
line-height: 180%;
|
||||||
|
}
|
||||||
|
// &:first-child {
|
||||||
|
// color: blue;
|
||||||
|
// }
|
||||||
|
|
||||||
|
&:not(:first-child):before {
|
||||||
|
content: "\\";
|
||||||
|
position: absolute;
|
||||||
|
left: -18px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.article-card-default__topic {
|
||||||
|
position: relative;
|
||||||
|
// background-color: #151411;
|
||||||
|
display: inline-block;
|
||||||
|
|
||||||
|
h5 {
|
||||||
|
font-size: 12px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
text-transform: uppercase;
|
||||||
|
// color: #fff;
|
||||||
|
padding: 0 12px;
|
||||||
|
height: 100%;
|
||||||
|
margin: 0;
|
||||||
|
border: 1px solid #000;
|
||||||
|
line-height: 180%;
|
||||||
|
font-weight: 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
position: absolute;
|
||||||
|
content: "";
|
||||||
|
display: block;
|
||||||
|
width: 12px;
|
||||||
|
height: 100%;
|
||||||
|
background-color: #ed1c24;
|
||||||
|
left: -12px;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
.center-y {
|
.center-y {
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ function findElementPathById(categories: any[], targetId: number, path: any[] =
|
|||||||
<nuxt-link class="font-raleway text-18px font-500 leading-180% uppercase" :to="`/${category.code}`">{{ category.title }}</nuxt-link>
|
<nuxt-link class="font-raleway text-18px font-500 leading-180% uppercase" :to="`/${category.code}`">{{ category.title }}</nuxt-link>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<h2 class="font-gelasio text-center text-44px font-bold leading-130%" v-if="currentArticle?.title" v-html="currentArticle?.title"></h2>
|
||||||
<div class="video-content" v-html="currentArticle.detail"></div>
|
<div class="video-content" v-html="currentArticle.detail"></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ const _props = defineProps<{
|
|||||||
dataResult?: any;
|
dataResult?: any;
|
||||||
dataQuery?: string;
|
dataQuery?: string;
|
||||||
label?: any;
|
label?: any;
|
||||||
|
component?: any;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const SETTING_OPTIONS = {
|
const SETTING_OPTIONS = {
|
||||||
@@ -37,7 +38,7 @@ const mapActivesToItems = (index: number) => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="categories-container border-custom" :class="designObject['categories_Class']" :style="designObject['div.categories-container']">
|
<div :id="`cpn_${_props.component.id}`" class="categories-container border-custom" :class="designObject['categories_Class']" :style="designObject['div.categories-container']">
|
||||||
<div v-for="(component, index) in _dataResult" :key="index" :class="['border-custom', isEmpty(component) ? 'empty' : 'category', designObject['category_Class']]" :style="mapActivesToItems(index)['category']">
|
<div v-for="(component, index) in _dataResult" :key="index" :class="['border-custom', isEmpty(component) ? 'empty' : 'category', designObject['category_Class']]" :style="mapActivesToItems(index)['category']">
|
||||||
<template v-if="!isEmpty(component)">
|
<template v-if="!isEmpty(component)">
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ const _props = defineProps<{
|
|||||||
dataResult?: any;
|
dataResult?: any;
|
||||||
dataQuery?: string;
|
dataQuery?: string;
|
||||||
label?: any;
|
label?: any;
|
||||||
|
component?: any;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const SETTING_OPTIONS = {
|
const SETTING_OPTIONS = {
|
||||||
@@ -37,7 +38,7 @@ const mapActivesToItems = (index: number) => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="categories-container border-custom flex-wrap" :class="designObject['categories_Class']" :style="designObject['div.categories-container']">
|
<div :id="`cpn_${_props.component.id}`" class="categories-container border-custom flex-wrap" :class="designObject['categories_Class']" :style="designObject['div.categories-container']">
|
||||||
<div v-for="(component, index) in _dataResult" :key="index" :class="['border-custom', isEmpty(component) ? 'empty' : 'category', designObject['category_Class']]" :style="mapActivesToItems(index)['category']">
|
<div v-for="(component, index) in _dataResult" :key="index" :class="['border-custom', isEmpty(component) ? 'empty' : 'category', designObject['category_Class']]" :style="mapActivesToItems(index)['category']">
|
||||||
<template v-if="!isEmpty(component)">
|
<template v-if="!isEmpty(component)">
|
||||||
<div class="category-content">
|
<div class="category-content">
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ const _props = defineProps<{
|
|||||||
layout?: string;
|
layout?: string;
|
||||||
label?: any;
|
label?: any;
|
||||||
content?: any;
|
content?: any;
|
||||||
|
component?: any;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const SETTING_OPTIONS = {
|
const SETTING_OPTIONS = {
|
||||||
@@ -46,7 +47,7 @@ const mapActivesToItems = (index: number) => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="collection-container border-custom" :class="[LAYOUT_PARSE['div.collection-container_Class'], LAYOUT_PARSE['collection_Class']]" :style="LAYOUT_PARSE['div.collection-container']">
|
<div :id="`cpn_${_props.component.id}`" class="collection-container border-custom" :class="[LAYOUT_PARSE['div.collection-container_Class'], LAYOUT_PARSE['collection_Class']]" :style="LAYOUT_PARSE['div.collection-container']">
|
||||||
<DynamicComponent
|
<DynamicComponent
|
||||||
v-for="(component, index) in _dataResult"
|
v-for="(component, index) in _dataResult"
|
||||||
:key="index"
|
:key="index"
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ const _props = defineProps<{
|
|||||||
layout?: string;
|
layout?: string;
|
||||||
label?: any;
|
label?: any;
|
||||||
content?: any;
|
content?: any;
|
||||||
|
component?: any;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const SETTING_OPTIONS = {
|
const SETTING_OPTIONS = {
|
||||||
@@ -46,7 +47,7 @@ const mapActivesToItems = (index: number) => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="collection-container border-custom overflow-hidden" :class="[LAYOUT_PARSE['div.collection-container_Class'], LAYOUT_PARSE['collection_Class']]" :style="LAYOUT_PARSE['div.collection-container']">
|
<div :id="`cpn_${_props.component.id}`" class="collection-container border-custom overflow-hidden" :class="[LAYOUT_PARSE['div.collection-container_Class'], LAYOUT_PARSE['collection_Class']]" :style="LAYOUT_PARSE['div.collection-container']">
|
||||||
<DynamicComponent
|
<DynamicComponent
|
||||||
v-for="(component, index) in _dataResult"
|
v-for="(component, index) in _dataResult"
|
||||||
:key="index"
|
:key="index"
|
||||||
|
|||||||
+4
-3
@@ -10,6 +10,7 @@ const _props = defineProps<{
|
|||||||
layout?: string;
|
layout?: string;
|
||||||
label?: string;
|
label?: string;
|
||||||
content?: any;
|
content?: any;
|
||||||
|
component?: any;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const SETTING_OPTIONS = {
|
const SETTING_OPTIONS = {
|
||||||
@@ -66,10 +67,10 @@ const mapActivesToItems = (index: number) => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<section class="gallery" :class="[LAYOUT_PARSE['div.collection-container_Class'], LAYOUT_PARSE['collection_Class']]" @click="selectComponent" :style="LAYOUT_PARSE['div.collection-container']">
|
<section :id="`cpn_${_props.component.id}`" class="gallery" :class="[LAYOUT_PARSE['div.collection-container_Class'], LAYOUT_PARSE['collection_Class']]" @click="selectComponent" :style="LAYOUT_PARSE['div.collection-container']">
|
||||||
<div class="wrap" v-for="(component, index) in _dataResult" :key="index">
|
<div class="wrap" v-for="(component, index) in _dataResult" :key="index">
|
||||||
<DynamicComponent
|
<DynamicComponent
|
||||||
class="abc"
|
class="box"
|
||||||
:settings="{
|
:settings="{
|
||||||
template: SETTING_OPTIONS.TEMPLATE,
|
template: SETTING_OPTIONS.TEMPLATE,
|
||||||
layout: SETTING_OPTIONS.LAYOUT,
|
layout: SETTING_OPTIONS.LAYOUT,
|
||||||
@@ -141,7 +142,7 @@ const mapActivesToItems = (index: number) => {
|
|||||||
padding-top: 241px;
|
padding-top: 241px;
|
||||||
}
|
}
|
||||||
|
|
||||||
& > .abc {
|
& > .box {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { isEmpty } from "@/utils/lodash";
|
import { isEmpty } from "@/utils/lodash";
|
||||||
import { nanoid } from "nanoid"
|
import { nanoid } from "nanoid";
|
||||||
import DynamicComponent from "~/components/dynamic-page/page-component/templates/index.vue";
|
import DynamicComponent from "~/components/dynamic-page/page-component/templates/index.vue";
|
||||||
import RecusiveNavItem from "@/components/dynamic-page/page-component/templates/navigations/components/RecusiveNavItem.vue";
|
import RecusiveNavItem from "@/components/dynamic-page/page-component/templates/navigations/components/RecusiveNavItem.vue";
|
||||||
import { buildTree } from "@/utils/recusive";
|
import { buildTree } from "@/utils/recusive";
|
||||||
@@ -15,16 +15,17 @@ const _props = defineProps<{
|
|||||||
<div class="px-4 mt-4">
|
<div class="px-4 mt-4">
|
||||||
<div class="nav-container">
|
<div class="nav-container">
|
||||||
<template v-if="_props.content">
|
<template v-if="_props.content">
|
||||||
<div v-for="item, index in buildTree(_props.content)" :key="index" class="nav-items-box">
|
<div v-for="(item, index) in buildTree(_props.content)" :key="index" class="nav-items-box">
|
||||||
<div class="submenu-container">
|
<div class="submenu-container">
|
||||||
<h4 class="" >{{ item.title }}</h4>
|
<nuxt-link :to="`/${item.slug}`"
|
||||||
<div class="ml-2">
|
><h4 class="font-raleway">{{ item.title }}</h4></nuxt-link
|
||||||
<h5
|
|
||||||
v-for="_item, _index in item.childs ? item.childs : []"
|
|
||||||
:key="_index"
|
|
||||||
>
|
>
|
||||||
|
<div class="ml-2">
|
||||||
|
<nuxt-link v-for="(_item, _index) in item.childs ? item.childs : []" :key="_index" :to="`/${_item.slug}`"
|
||||||
|
><h5 class="font-raleway">
|
||||||
{{ _item.title }}
|
{{ _item.title }}
|
||||||
</h5>
|
</h5></nuxt-link
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+3
-3
@@ -20,7 +20,7 @@ const setGlobalState = (id: any) => {
|
|||||||
<template v-if="record && record.childs && record.childs.length > 0 && record.typeChild === enumPageComponentStaticChild.DEFAULT">
|
<template v-if="record && record.childs && record.childs.length > 0 && record.typeChild === enumPageComponentStaticChild.DEFAULT">
|
||||||
<div class="navigation-submenu">
|
<div class="navigation-submenu">
|
||||||
<div class="navigation_title">
|
<div class="navigation_title">
|
||||||
<nuxt-link :to="record?.slug" class="!font-arial !font-400">{{ record?.title }}</nuxt-link>
|
<nuxt-link :to="`/${record?.slug}`" class="!font-arial !font-400">{{ record?.title }}</nuxt-link>
|
||||||
</div>
|
</div>
|
||||||
<div class="navigation-item submenu-container dropdown-container">
|
<div class="navigation-item submenu-container dropdown-container">
|
||||||
<RecusiveNavItem :records="record.childs" />
|
<RecusiveNavItem :records="record.childs" />
|
||||||
@@ -31,7 +31,7 @@ const setGlobalState = (id: any) => {
|
|||||||
<div class="navigation-submenu">
|
<div class="navigation-submenu">
|
||||||
<div class="position-relative ps-3">
|
<div class="position-relative ps-3">
|
||||||
<div class="navigation_title ">
|
<div class="navigation_title ">
|
||||||
<nuxt-link :to="record?.slug" class="!font-arial !font-400">{{ record?.title }}</nuxt-link>
|
<nuxt-link :to="`/${record?.slug}`" class="!font-arial !font-400">{{ record?.title }}</nuxt-link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="full-layout dropdown-container">
|
<div class="full-layout dropdown-container">
|
||||||
@@ -45,7 +45,7 @@ const setGlobalState = (id: any) => {
|
|||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<div class="navigation_title navigation-item" >
|
<div class="navigation_title navigation-item" >
|
||||||
<nuxt-link :to="record?.slug" class="!font-arial !font-400">{{ record?.title }}</nuxt-link>
|
<nuxt-link :to="`/${record?.slug}`" class="!font-arial !font-400">{{ record?.title }}</nuxt-link>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -83,7 +83,11 @@ const mapActivesToItems = (index: number) => {
|
|||||||
return {};
|
return {};
|
||||||
};
|
};
|
||||||
|
|
||||||
const currentCategoryTree = findElementPathById(categoryTree.value, currentArticle.value.categoryId);
|
const currentCategoryTree = ref<any []>([]);
|
||||||
|
if(currentArticle.value?.categoryId) {
|
||||||
|
console.log('urrentArticle.value?.categoryId', categoryTree.value)
|
||||||
|
currentCategoryTree.value = findElementPathById(categoryTree.value, currentArticle.value.categoryId)
|
||||||
|
}
|
||||||
function findElementPathById(categories: any[], targetId: number, path: any[] = []) {
|
function findElementPathById(categories: any[], targetId: number, path: any[] = []) {
|
||||||
for (const category of categories) {
|
for (const category of categories) {
|
||||||
const currentPath = [...path, { title: category.title, code: category.code }];
|
const currentPath = [...path, { title: category.title, code: category.code }];
|
||||||
@@ -99,15 +103,13 @@ function findElementPathById(categories: any[], targetId: number, path: any[] =
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(currentArticle.value ,'currentArticle')
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="section_layout border-custom four_col_layout" :style="LAYOUT_PARSE['div.section_layout']">
|
<div class="section_layout border-custom four_col_layout" :style="LAYOUT_PARSE['div.section_layout']">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<div>
|
<div>
|
||||||
<div class="audio">
|
<!-- <div class="audio">
|
||||||
<div class="play">
|
<div class="play">
|
||||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path
|
<path
|
||||||
@@ -123,7 +125,7 @@ console.log(currentArticle.value ,'currentArticle')
|
|||||||
<div class="timeline">
|
<div class="timeline">
|
||||||
<input type="range" name="" id="" />
|
<input type="range" name="" id="" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
@@ -189,7 +191,7 @@ console.log(currentArticle.value ,'currentArticle')
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tags" v-if="currentArticle.tags">
|
<div class="tags" v-if="currentArticle && currentArticle?.tags">
|
||||||
<span>
|
<span>
|
||||||
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path
|
<path
|
||||||
@@ -199,8 +201,8 @@ console.log(currentArticle.value ,'currentArticle')
|
|||||||
</svg>
|
</svg>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<ul>
|
<ul >
|
||||||
<li v-for="(tag, index) in currentArticle.tags">
|
<li v-for="(tag, index) in currentArticle?.tags">
|
||||||
<nuxt-link class="font-raleway font-500" :to="`/tag/${tag.code}`">{{ tag.title }}</nuxt-link>
|
<nuxt-link class="font-raleway font-500" :to="`/tag/${tag.code}`">{{ tag.title }}</nuxt-link>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -220,38 +222,38 @@ console.log(currentArticle.value ,'currentArticle')
|
|||||||
<div class="content detail-default">
|
<div class="content detail-default">
|
||||||
<div class="content__top">
|
<div class="content__top">
|
||||||
<div class="flex justify-between flex-wrap items-center mb-10px">
|
<div class="flex justify-between flex-wrap items-center mb-10px">
|
||||||
<ul class="flex gap-32px">
|
<ul class="flex gap-32px" v-if="currentCategoryTree?.length">
|
||||||
<li v-for="( category, index ) in currentCategoryTree" :key="index" class="first:text-#000 text-#929292 last:after:content-[''] relative after:absolute after:content-['/'] after:text-20px after:right--20px" >
|
<li v-for="( category, index ) in currentCategoryTree" :key="index" class="first:text-#000 text-#929292 last:after:content-[''] relative after:absolute after:content-['/'] after:text-20px after:right--20px" >
|
||||||
<nuxt-link class=" font-raleway text-18px font-500 leading-180% uppercase" :to="`/${category.code}`">{{ category.title }}</nuxt-link>
|
<nuxt-link class=" font-raleway text-18px font-500 leading-180% uppercase" :to="`/${category.code}`">{{ category.title }}</nuxt-link>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div v-if="currentArticle.topics" class="pl-20px relative bg-primary inline-block">
|
<div v-if="currentArticle?.topics" class="pl-20px relative bg-primary inline-block">
|
||||||
<nuxt-link class="h-30px block py-4px px-16px border-1 border-#000 bg-white text-12px leading-180% font-raleway font-400" :to="`/topic/${currentArticle.topics[0].slug}`">{{ currentArticle.topics[0].title }}</nuxt-link>
|
<nuxt-link class="h-30px block py-4px px-16px border-1 border-#000 bg-white text-12px leading-180% font-raleway font-400" :to="`/topic/${currentArticle?.topics[0].slug}`">{{ currentArticle?.topics[0].title }}</nuxt-link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<h2 class="font-gelasio text-44px font-bold leading-130%" v-if="currentArticle.title" v-html="currentArticle.title"></h2>
|
<h2 class="font-gelasio text-44px font-bold leading-130%" v-if="currentArticle?.title" v-html="currentArticle?.title"></h2>
|
||||||
|
|
||||||
<div class="author flex gap-12px my-20px" v-if="currentArticle.authors">
|
<div class="author flex gap-12px my-20px" v-if="currentArticle?.authors">
|
||||||
<ul class="flex">
|
<ul class="flex">
|
||||||
<li :style="{'z-index': index + 1}" class="relative ml--12px first:ml-0" v-for="(author, index) in currentArticle.authors" :key="index">
|
<li :style="{'z-index': index + 1}" class="relative ml--12px first:ml-0" v-for="(author, index) in currentArticle?.authors" :key="index">
|
||||||
<nuxt-link :to="`/tac-gia/${author.code}`">
|
<nuxt-link :to="`/tac-gia/${author.code}`">
|
||||||
<img :src="author.thumbnail || `http://picsum.photos/1024/600?random=1`" alt="" class="w-64px p-1px border-1px border-white h-64px object-cover rounded-full">
|
<img :src="author?.thumbnail || `http://picsum.photos/1024/600?random=1`" alt="" class="w-64px p-1px border-1px border-white h-64px object-cover rounded-full">
|
||||||
</nuxt-link>
|
</nuxt-link>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div>
|
<div>
|
||||||
<div class="mt-10px">
|
<div class="mt-10px">
|
||||||
<nuxt-link class="font-raleway text-#000" v-for="(author, index) in currentArticle.authors" :key="index" :to="`/tac-gia/${author.code}`">{{ author.title + (index < currentArticle.authors.length - 1 ? ', ' : '') }}</nuxt-link>
|
<nuxt-link class="font-raleway text-#000" v-for="(author, index) in currentArticle?.authors" :key="index" :to="`/tac-gia/${author.code}`">{{ author.title + (index < currentArticle.authors.length - 1 ? ', ' : '') }}</nuxt-link>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-12px">
|
<div class="text-12px">
|
||||||
Xuất bản vào {{ formatDate(currentArticle.publishedOn, 'DD/MM/YYYY | hh:mm') }}
|
Xuất bản vào {{ formatDate(currentArticle?.publishedOn, 'DD/MM/YYYY | hh:mm') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<figure v-if="currentArticle.thumbnail">
|
<figure v-if="currentArticle?.thumbnail">
|
||||||
<img :src="currentArticle.thumbnail" class="w-full " alt="">
|
<img :src="currentArticle?.thumbnail" class="w-full " alt="">
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<div class="content__bottom" >
|
<div class="content__bottom" >
|
||||||
@@ -302,11 +304,11 @@ console.log(currentArticle.value ,'currentArticle')
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<p class="my-10px" v-if="currentArticle.intro" v-html="currentArticle.intro">
|
<p class="my-10px" v-if="currentArticle?.intro" v-html="currentArticle.intro">
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<!-- <div v-html="currentArticle.detail" class="[&_p_>_span]:!font-raleway [&_p]:mb-10px"></div> -->
|
<!-- <div v-html="currentArticle.detail" class="[&_p_>_span]:!font-raleway [&_p]:mb-10px"></div> -->
|
||||||
<component :is="{ template: currentArticle.detail, components: { Poll, Quiz, Survey, Document, Attachment, Tag } }" />
|
<component :is="{ template: currentArticle?.detail, components: { Poll, Quiz, Survey, Document, Attachment, Tag } }" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="content__bottom__right">
|
<div class="content__bottom__right">
|
||||||
|
|||||||
@@ -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 +6,7 @@ import { enumPageComponentLayouts, enumPageComponentTemplate, enumPageComponentK
|
|||||||
<template>
|
<template>
|
||||||
<footer id="footer" class="main-footer mt-20">
|
<footer id="footer" class="main-footer mt-20">
|
||||||
<div class="main-footer-container">
|
<div class="main-footer-container">
|
||||||
<div class="footer-centertab grid lg:grid-cols-6">
|
<div class="footer-centertab">
|
||||||
<div class="col-span-1 lg:block hidden"></div>
|
|
||||||
<div class="col-span-5">
|
|
||||||
<div class="footer-navigation-container md:block hidden">
|
<div class="footer-navigation-container md:block hidden">
|
||||||
<div>
|
<div>
|
||||||
<AssignComponent :type="enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.NAVIGATION]['BOTTOM']}`]['NAVIGATION_BOTTOM_DEFAULT']" />
|
<AssignComponent :type="enumPageComponentLayouts[`${enumPageComponentTemplate[enumPageComponentKey.NAVIGATION]['BOTTOM']}`]['NAVIGATION_BOTTOM_DEFAULT']" />
|
||||||
@@ -85,11 +83,7 @@ import { enumPageComponentLayouts, enumPageComponentTemplate, enumPageComponentK
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="footer-bottomtab">
|
<div class="footer-bottomtab">
|
||||||
<div class="lg:grid-cols-6 grid">
|
|
||||||
<div class="lg:block hidden"></div>
|
|
||||||
<div class="col-span-5">
|
|
||||||
<div class="flex justify-between items-end">
|
<div class="flex justify-between items-end">
|
||||||
<div class="flex-1 flex md:justify-start justify-center">
|
<div class="flex-1 flex md:justify-start justify-center">
|
||||||
<div>
|
<div>
|
||||||
@@ -114,9 +108,7 @@ import { enumPageComponentLayouts, enumPageComponentTemplate, enumPageComponentK
|
|||||||
<p>Giấy phép số <span class="fw-bold">...</span>, cấp ngày ....</p>
|
<p>Giấy phép số <span class="fw-bold">...</span>, cấp ngày ....</p>
|
||||||
<p>Cơ quan chủ quản: <span class="fw-bold">....</span></p>
|
<p>Cơ quan chủ quản: <span class="fw-bold">....</span></p>
|
||||||
<p>Cấm sao chép dưới mọi hình thức nếu không có sự chấp thuận bằng văn bản</p>
|
<p>Cấm sao chép dưới mọi hình thức nếu không có sự chấp thuận bằng văn bản</p>
|
||||||
<p>Powered by GCT</p>
|
<p>Powered by VPress</p>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+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"
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import DynamicTemplate from "~/components/dynamic-page/page/templates/index.vue"
|
|||||||
import DynamicSection from "~/components/dynamic-page/page-section/templates/index.vue";
|
import DynamicSection from "~/components/dynamic-page/page-section/templates/index.vue";
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
const site = useCookie("site")
|
||||||
const store = reactive({
|
const store = reactive({
|
||||||
dynamicPage: useDynamicPageStore(),
|
dynamicPage: useDynamicPageStore(),
|
||||||
article: useArticleStore(),
|
article: useArticleStore(),
|
||||||
@@ -20,8 +20,9 @@ import { useArticleStore } from '~/stores/articles';
|
|||||||
|
|
||||||
const loadPage = async () => {
|
const loadPage = async () => {
|
||||||
const article = await store.article.getArticleBySlug(String(route.params.slug));
|
const article = await store.article.getArticleBySlug(String(route.params.slug));
|
||||||
|
site.value = article?.value.siteId
|
||||||
let isContentType
|
let isContentType
|
||||||
switch (article.value?.contentType) {
|
switch (article?.value?.contentType) {
|
||||||
case 1:
|
case 1:
|
||||||
isContentType = 'trang-chi-tiet';
|
isContentType = 'trang-chi-tiet';
|
||||||
break;
|
break;
|
||||||
@@ -75,7 +76,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"
|
||||||
|
|||||||
+6
-6
@@ -11,12 +11,12 @@ const store = reactive({
|
|||||||
});
|
});
|
||||||
//lấy danh sách categoryTree
|
//lấy danh sách categoryTree
|
||||||
await store.category.fetchBySiteId()
|
await store.category.fetchBySiteId()
|
||||||
|
// const site = useCookie('site')
|
||||||
const { data } = await useAsyncData('index', () => store.dynamicPage.fetchPageByCode(route.path === '/' ? 'trang-chu' : route.path.replace('/', '')))
|
const { data } = await useAsyncData('index', () => store.dynamicPage.fetchPageByCode(route.path === '/' ? 'trang-chu' : route.path.replace('/', '')))
|
||||||
const asycnCurrentPage = data.value.currentPage;
|
const asycnCurrentPage = data.value && data.value.currentPage;
|
||||||
const asycnSectionPublished = data.value.sectionPublished;
|
const asycnSectionPublished = data.value && data.value.sectionPublished;
|
||||||
const asycnComponentPublished = data.value.componentPublished;
|
const asycnComponentPublished = data.value && data.value.componentPublished;
|
||||||
|
// site.value = data.value?.currentPage?.siteId
|
||||||
useHead({
|
useHead({
|
||||||
title: () => 'Trang chủ',
|
title: () => 'Trang chủ',
|
||||||
description: () => 'Với công nghệ đột phá và giải pháp sáng tạo, Vpress sẽ là đối tác tin cậy của các tòa soạn báo, cùng nhau kiến tạo nên những giá trị bền vững trong kỷ nguyên chuyển đổi số báo chí.',
|
description: () => 'Với công nghệ đột phá và giải pháp sáng tạo, Vpress sẽ là đối tác tin cậy của các tòa soạn báo, cùng nhau kiến tạo nên những giá trị bền vững trong kỷ nguyên chuyển đổi số báo chí.',
|
||||||
@@ -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"
|
||||||
|
|||||||
@@ -63,9 +63,10 @@ export const getArticleById = async (event : any) => {
|
|||||||
try {
|
try {
|
||||||
const { apiUrl } = useRuntimeConfig().public
|
const { apiUrl } = useRuntimeConfig().public
|
||||||
const id = event.context.params.id;
|
const id = event.context.params.id;
|
||||||
|
const query = getQuery(event)
|
||||||
const { item }: any = await $fetch(`${apiUrl}/cms/digital-article/${id}`, {
|
const { item }: any = await $fetch(`${apiUrl}/cms/digital-article/${id}`, {
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
site: '1' || 1,
|
site: getSite(query.site).toString(),
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -79,9 +80,10 @@ export const getArticleBySlug = async (event : any) => {
|
|||||||
try {
|
try {
|
||||||
const { apiUrl } = useRuntimeConfig().public
|
const { apiUrl } = useRuntimeConfig().public
|
||||||
const slug = event.context.params.slug;
|
const slug = event.context.params.slug;
|
||||||
|
const query = getQuery(event)
|
||||||
const { item }: any = await $fetch(`${apiUrl}/cms/digital-article/slug:${slug}`, {
|
const { item }: any = await $fetch(`${apiUrl}/cms/digital-article/slug:${slug}`, {
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
site: '1' || 1,
|
site: getSite(query.site).toString(),
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
return { item }
|
return { item }
|
||||||
@@ -93,17 +95,17 @@ export const getArticleBySlug = async (event : any) => {
|
|||||||
export const listArticleCondition = async (event: H3Event) => {
|
export const listArticleCondition = async (event: H3Event) => {
|
||||||
try {
|
try {
|
||||||
const payload = await readBody<any>(event)
|
const payload = await readBody<any>(event)
|
||||||
const { apiUrl } = useRuntimeConfig().public
|
const { apiUrl } = useRuntimeConfig().public;
|
||||||
|
const query = getQuery(event)
|
||||||
const { items }: any = await $fetch(`${apiUrl}/cms/article/condition`, {
|
const { items }: any = await $fetch(`${apiUrl}/cms/article/condition`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
site: '1' || 1,
|
site: getSite(query.site).toString(),
|
||||||
}),
|
}),
|
||||||
body: {
|
body: {
|
||||||
payload
|
payload
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// log(event)
|
|
||||||
|
|
||||||
return items
|
return items
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -17,12 +17,13 @@ export type Author = {
|
|||||||
export const fetchByCode = async (event: H3Event) => {
|
export const fetchByCode = async (event: H3Event) => {
|
||||||
try {
|
try {
|
||||||
const { apiUrl } = useRuntimeConfig().public
|
const { apiUrl } = useRuntimeConfig().public
|
||||||
const { authorCode }: any = getQuery(event)
|
const { authorCode }: any = getQuery(event);
|
||||||
|
const query = getQuery(event)
|
||||||
const { items }: any = await $fetch(`${apiUrl}/cms/author/code:${authorCode}`, {
|
const { items }: any = await $fetch(`${apiUrl}/cms/author/code:${authorCode}`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: new Headers({
|
||||||
site: 1
|
site: getSite(query.site).toString(),
|
||||||
}
|
}),
|
||||||
})
|
})
|
||||||
return items[0]
|
return items[0]
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -28,15 +28,16 @@ export type CategoryTree = Category & {
|
|||||||
children?: Category[]
|
children?: Category[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export const list = async () => {
|
export const list = async (event : H3Event) => {
|
||||||
try {
|
try {
|
||||||
const { site, apiUrl } = useRuntimeConfig().public;
|
const { site, apiUrl } = useRuntimeConfig().public;
|
||||||
|
const query = getQuery(event)
|
||||||
const { items }: CategoryTree[] | any = await $fetch(`${apiUrl}/cms/category/tree/site:1`, {
|
const siteId = getSite(query.site).toString()
|
||||||
|
const { items }: CategoryTree[] | any = await $fetch(`${apiUrl}/cms/category/tree/site:${siteId}`, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: {
|
headers: new Headers({
|
||||||
site: 1,
|
site: siteId,
|
||||||
},
|
}),
|
||||||
});
|
});
|
||||||
return { items } ;
|
return { items } ;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -101,11 +101,13 @@ export const getDynamicPageByCode = async (event: any) => {
|
|||||||
try {
|
try {
|
||||||
const { apiUrl } = useRuntimeConfig().public
|
const { apiUrl } = useRuntimeConfig().public
|
||||||
const slug = event.context.params.slug;
|
const slug = event.context.params.slug;
|
||||||
|
const query = getQuery(event)
|
||||||
const { item }: any = await $fetch(`${apiUrl}/cms/page/overview-page/slug:${slug}`, {
|
const { item }: any = await $fetch(`${apiUrl}/cms/page/overview-page/slug:${slug}`, {
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
site: '1' || 1,
|
site: getSite(query.site).toString(),
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
console.log(getSite(query.site))
|
||||||
return item
|
return item
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error);
|
handleError(error);
|
||||||
@@ -116,7 +118,12 @@ export const getDynamicPageById = async (event: any) => {
|
|||||||
try {
|
try {
|
||||||
const { apiUrl } = useRuntimeConfig().public
|
const { apiUrl } = useRuntimeConfig().public
|
||||||
const id = event.context.params.id;
|
const id = event.context.params.id;
|
||||||
const { item }: any = await $fetch(`${apiUrl}/cms/overview-page/${id}`)
|
const query = getQuery(event)
|
||||||
|
const { item }: any = await $fetch(`${apiUrl}/cms/overview-page/${id}`, {
|
||||||
|
headers: new Headers({
|
||||||
|
site: getSite(query.site).toString(),
|
||||||
|
}),
|
||||||
|
})
|
||||||
return item
|
return item
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error);
|
handleError(error);
|
||||||
@@ -126,10 +133,12 @@ export async function getOverviewPageComponentById(event: any) {
|
|||||||
try {
|
try {
|
||||||
const { apiUrl } = useRuntimeConfig().public
|
const { apiUrl } = useRuntimeConfig().public
|
||||||
const { componentId, dataQuery } = getQuery(event)
|
const { componentId, dataQuery } = getQuery(event)
|
||||||
|
const query = getQuery(event)
|
||||||
return await $fetch(`${apiUrl}/cms/overview-page-component/${componentId}`, {
|
return await $fetch(`${apiUrl}/cms/overview-page-component/${componentId}`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
site: getSite(query.site).toString(),
|
||||||
},
|
},
|
||||||
body: dataQuery,
|
body: dataQuery,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,11 +21,12 @@ export const fetchByCode = async(event: H3Event) => {
|
|||||||
try {
|
try {
|
||||||
const { apiUrl } = useRuntimeConfig().public
|
const { apiUrl } = useRuntimeConfig().public
|
||||||
const { eventCode }: any = getQuery(event)
|
const { eventCode }: any = getQuery(event)
|
||||||
|
const query = getQuery(event)
|
||||||
const { item }: any = await $fetch(`${apiUrl}/cms/event/code:${eventCode}`, {
|
const { item }: any = await $fetch(`${apiUrl}/cms/event/code:${eventCode}`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: new Headers({
|
||||||
Site: 1
|
site: getSite(query.site).toString(),
|
||||||
}
|
}),
|
||||||
})
|
})
|
||||||
return item
|
return item
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -37,11 +38,12 @@ export const fetchById = async(event: H3Event) => {
|
|||||||
try {
|
try {
|
||||||
const { apiUrl } = useRuntimeConfig().public
|
const { apiUrl } = useRuntimeConfig().public
|
||||||
const { eventId }: any = getQuery(event)
|
const { eventId }: any = getQuery(event)
|
||||||
|
const query = getQuery(event);
|
||||||
const { item }: any = await $fetch(`${apiUrl}/cms/event/${eventId}`, {
|
const { item }: any = await $fetch(`${apiUrl}/cms/event/${eventId}`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: new Headers({
|
||||||
Site: 1
|
site: getSite(query.site).toString(),
|
||||||
}
|
}),
|
||||||
})
|
})
|
||||||
return item
|
return item
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { H3Event } from 'h3';
|
import { H3Event } from 'h3';
|
||||||
import Base from './base'
|
import Base from './base'
|
||||||
|
import { useCookie } from 'nuxt/app';
|
||||||
|
|
||||||
export type PollOption = {
|
export type PollOption = {
|
||||||
id?: number; // Mã định danh
|
id?: number; // Mã định danh
|
||||||
@@ -19,11 +20,12 @@ export type PollOption = {
|
|||||||
|
|
||||||
const { apiUrl } = useRuntimeConfig().public
|
const { apiUrl } = useRuntimeConfig().public
|
||||||
const { pollId }: any = getQuery(event)
|
const { pollId }: any = getQuery(event)
|
||||||
|
const query = getQuery(event)
|
||||||
const { items }: PollOption[] | any = await $fetch(`${apiUrl}/cms/poll-option/poll:${pollId}`, {
|
const { items }: PollOption[] | any = await $fetch(`${apiUrl}/cms/poll-option/poll:${pollId}`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
site: 1
|
site: getSite(query.site).toString()
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
return items
|
return items
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { H3Event } from 'h3';
|
import { H3Event } from 'h3';
|
||||||
import Base from './base'
|
import Base from './base'
|
||||||
|
import { useCookie } from 'nuxt/app';
|
||||||
|
|
||||||
export type PollResponse = {
|
export type PollResponse = {
|
||||||
id?: number; // Mã định danh
|
id?: number; // Mã định danh
|
||||||
@@ -15,10 +16,11 @@ export const create = async (event: H3Event) => {
|
|||||||
try {
|
try {
|
||||||
const { apiUrl } = useRuntimeConfig().public
|
const { apiUrl } = useRuntimeConfig().public
|
||||||
const payload = await readBody<any>(event)
|
const payload = await readBody<any>(event)
|
||||||
|
const query = getQuery(event)
|
||||||
const { item }: any = await $fetch(`${apiUrl}/cms/poll-response`, {
|
const { item }: any = await $fetch(`${apiUrl}/cms/poll-response`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
site: 1
|
site: getSite(query.site).toString()
|
||||||
},
|
},
|
||||||
body: payload
|
body: payload
|
||||||
})
|
})
|
||||||
@@ -32,14 +34,14 @@ export const create = async (event: H3Event) => {
|
|||||||
|
|
||||||
export const fetchByPollId = async (event: H3Event) => {
|
export const fetchByPollId = async (event: H3Event) => {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
const { apiUrl } = useRuntimeConfig().public
|
const { apiUrl } = useRuntimeConfig().public
|
||||||
const { pollId }: any = getQuery(event)
|
const { pollId }: any = getQuery(event)
|
||||||
|
const query = getQuery(event)
|
||||||
const { items }: PollResponse[] | any = await $fetch(`${apiUrl}/cms/poll-response/poll:${pollId}`, {
|
const { items }: PollResponse[] | any = await $fetch(`${apiUrl}/cms/poll-response/poll:${pollId}`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
site: 1
|
site: getSite(query.site).toString()
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
return items
|
return items
|
||||||
|
|||||||
@@ -32,10 +32,11 @@ export type Poll = {
|
|||||||
try {
|
try {
|
||||||
const { apiUrl } = useRuntimeConfig().public
|
const { apiUrl } = useRuntimeConfig().public
|
||||||
const { pollId}: any = getQuery(event)
|
const { pollId}: any = getQuery(event)
|
||||||
|
const query = getQuery(event)
|
||||||
const { item }: Poll | any = await $fetch(`${apiUrl}/cms/poll/${pollId}`, {
|
const { item }: Poll | any = await $fetch(`${apiUrl}/cms/poll/${pollId}`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
site: 1
|
site: getSite(query.site).toString()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -31,10 +31,11 @@ export type Quiz = {
|
|||||||
|
|
||||||
const { apiUrl } = useRuntimeConfig().public
|
const { apiUrl } = useRuntimeConfig().public
|
||||||
const { quizId }: any = getQuery(event)
|
const { quizId }: any = getQuery(event)
|
||||||
|
const query = getQuery(event)
|
||||||
const { item }: Quiz | any = await $fetch(`${apiUrl}/cms/quiz/${quizId}`, {
|
const { item }: Quiz | any = await $fetch(`${apiUrl}/cms/quiz/${quizId}`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
site: 1
|
site: getSite(query.site).toString()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -31,10 +31,11 @@ export type Survey = {
|
|||||||
|
|
||||||
const { apiUrl } = useRuntimeConfig().public
|
const { apiUrl } = useRuntimeConfig().public
|
||||||
const { surveyId }: any = getQuery(event)
|
const { surveyId }: any = getQuery(event)
|
||||||
|
const query = getQuery(event)
|
||||||
const { item }: Survey | any = await $fetch(`${apiUrl}/cms/survey/${surveyId}`, {
|
const { item }: Survey | any = await $fetch(`${apiUrl}/cms/survey/${surveyId}`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
site: 1
|
site: getSite(query.site).toString()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ export const get = async(event: H3Event) => {
|
|||||||
try {
|
try {
|
||||||
const { apiUrl } = useRuntimeConfig().public
|
const { apiUrl } = useRuntimeConfig().public
|
||||||
const { code } = getQuery(event)
|
const { code } = getQuery(event)
|
||||||
|
const query = getQuery(event)
|
||||||
const { items }: any = await $fetch(`${apiUrl}/cms/tag/code:${code}`, {
|
const { items }: any = await $fetch(`${apiUrl}/cms/tag/code:${code}`, {
|
||||||
headers: {
|
headers: {
|
||||||
site: 1
|
site: getSite(query.site).toString()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return items
|
return items
|
||||||
@@ -23,10 +23,11 @@ export const fetchById = async(event: H3Event) => {
|
|||||||
try {
|
try {
|
||||||
const { apiUrl } = useRuntimeConfig().public
|
const { apiUrl } = useRuntimeConfig().public
|
||||||
const { tagId }: any = getQuery(event)
|
const { tagId }: any = getQuery(event)
|
||||||
|
const query = getQuery(event)
|
||||||
const { item }: any = await $fetch(`${apiUrl}/cms/tag/${tagId}`, {
|
const { item }: any = await $fetch(`${apiUrl}/cms/tag/${tagId}`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
Site: 1
|
Site: getSite(query.site).toString()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return item
|
return item
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ export const listPaging = async (event: H3Event) => {
|
|||||||
if(categoryId) {
|
if(categoryId) {
|
||||||
query.value = { categoryId }
|
query.value = { categoryId }
|
||||||
}
|
}
|
||||||
|
const gQuery = getQuery(event)
|
||||||
const { items, total }: any = await $fetch(`${apiUrl}/cms/topic/condition/paging:${page}-${limit}/sorting:${sort}`,{
|
const { items, total }: any = await $fetch(`${apiUrl}/cms/topic/condition/paging:${page}-${limit}/sorting:${sort}`,{
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {site: 1},
|
headers: {site: getSite(gQuery.site).toString()},
|
||||||
body:{ ...query.value }
|
body:{ ...query.value }
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -29,10 +29,11 @@ export const fetchByCode = async(event: H3Event) => {
|
|||||||
try {
|
try {
|
||||||
const { apiUrl } = useRuntimeConfig().public
|
const { apiUrl } = useRuntimeConfig().public
|
||||||
const { topicCode }: any = getQuery(event)
|
const { topicCode }: any = getQuery(event)
|
||||||
|
const query = getQuery(event)
|
||||||
const { item }: any = await $fetch(`${apiUrl}/cms/topic/code:${topicCode}`, {
|
const { item }: any = await $fetch(`${apiUrl}/cms/topic/code:${topicCode}`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
site: 1
|
site: getSite(query.site).toString()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -46,10 +47,11 @@ export const fetchById = async(event: H3Event) => {
|
|||||||
try {
|
try {
|
||||||
const { apiUrl } = useRuntimeConfig().public
|
const { apiUrl } = useRuntimeConfig().public
|
||||||
const { topicId }: any = getQuery(event)
|
const { topicId }: any = getQuery(event)
|
||||||
|
const query = getQuery(event)
|
||||||
const { item }: any = await $fetch(`${apiUrl}/cms/topic/${topicId}`, {
|
const { item }: any = await $fetch(`${apiUrl}/cms/topic/${topicId}`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
site: 1
|
site: getSite(query.site).toString()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
export const getSite = (dns : any) => {
|
||||||
|
const SITE = {
|
||||||
|
DEFAULT: 1,
|
||||||
|
PORTAL2: 'portal2',
|
||||||
|
}
|
||||||
|
|
||||||
|
let site = null;
|
||||||
|
switch (dns) {
|
||||||
|
case SITE.PORTAL2:
|
||||||
|
site = 2;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
site = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return site;
|
||||||
|
}
|
||||||
+17
-3
@@ -5,9 +5,16 @@ export const useArticleStore = defineStore("article", () => {
|
|||||||
const currentArticle = ref<any>({});
|
const currentArticle = ref<any>({});
|
||||||
const currentArticles = ref<any[]>([])
|
const currentArticles = ref<any[]>([])
|
||||||
|
|
||||||
|
const url : any = useRequestURL();
|
||||||
|
const host = url.hostname.split('.')[0];
|
||||||
|
|
||||||
const getArticleById = async (id: string | number) => {
|
const getArticleById = async (id: string | number) => {
|
||||||
try {
|
try {
|
||||||
const { data } = await useFetch(`/api/articles/get-by-id/${id}`)
|
const { data } = await useFetch(`/api/articles/get-by-id/${id}`, {
|
||||||
|
query: {
|
||||||
|
site: host
|
||||||
|
}
|
||||||
|
})
|
||||||
currentArticle.value = {}
|
currentArticle.value = {}
|
||||||
currentArticle.value = data.value.item
|
currentArticle.value = data.value.item
|
||||||
} catch (error: any) { }
|
} catch (error: any) { }
|
||||||
@@ -15,7 +22,11 @@ export const useArticleStore = defineStore("article", () => {
|
|||||||
|
|
||||||
const getArticleBySlug = async (slug: string) => {
|
const getArticleBySlug = async (slug: string) => {
|
||||||
try {
|
try {
|
||||||
const article = await $fetch(`/api/articles/get-by-slug/${slug}`)
|
const article = await $fetch(`/api/articles/get-by-slug/${slug}`, {
|
||||||
|
query: {
|
||||||
|
site: host
|
||||||
|
}
|
||||||
|
})
|
||||||
currentArticle.value = {}
|
currentArticle.value = {}
|
||||||
currentArticle.value = article?.item
|
currentArticle.value = article?.item
|
||||||
|
|
||||||
@@ -27,7 +38,10 @@ export const useArticleStore = defineStore("article", () => {
|
|||||||
try {
|
try {
|
||||||
const { data: articles } = await useFetch(`/api/articles/condition`, {
|
const { data: articles } = await useFetch(`/api/articles/condition`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: condition
|
body: condition,
|
||||||
|
query: {
|
||||||
|
site: host
|
||||||
|
}
|
||||||
})
|
})
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
|
|
||||||
|
|||||||
+7
-2
@@ -83,9 +83,14 @@ import type { Category, CategoryTree } from "~/server/models/category";
|
|||||||
export const useCategoryStore = defineStore('usecategorystore', () => {
|
export const useCategoryStore = defineStore('usecategorystore', () => {
|
||||||
const categoryTree = shallowRef<CategoryTree[]>([])
|
const categoryTree = shallowRef<CategoryTree[]>([])
|
||||||
const currentCategoryTree = shallowRef<any[]>([])
|
const currentCategoryTree = shallowRef<any[]>([])
|
||||||
|
const url : any = useRequestURL();
|
||||||
|
const host = url.hostname.split('.')[0];
|
||||||
async function fetchBySiteId() {
|
async function fetchBySiteId() {
|
||||||
const { data }: any = await useFetch(`/api/services/category-tree`)
|
const { data }: any = await useFetch(`/api/services/category-tree`,{
|
||||||
|
query: {
|
||||||
|
site: host
|
||||||
|
}
|
||||||
|
})
|
||||||
categoryTree.value = data.value.items
|
categoryTree.value = data.value.items
|
||||||
return categoryTree.value
|
return categoryTree.value
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-2
@@ -1,10 +1,14 @@
|
|||||||
import { defineStore, acceptHMRUpdate } from "pinia";
|
import { defineStore, acceptHMRUpdate } from "pinia";
|
||||||
import { useLocalStorage } from "@vueuse/core";
|
import { useLocalStorage } from "@vueuse/core";
|
||||||
|
|
||||||
export const useDynamicPageStore = defineStore("dynamicPageStore", () => {
|
export const useDynamicPageStore = defineStore("dynamicPageStore", () => {
|
||||||
const currentPage = ref<any>({});
|
const currentPage = ref<any>({});
|
||||||
const sectionPublished = ref<any[]>([]);
|
const sectionPublished = ref<any[]>([]);
|
||||||
const componentPublished = ref<any[]>([]);
|
const componentPublished = ref<any[]>([]);
|
||||||
|
|
||||||
|
const url : any = useRequestURL();
|
||||||
|
const host = url.hostname.split('.')[0];
|
||||||
|
|
||||||
const setSectionPublished = () => {
|
const setSectionPublished = () => {
|
||||||
const exsitsTemplate = ['None']
|
const exsitsTemplate = ['None']
|
||||||
const contentArr: any = [];
|
const contentArr: any = [];
|
||||||
@@ -45,7 +49,11 @@ export const useDynamicPageStore = defineStore("dynamicPageStore", () => {
|
|||||||
|
|
||||||
async function fetchPageByCode(slug: any) {
|
async function fetchPageByCode(slug: any) {
|
||||||
try {
|
try {
|
||||||
const page = await $fetch(`/api/dynamic-page/get-by-code/${slug}`)
|
const page = await $fetch(`/api/dynamic-page/get-by-code/${slug}`, {
|
||||||
|
query: {
|
||||||
|
site: host
|
||||||
|
}
|
||||||
|
})
|
||||||
currentPage.value = {}
|
currentPage.value = {}
|
||||||
currentPage.value = page
|
currentPage.value = page
|
||||||
|
|
||||||
@@ -60,7 +68,7 @@ export const useDynamicPageStore = defineStore("dynamicPageStore", () => {
|
|||||||
} catch (error: any) {}
|
} catch (error: any) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getOverviewPageComponentById(componentId, dataQuery) {
|
async function getOverviewPageComponentById(componentId: any, dataQuery: any) {
|
||||||
try {
|
try {
|
||||||
const { apiUrl } = useRuntimeConfig().public
|
const { apiUrl } = useRuntimeConfig().public
|
||||||
const res = await $fetch(`${apiUrl}/cms/page-component/overview-page-component/${componentId}`, {
|
const res = await $fetch(`${apiUrl}/cms/page-component/overview-page-component/${componentId}`, {
|
||||||
|
|||||||
@@ -2,11 +2,14 @@ import type { PollOption } from "~/server/models/poll-option"
|
|||||||
export const usePollOptionStore = defineStore('usePollOptionStore', () => {
|
export const usePollOptionStore = defineStore('usePollOptionStore', () => {
|
||||||
const currentPollOption = shallowReactive<PollOption>({})
|
const currentPollOption = shallowReactive<PollOption>({})
|
||||||
const currentPollOptions = shallowRef<PollOption[] | any[]>([])
|
const currentPollOptions = shallowRef<PollOption[] | any[]>([])
|
||||||
|
const url : any = useRequestURL();
|
||||||
|
const host = url.hostname.split('.')[0];
|
||||||
async function fetchByPollId(id: string) {
|
async function fetchByPollId(id: string) {
|
||||||
try {
|
try {
|
||||||
const { data } = await useFetch<any>(`/api/services/poll-option/pollId`, {
|
const { data } = await useFetch<any>(`/api/services/poll-option/pollId`, {
|
||||||
query: {
|
query: {
|
||||||
pollId: id
|
pollId: id,
|
||||||
|
site: host
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,15 @@ import type { PollResponse } from "~/server/models/poll-response"
|
|||||||
export const usePollResponseStore = defineStore('usePollResponseStore', () => {
|
export const usePollResponseStore = defineStore('usePollResponseStore', () => {
|
||||||
const currentPollResponse = shallowReactive<PollResponse>({})
|
const currentPollResponse = shallowReactive<PollResponse>({})
|
||||||
const currentPollResponses = shallowRef<PollResponse[]>([])
|
const currentPollResponses = shallowRef<PollResponse[]>([])
|
||||||
|
const url : any = useRequestURL();
|
||||||
|
const host = url.hostname.split('.')[0];
|
||||||
const create = async (pollResponse: any) => {
|
const create = async (pollResponse: any) => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { data } = await useFetch<any>(`/api/services/poll-response`, {
|
const { data } = await useFetch<any>(`/api/services/poll-response`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: pollResponse
|
body: pollResponse,
|
||||||
|
query: {site: host}
|
||||||
})
|
})
|
||||||
data.value && (Object.assign(currentPollResponse, data.value))
|
data.value && (Object.assign(currentPollResponse, data.value))
|
||||||
return currentPollResponse
|
return currentPollResponse
|
||||||
@@ -21,7 +24,8 @@ export const usePollResponseStore = defineStore('usePollResponseStore', () => {
|
|||||||
try {
|
try {
|
||||||
const { data } = await useFetch<any>(`/api/services/poll-response/pollId`, {
|
const { data } = await useFetch<any>(`/api/services/poll-response/pollId`, {
|
||||||
query: {
|
query: {
|
||||||
pollId: id
|
pollId: id,
|
||||||
|
site: host
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
+7
-11
@@ -1,12 +1,17 @@
|
|||||||
import type { Poll } from "~/server/models/poll"
|
import type { Poll } from "~/server/models/poll"
|
||||||
export const usePollStore = defineStore('usePollStore', () => {
|
export const usePollStore = defineStore('usePollStore', () => {
|
||||||
const currentPoll = shallowReactive<Poll>({})
|
const currentPoll = shallowReactive<Poll>({})
|
||||||
|
|
||||||
|
const url : any = useRequestURL();
|
||||||
|
const host = url.hostname.split('.')[0];
|
||||||
|
|
||||||
async function fetchById(id: string) {
|
async function fetchById(id: string) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { data } = await useFetch<any>(`/api/services/poll-by-id`, {
|
const { data } = await useFetch<any>(`/api/services/poll-by-id`, {
|
||||||
query: {
|
query: {
|
||||||
pollId: id
|
pollId: id,
|
||||||
|
site: host
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -16,16 +21,7 @@ export const usePollStore = defineStore('usePollStore', () => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return { fetchById, currentPoll }
|
||||||
async function categoryId() {
|
|
||||||
try {
|
|
||||||
const { data } = await useFetch(`/api/services/category-tree`)
|
|
||||||
return data.value
|
|
||||||
} catch (error) {}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return { fetchById, currentPoll, categoryId }
|
|
||||||
})
|
})
|
||||||
|
|
||||||
if(import.meta.hot) {
|
if(import.meta.hot) {
|
||||||
|
|||||||
Reference in New Issue
Block a user