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
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import type { PageSection } from "@/models/cms";
import type { PageSection } from "@/server/models/dynamic-page/index";
import { enumPageSectionLayouts, enumPageSectionTemplate, enumPageSectionKey } from "@/definitions/enum";
import { NONE_DEFAULT_LAYOUT } from "./index";
@@ -13,6 +13,8 @@ const _props = defineProps<{
const definedDynamicSection: Record<string, any> = {
[enumPageSectionLayouts[enumPageSectionTemplate[enumPageSectionKey.NONE]['NONE']]['VERTICAL_TWO']]: NONE_DEFAULT_LAYOUT,
[enumPageSectionLayouts[enumPageSectionTemplate[enumPageSectionKey.NONE]['NONE']]['VERTICAL_LEFT_TWO']]: NONE_DEFAULT_LAYOUT,
[enumPageSectionLayouts[enumPageSectionTemplate[enumPageSectionKey.NONE]["NONE"]]["VERTICAL_ONE_TWO_THREE"]]: NONE_DEFAULT_LAYOUT,
[enumPageSectionLayouts[enumPageSectionTemplate[enumPageSectionKey.NONE]["NONE"]]["VERTICAL_ONE_FIVE"]]: NONE_DEFAULT_LAYOUT,
[enumPageSectionLayouts[enumPageSectionTemplate[enumPageSectionKey.NONE]['NONE']]['VERTICAL_RIGHT_TWO']]: NONE_DEFAULT_LAYOUT,
[enumPageSectionLayouts[enumPageSectionTemplate[enumPageSectionKey.NONE]['NONE']]['VERTICAL_THREE']]: NONE_DEFAULT_LAYOUT,
[enumPageSectionLayouts[enumPageSectionTemplate[enumPageSectionKey.NONE]['NONE']]['VERTICAL_FOUR']]: NONE_DEFAULT_LAYOUT,
@@ -34,7 +36,6 @@ const definedDynamicSection: Record<string, any> = {
const getCurrentSection = computed(() => {
return _props.settings.layout
});
const GET_PROPS = computed(() => {
return () => {
let props: any = {};
@@ -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",
@@ -1,6 +1,6 @@
<script setup lang="ts">
import DynamicLayout from '@/components/dynamic-page/page-section/layouts/index.vue';
import type { PageSection } from "@/models/cms";
import type { PageSection } from "@/server/models/dynamic-page/index";
const props = defineProps<{
label?: any
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { Article_Section_Default } from "./index";
import type { PageSection } from "@/models/cms";
import type { PageSection } from "@/server/models/dynamic-page/index";
import { enumPageSectionKey, enumPageSectionTemplate } from "@/definitions/enum";
const _props = defineProps<{
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import type { PageSection } from "@/models/cms";
import type { PageSection } from "@/server/models/dynamic-page/index";
import { enumPageSectionKey } from "@/definitions/enum";
import { None_Section } from "./index";
@@ -1,6 +1,6 @@
<script setup lang="ts">
import DynamicLayout from "@/components/dynamic-page/page-section/layouts/index.vue";
import type { PageSection } from "@/models/cms";
import type { PageSection } from "@/server/models/dynamic-page/index";
const props = defineProps<{
label?: any;
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import type { PageSection } from "@/models/cms";
import type { PageSection } from "@/server/models/dynamic-page/index";
import { enumPageSectionKey, enumPageSectionTemplate } from "@/definitions/enum";
import { None_Section_Default } from "./index";