This commit is contained in:
Viet An
2026-06-11 11:50:11 +07:00
parent a5a88b3b1c
commit 069ea1002c
20 changed files with 112 additions and 474 deletions

View File

@@ -38,6 +38,7 @@ import { useStore } from "~/stores/index";
// [FIX] Thêm onActivated, onDeactivated để xử lý KeepAlive
import { ref, watch, onBeforeUnmount, onActivated, onDeactivated } from "vue";
import DataTable from "~/components/datatable/DataTable.vue";
import { cloneDeep } from "es-toolkit";
const emit = defineEmits(["modalevent", "dataevent", "dataUpdated"]);
const store = useStore();
@@ -55,7 +56,7 @@ const props = defineProps({
importdata: Object,
});
const { $copy, $find, $findapi, $getapi, $setpage, $clone, $stripHtml, $snackbar, $dayjs } = useNuxtApp();
const { $copy, $find, $findapi, $getapi, $setpage, $stripHtml, $snackbar, $dayjs } = useNuxtApp();
const showmodal = ref();
const pagedata = ref();
@@ -235,7 +236,7 @@ const openImportModal = () => {
};
const updateDataDisplay = (newData) => {
const copy = $clone(store[vpagename]);
const copy = cloneDeep(store[vpagename]);
copy.data = newData;
copy.update = { data: newData };
store.commit(vpagename, copy);
@@ -406,7 +407,7 @@ const getApi = async () => {
}
pagedata.value = $setpage(vpagename, row, obj);
const copy = $clone(pagedata.value);
const copy = cloneDeep(pagedata.value);
copy.data = data;
copy.update = { data };
store.commit(vpagename, copy);