diff --git a/assets/styles/style.scss b/assets/styles/style.scss index 92c4650..8cee48d 100644 --- a/assets/styles/style.scss +++ b/assets/styles/style.scss @@ -206,4 +206,10 @@ div[layout="ARTICLE_PAGE"] { img { @apply mx-auto; } +} + +.detail-default { + p { + @apply text-18px font-raleway leading-180% my-10px; + } } \ No newline at end of file diff --git a/components/dynamic-page/page-component/templates/articles/cards/VideoBackground.vue b/components/dynamic-page/page-component/templates/articles/cards/VideoBackground.vue index 3999a2b..d6c9094 100644 --- a/components/dynamic-page/page-component/templates/articles/cards/VideoBackground.vue +++ b/components/dynamic-page/page-component/templates/articles/cards/VideoBackground.vue @@ -8,7 +8,8 @@ const props = defineProps<{ dataType?: any; dataQuery?: any; layout?: string; - label?: any; + label?: string; + component?: any; }>(); const LAYOUT_PARSE = computed(() => { @@ -16,95 +17,122 @@ const LAYOUT_PARSE = computed(() => { return Object.assign({}, designObject); }); +const emit = defineEmits(["selectComponent", "dropData"]); + +const selectComponent = () => { + emit("selectComponent"); +}; + const parseData = computed(() => { if (!props.dataResult) return; const result = getInputValue(props.dataResult, "OBJECT"); return result; }); -const playVideo = ref(false) +const drop = (e: any) => { + if (e.dataTransfer.getData(`${enumPageComponentTemplates.ARTICLE}`)) { + const data = e.dataTransfer.getData(`${enumPageComponentTemplates.ARTICLE}`); + const { dataType, dataResult } = JSON.parse(data); + const dataQuery = DEFAULT_QUERY_DROP(dataType, dataResult.id); + emit("dropData", { + dataType, + dataResult, + dataQuery: dataQuery, + }); + } +}; + diff --git a/components/dynamic-page/page-component/templates/articles/details/Image.vue b/components/dynamic-page/page-component/templates/articles/details/Image.vue index 0b40ca5..5ceba41 100644 --- a/components/dynamic-page/page-component/templates/articles/details/Image.vue +++ b/components/dynamic-page/page-component/templates/articles/details/Image.vue @@ -36,7 +36,7 @@ console.log(currentArticle.value, "currentArticle");
@@ -52,7 +52,7 @@ console.log(currentArticle.value, "currentArticle");
  • - +
  • diff --git a/components/dynamic-page/page-component/templates/articles/details/Video.vue b/components/dynamic-page/page-component/templates/articles/details/Video.vue index 75a411c..9242dbc 100644 --- a/components/dynamic-page/page-component/templates/articles/details/Video.vue +++ b/components/dynamic-page/page-component/templates/articles/details/Video.vue @@ -1,67 +1,93 @@ diff --git a/components/dynamic-page/page-component/templates/categories/categories/Default.vue b/components/dynamic-page/page-component/templates/categories/categories/Default.vue index f3cc798..75cdea7 100644 --- a/components/dynamic-page/page-component/templates/categories/categories/Default.vue +++ b/components/dynamic-page/page-component/templates/categories/categories/Default.vue @@ -8,6 +8,22 @@ const _props = defineProps<{ label?: any; }>(); +const SETTING_OPTIONS = { + MAX_ELEMENT: 3, +}; + +const _dataResult = computed(() => { + const designObject = _props.label ? getInputValue(_props.label, "OBJECT") : {}; + let _components = Array(Number(designObject.MAX) || SETTING_OPTIONS.MAX_ELEMENT).fill(null); + const result = getInputValue(_props.dataResult, "ARRAY"); + result && + result.length > 0 && + _components.map((_: any, index: any) => { + _components[index] = result[index] || null; + }); + return Object.assign({}, _components); +}); + const designObject = computed(() => { return _props.label ? getInputValue(_props.label, "OBJECT") : {}; }); @@ -26,7 +42,7 @@ const mapActivesToItems = (index: number) => {