minhnt-dev: fix bugs

This commit is contained in:
MoreStrive
2024-07-01 14:51:57 +07:00
parent 5a207435ce
commit 03ca9c6603
18 changed files with 40 additions and 121 deletions
@@ -5,8 +5,6 @@ import { COLLECTION_PAGING_QUERY_DROP, getInputValue } from "@/utils/parseSQL";
const router = useRouter();
const route = useRoute();
const emit = defineEmits(["dropData", "selectComponent"]);
const store = reactive({
component: usePageComponentStore(),
});
@@ -43,20 +41,6 @@ const designObject = computed(() => {
return _props.label ? getInputValue(_props.label, "OBJECT") : {};
});
const dropData = (event: any) => {
const queryBy = {
Category: "Categories",
};
const { dataResult, dataType } = JSON.parse(event.dataTransfer.getData("category"));
// const getDataQuery = `Get[${type}] Top[20] With[${queryBy[dataType]}:${dataResult.id}]`;
const getDataQuery = COLLECTION_PAGING_QUERY_DROP(type, { key: queryBy[dataType], value: dataResult.id });
emit("dropData", {
dataResult: [],
dataType,
dataQuery: getDataQuery,
});
};
//?cpn_1=page:2&cpn_2=page:1
// Get[Article] Top[5] With[Categories:1]
const select = async (pageActive: number) => {
@@ -114,9 +98,6 @@ const handleNextPrev = (type: "+" | "-") => {
}
};
const selectComponent = () => {
emit("selectComponent");
};
const mapActivesToItems = (index: number) => {
if (designObject.value && designObject.value.listCss) {
return designObject.value.listCss[index] || {};
@@ -127,7 +108,7 @@ const mapActivesToItems = (index: number) => {
<template>
<section>
<div class="section-container" @click="selectComponent" @dragover.prevent @drop.stop.prevent="dropData($event)" :class="[listArticleByCategory && listArticleByCategory?.length > 0 ? '' : 'noData']">
<div class="section-container" :class="[listArticleByCategory && listArticleByCategory?.length > 0 ? '' : 'noData']">
<div class="section-layout" :style="designObject['div.section']">
<template v-if="listArticleByCategory?.length > 0">
<template v-for="(component, index) in listArticlePaging?.length > 0 ? listArticlePaging : listArticleByCategory">