Compare commits

..

4 Commits

Author SHA1 Message Date
MoreStrive 81bfa351e8 Merge branch 'main' of http://work.gct.com.vn/minhnt/NSG_PORTAL_V2 2024-07-06 18:29:42 +07:00
MoreStrive a3e20c9445 feat: select tag 2024-07-06 18:29:38 +07:00
MoreStrive 4ec2e425df Merge branch 'main' of http://work.gct.com.vn/minhnt/NSG_PORTAL_V2 2024-07-06 16:34:43 +07:00
MoreStrive 31175ade27 minhnt-dev: fix lodash 2024-07-06 16:34:25 +07:00
3 changed files with 17 additions and 27 deletions
@@ -23,10 +23,6 @@ const parseData = computed(() => {
}); });
const playVideo = ref<boolean>(false) const playVideo = ref<boolean>(false)
onMounted(() => {
getResource(JSON.parse(props.dataResult).detail)
})
</script> </script>
<template> <template>
@@ -41,6 +37,7 @@ onMounted(() => {
v-if="!playVideo" v-if="!playVideo"
class="article_video_thumb h-full" class="article_video_thumb h-full"
:style="{ backgroundImage: `url('${parseData.thumbnail ? parseData.thumbnail : '/images/default-thumbnail.jpg'}')` }" :style="{ backgroundImage: `url('${parseData.thumbnail ? parseData.thumbnail : '/images/default-thumbnail.jpg'}')` }"
@click="playVideo = true"
> >
<div></div> <div></div>
<div class="article_video_content"> <div class="article_video_content">
@@ -53,7 +50,8 @@ onMounted(() => {
</p> </p>
</div> </div>
</div> </div>
<video src=""></video> <div v-else v-html="getResource('HIGHLIGHT_VIDEO', JSON.parse(props.dataResult).detail)">
</div>
</template> </template>
</div> </div>
@@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import DynamicComponent from "~/components/dynamic-page/page-component/templates/index.vue"; import DynamicComponent from "~/components/dynamic-page/page-component/templates/index.vue";
import { COLLECTION_QUERY_DROP, getValueStringWithKeyAndColon, getInputValue } from "@/utils/parseSQL"; import { COLLECTION_QUERY_DROP, getValueStringWithKeyAndColon, getInputValue } from "@/utils/parseSQL";
import { isEmpty, groupBy } from "lodash"; import { isEmpty } from "@/utils/lodash";
import { enumPageComponentTemplates } from "@/definitions/enum"; import { enumPageComponentTemplates } from "@/definitions/enum";
const emit = defineEmits(["dropComponent", "dropData", "selectComponent"]); const emit = defineEmits(["dropComponent", "dropData", "selectComponent"]);
const _props = defineProps<{ const _props = defineProps<{
+12 -20
View File
@@ -1,26 +1,18 @@
import * as cherrio from 'cheerio' import * as cherrio from 'cheerio'
const getResource = (data: any) => { const getResource = (key: any, data: any) => {
// const result = { const $ = cherrio.load(`<div class="">${data}</div>`)
// videoHightlight: null, let result = null;
// imageHightlight: null, switch (key) {
// resources: [], case 'HIGHLIGHT_VIDEO':
// }; result = $('video').first().parent().html();
// const $ = cherrio.load(`<div class="get-resource">${data}</div>`) break;
// const html : any = $('.get-resource').html(); default:
// html.find('video, figure img, img').each((index : any, element: any) => { result = $.html();
// // if (index === 0) result.videoHightlight = }
// }); console.log(result)
return result;
// console.log(html)
// <div>
// <video controls="controls" width="100%" height="auto" data-id="578" data-resource="https://resource.vpress.vn/resources/1/private/13cee27a2bd93915479f049378cffdd3/video/28thi-tot-nghiep-ptth-2024-1719829616.mp4" data-title="28thi-tot-nghiep-ptth-2024">
// <source src="https://resource.vpress.vn/resources/1/private/13cee27a2bd93915479f049378cffdd3/video/28thi-tot-nghiep-ptth-2024-1719829616.mp4" type="video/mp4">
// </video>
// </div>
} }
export { export {
getResource getResource