diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index 75353a35a..dcffc1a28 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -76,8 +76,13 @@ defineExpose({ reset, hasChanges, saveChanges, + getFormData, }); +function getFormData() { + return formData.value; +} + async function fetch(data) { if (data && Array.isArray(data)) { let $index = 0; @@ -196,12 +201,13 @@ function getChanges() { const creates = []; const pk = $props.primaryKey; - for (const [i, row] of formData.value.entries()) { + console.log(pk, row); if (!row[pk]) { creates.push(row); } else if (originalData.value) { const data = getDifferences(originalData.value[i], row); + console.log(data); if (!isEmpty(data)) { updates.push({ data, @@ -211,7 +217,7 @@ function getChanges() { } } const changes = { updates, creates }; - + console.log('ddd', changes); for (let prop in changes) { if (changes[prop].length === 0) changes[prop] = undefined; } diff --git a/src/components/LeftMenu.vue b/src/components/LeftMenu.vue index 2eac97c65..253f3c161 100644 --- a/src/components/LeftMenu.vue +++ b/src/components/LeftMenu.vue @@ -50,7 +50,7 @@ function addChildren(module, route, parent) { const matches = findMatches(mainMenus, route); for (const child of matches) { - navigation.addMenuItem(module, child, parent); + if (!child.meta.hidden) navigation.addMenuItem(module, child, parent); } } } diff --git a/src/components/common/VnSelectFilter.vue b/src/components/common/VnSelectFilter.vue index 568da613f..35cb72cf2 100644 --- a/src/components/common/VnSelectFilter.vue +++ b/src/components/common/VnSelectFilter.vue @@ -102,7 +102,7 @@ const value = computed({ name="close" @click.stop="value = null" class="cursor-pointer" - size="18px" + size="xs" />