Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 229155b24a | |||
| 3b613faccf | |||
| f9c2d748d5 |
@@ -27,7 +27,6 @@ const findDataPosition = computed(() => {
|
||||
result = currentPage.value.components && currentPage.value.components.find((component: any) => {
|
||||
return component.settings?.template === enumPageComponentTemplates.NAVIGATION && component.settings?.layout === defineTypeRecusive.TOP_NAVIGATION
|
||||
});
|
||||
console.log(result)
|
||||
break;
|
||||
case defineTypeRecusive.BOTTOM_NAVIGATION:
|
||||
result = currentPage.value.components && currentPage.value.components.find((component: any) => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { isEmpty } from "lodash";
|
||||
import isEmpty from "lodash/isEmpty";
|
||||
import { COLLECTION_QUERY_DROP, getValueStringWithKeyAndColon, getInputValue } from "@/utils/parseSQL";
|
||||
|
||||
const emit = defineEmits(["dropData", "selectComponent"]);
|
||||
|
||||
@@ -1,35 +1,48 @@
|
||||
<script setup lang="ts">
|
||||
// import { isEmpty } from "lodash";
|
||||
// import DynamicComponent from "~/components/cms/page-component/templates/index.vue";
|
||||
// import { getInputValue } from "@/utils/cms/page/parseSQL";
|
||||
import { buildTree } from "@/utils/recusive";
|
||||
|
||||
// const emit = defineEmits(["selectComponent"]);
|
||||
const _props = defineProps<{
|
||||
content?: any;
|
||||
component?: any;
|
||||
}>();
|
||||
|
||||
// const _props = defineProps<{
|
||||
// dataResult?: any[];
|
||||
// dataQuery?: string;
|
||||
// component?: any;
|
||||
// }>();
|
||||
|
||||
// const SETTING_OPTIONS = {
|
||||
// MAX_ELEMENT: 10,
|
||||
// };
|
||||
const SETTING_OPTIONS = {
|
||||
MAX_ELEMENT: 4,
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
lay outa
|
||||
<!-- <section>
|
||||
<div v-for="navItem, index in Array(SETTING_OPTIONS.MAX_ELEMENT).fill({})" :key="index">
|
||||
<div class="empty"></div>
|
||||
<div class="mt-4">
|
||||
<div class="gap-5 grid" :style="`grid-template-columns: repeat(${SETTING_OPTIONS.MAX_ELEMENT}, minmax(0, 1fr));`">
|
||||
<template v-if="_props.content">
|
||||
<div v-for="item, index in buildTree(_props.content)" :key="index">
|
||||
<div class="submenu-container">
|
||||
<h4 class="mb-0" @click="selectNavigationComponent">{{ item.title }}</h4>
|
||||
<h4
|
||||
v-for="_item, _index in item.childs ? item.childs : []"
|
||||
:key="_index"
|
||||
class="mb-0"
|
||||
@click="selectNavigationComponent"
|
||||
>
|
||||
{{ _item.title }}
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</section> -->
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.empty {
|
||||
width: 120px;
|
||||
min-height: 100px;
|
||||
border-radius: 6px;
|
||||
background: #409eff;
|
||||
.submenu-container {
|
||||
display: grid;
|
||||
gap: 20px;
|
||||
grid-template-columns: repeat(1, minmax(0, 1fr));
|
||||
h4 {
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { isEmpty } from "lodash";
|
||||
import isEmpty from "lodash/isEmpty";
|
||||
// import DynamicComponent from "~/components/cms/page-component/templates/index.vue";
|
||||
// import { getInputValue } from "@/utils/cms/page/parseSQL";
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { buildTree } from "@/utils/recusive";
|
||||
import RecusiveNavItem from "@/components/dynamic-page/page-component/templates/navigations/components/RecusiveNavItem.vue";
|
||||
|
||||
const _props = defineProps<{
|
||||
content?: any[];
|
||||
content?: any;
|
||||
component?: any;
|
||||
}>();
|
||||
</script>
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import AssignComponent from "~/components/dynamic-page/page-component/AssignComponent.vue";
|
||||
import { enumPageComponentTemplates, enumPageComponentLayouts } from "@/definitions/enum";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<footer class="border-t bg-white mt-6">
|
||||
<div id="footer-desktop" class="px-4 mx-auto max-w-7xl 2xl:px-0 pt-4">
|
||||
<div class="grid gap-4 font-semibold md:grid-cols-12 text-sm mb-2">
|
||||
<div class="col-span-8">
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-4">
|
||||
</div>
|
||||
<AssignComponent :type="enumPageComponentLayouts[enumPageComponentTemplates.NAVIGATION]['NAVIGATION-BOTTOM']" />
|
||||
</div>
|
||||
<div class="col-span-4 grid gap-4 sm:border-l sm:pl-4 auto-rows-max">
|
||||
<div>
|
||||
|
||||
@@ -171,8 +171,8 @@ export const pageComponentLayouts = {
|
||||
],
|
||||
[`${enumPageComponentTemplates.NAVIGATION}`]: [
|
||||
{ title: "Thanh điều hướng ở đầu trang", value: enumPageComponentLayouts[enumPageComponentTemplates.NAVIGATION]['NAVIGATION-TOP'] },
|
||||
{ title: "Tab điều hướng trong các phân vùng", value: enumPageComponentLayouts[enumPageComponentTemplates.NAVIGATION]['NAVIGATION-BOTTOM'] },
|
||||
{ title: "Bộ điều hướng ở chân trang", value: enumPageComponentLayouts[enumPageComponentTemplates.NAVIGATION]['NAVIGATION-DIRECTION'] },
|
||||
{ title: "Tab điều hướng trong các phân vùng", value: enumPageComponentLayouts[enumPageComponentTemplates.NAVIGATION]['NAVIGATION-DIRECTION'] },
|
||||
{ title: "Bộ điều hướng ở chân trang", value: enumPageComponentLayouts[enumPageComponentTemplates.NAVIGATION]['NAVIGATION-BOTTOM'] },
|
||||
],
|
||||
[`${enumPageComponentTemplates.COLLECTION}`]: [
|
||||
{ title: "Cụm Bài viết 5 phần tử, Bài viết ngang", value: enumPageComponentLayouts[enumPageComponentTemplates.COLLECTION]['ARTICLE-VERTICAL-|HORIZONTAL|-MAX_5'] },
|
||||
|
||||
@@ -871,7 +871,6 @@ export const useDynamicPageStore = defineStore("dynamicPageStore", () => {
|
||||
// "updatedOn": "2024-05-30T16:18:55.254121"
|
||||
// })
|
||||
currentPage.value = {}
|
||||
console.log(currentPage.value, data.value, 'dynamic page')
|
||||
currentPage.value = data.value
|
||||
} catch (error: any) {}
|
||||
}
|
||||
@@ -885,6 +884,7 @@ export const useDynamicPageStore = defineStore("dynamicPageStore", () => {
|
||||
}
|
||||
|
||||
const setSectionPublished = () => {
|
||||
const exsitsTemplate = ['None']
|
||||
const contentArr: any = [];
|
||||
currentPage.value.sections && currentPage.value.sections.map((section: any) => {
|
||||
contentArr.push(section.content && typeof section.content === 'string' && JSON.parse(section.content));
|
||||
@@ -893,11 +893,8 @@ export const useDynamicPageStore = defineStore("dynamicPageStore", () => {
|
||||
|
||||
|
||||
sectionPublished.value = currentPage.value.sections && currentPage.value.sections.filter(
|
||||
(section: any) => section.isPublished && !contentArr.flat().some((_section: any) => _section && _section.data && _section.type === "section" && section.id === _section.data)
|
||||
(section: any) => exsitsTemplate.includes(section.settings?.template) && section.isPublished && !contentArr.flat().some((_section: any) => _section && _section.data && _section.type === "section" && section.id === _section.data)
|
||||
).sort((a: any, b: any) => a.order - b.order);
|
||||
|
||||
console.log(sectionPublished.value, 'sections');
|
||||
|
||||
};
|
||||
|
||||
const setComponentPublished = () => {
|
||||
@@ -908,7 +905,6 @@ export const useDynamicPageStore = defineStore("dynamicPageStore", () => {
|
||||
return section;
|
||||
});
|
||||
componentPublished.value = currentPage.value.components && currentPage.value.components.filter((section: any) => section.isPublished);
|
||||
console.log(currentPage.value.components ,'components 2')
|
||||
};
|
||||
|
||||
const setDataQuery = (query: any, componentId: number | string) => {
|
||||
|
||||
Reference in New Issue
Block a user