2024-07-01 15:14:17 +07:00
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { enumPageComponentTemplates } from "@/definitions/enum";
|
|
|
|
|
import { DEFAULT_QUERY_DROP, getInputValue } from "@/utils/parseSQL";
|
2024-07-02 16:03:24 +07:00
|
|
|
import { getResource } from "@/utils/resourceHandler";
|
2024-07-01 15:14:17 +07:00
|
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
|
dataResult?: any;
|
|
|
|
|
dataType?: any;
|
|
|
|
|
dataQuery?: any;
|
|
|
|
|
layout?: string;
|
|
|
|
|
label?: string;
|
|
|
|
|
}>();
|
|
|
|
|
|
|
|
|
|
const LAYOUT_PARSE = computed(() => {
|
|
|
|
|
const designObject = props.label ? getInputValue(props.label, "OBJECT") : {};
|
|
|
|
|
return Object.assign({}, designObject);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const parseData = computed(() => {
|
|
|
|
|
if (!props.dataResult) return;
|
|
|
|
|
const result = getInputValue(props.dataResult, "OBJECT");
|
|
|
|
|
return result;
|
|
|
|
|
});
|
2024-07-02 16:03:24 +07:00
|
|
|
|
|
|
|
|
const playVideo = ref<boolean>(false)
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
getResource(JSON.parse(props.dataResult).detail)
|
|
|
|
|
console.log()
|
|
|
|
|
})
|
2024-07-01 15:14:17 +07:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<article
|
|
|
|
|
class="basic-article border-custom"
|
|
|
|
|
:class="LAYOUT_PARSE['article_Class']"
|
|
|
|
|
:style="LAYOUT_PARSE['article']"
|
|
|
|
|
>
|
2024-07-02 16:03:24 +07:00
|
|
|
<div class="article_video">
|
2024-07-01 15:14:17 +07:00
|
|
|
<template v-if="parseData">
|
2024-07-02 16:03:24 +07:00
|
|
|
<div
|
|
|
|
|
v-if="!playVideo"
|
|
|
|
|
class="article_video_thumb h-full"
|
|
|
|
|
:style="{ backgroundImage: `url('${parseData.thumbnail ? parseData.thumbnail : '/images/default-thumbnail.jpg'}')` }"
|
|
|
|
|
>
|
|
|
|
|
<div></div>
|
|
|
|
|
<div class="article_video_content">
|
|
|
|
|
<span><Icon name="ri:play-circle-line" class="text-white" /></span>
|
|
|
|
|
<h3 class="line-clamp text-white" :class="LAYOUT_PARSE['title_Class']" :style="LAYOUT_PARSE['h3.title']">
|
|
|
|
|
{{ parseData.title?.replace(/<[^>]+>/g, "") }}
|
|
|
|
|
</h3>
|
|
|
|
|
<p class="mb-0 line-clamp text-white" :class="LAYOUT_PARSE['paragraph_Class']" :style="LAYOUT_PARSE['p.paragraph']">
|
|
|
|
|
{{ parseData.intro?.replace(/<[^>]+>/g, "") }}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<video src=""></video>
|
2024-07-01 15:14:17 +07:00
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
|
2024-07-02 16:03:24 +07:00
|
|
|
<div v-if="LAYOUT_PARSE.styleClasses" v-html="LAYOUT_PARSE.styleClasses"></div>
|
2024-07-01 15:14:17 +07:00
|
|
|
</article>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.article_video {
|
2024-07-02 16:03:24 +07:00
|
|
|
@apply min-h-465px;
|
|
|
|
|
.article_video_thumb {
|
|
|
|
|
@apply flex flex-col justify-end min-h-465px;
|
2024-07-01 15:14:17 +07:00
|
|
|
background-size: cover;
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
background-position: center;
|
|
|
|
|
position: relative;
|
|
|
|
|
z-index: 0;
|
|
|
|
|
padding: 120px 85px 60px 85px;
|
|
|
|
|
border-radius: 2px;
|
2024-07-02 16:03:24 +07:00
|
|
|
overflow: hidden;
|
2024-07-01 15:14:17 +07:00
|
|
|
cursor: pointer;
|
|
|
|
|
&::after {
|
|
|
|
|
content: '';
|
|
|
|
|
position: absolute;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
background-color: rgba(0, 0, 0, 0.4);
|
|
|
|
|
z-index: 1;
|
|
|
|
|
top: 0px;
|
|
|
|
|
left: 0px;
|
|
|
|
|
}
|
|
|
|
|
.article_video_content {
|
|
|
|
|
position: relative;
|
|
|
|
|
z-index: 2;
|
|
|
|
|
|
|
|
|
|
h3 {
|
|
|
|
|
font-size: 44px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
line-height: 57.2px;
|
|
|
|
|
text-align: left;
|
|
|
|
|
margin-bottom: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
p {
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-02 16:03:24 +07:00
|
|
|
svg {
|
2024-07-01 15:14:17 +07:00
|
|
|
font-size: 80px;
|
|
|
|
|
color: #ed1c24;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|