thainv-dev:

This commit is contained in:
nguyen van thai
2024-07-01 16:04:16 +07:00
parent a01eedc2bc
commit 35f069a776
21 changed files with 79 additions and 64 deletions
@@ -2,7 +2,7 @@
import RecusiveSection from "@/components/dynamic-page/page-section/RecusiveSection.vue";
import { getInputValue } from "@/utils/parseSQL";
import { enumPageSectionLayouts, enumPageSectionTemplate, enumPageSectionKey } from "~/definitions/enum";
import type { PageSection } from "@/models/cms";
import type { PageSection } from "@/server/models/dynamic-page/index";
const props = defineProps<{
layout?: string;
@@ -19,11 +19,22 @@ const defineTypeRecusive = {
const SETTING_OPTIONS = computed(() => {
let _setting_options = {};
switch (props.layout) {
case enumPageSectionLayouts[enumPageSectionTemplate[enumPageSectionKey.NONE]['NONE']]['VERTICAL_TWO']:
_setting_options = {
MAX_ELEMENT: 2,
};
break;
case enumPageSectionLayouts[enumPageSectionTemplate[enumPageSectionKey.NONE]["NONE"]]["VERTICAL_ONE_TWO_THREE"]:
_setting_options = {
MAX_ELEMENT: 3,
};
break;
case enumPageSectionLayouts[enumPageSectionTemplate[enumPageSectionKey.NONE]["NONE"]]["VERTICAL_ONE_FIVE"]:
_setting_options = {
MAX_ELEMENT: 2,
};
break;
case enumPageSectionLayouts[enumPageSectionTemplate[enumPageSectionKey.NONE]['NONE']]['VERTICAL_LEFT_TWO']:
_setting_options = {
MAX_ELEMENT: 2,
@@ -130,6 +141,19 @@ const CLASS_FOR_SECTION = computed(() => {
section_layout: "section_layout two_col_layout",
};
break;
case enumPageSectionLayouts[enumPageSectionTemplate[enumPageSectionKey.NONE]["NONE"]]["VERTICAL_ONE_FIVE"]:
_classForSection = {
section_layout: "section_layout six_col_layout",
1: "col-span-5",
};
break;
case enumPageSectionLayouts[enumPageSectionTemplate[enumPageSectionKey.NONE]["NONE"]]["VERTICAL_ONE_TWO_THREE"]:
_classForSection = {
section_layout: "section_layout six_col_layout",
1: "col-span-2",
2: "col-span-3",
};
break;
case enumPageSectionLayouts[enumPageSectionTemplate[enumPageSectionKey.NONE]['NONE']]['VERTICAL_LEFT_TWO']:
_classForSection = {
section_layout: "section_layout three_col_layout",