#6480 improve Card #271

Merged
jorgep merged 36 commits from 6480-improveCard into dev 2024-04-24 06:57:38 +00:00
3 changed files with 22 additions and 13 deletions
Showing only changes of commit bfa9dc9634 - Show all commits

View File

@ -1,11 +1,26 @@
<script setup>
import useCardSize from 'src/composables/useCardSize';
import VnSubToolbar from '../ui/VnSubToolbar.vue';
import LeftMenu from 'components/LeftMenu.vue';
import { useStateStore } from 'stores/useStateStore';
defineProps({
descriptor: { type: Object, required: true },
});
const stateStore = useStateStore();
</script>
<template>
<VnSubToolbar />
<QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256">

Esta parte también se repite mucho

Esta parte también se repite mucho
<QScrollArea class="fit">
Review

Habilita la opción de usasr una url diferente, en el caso de worker se usa un scope: "summary"

Habilita la opción de usasr una url diferente, en el caso de worker se usa un scope: "summary"
<component :is="descriptor" />
<QSeparator />
<LeftMenu source="card" />
</QScrollArea>
</QDrawer>
<QPageContainer>
<QPage>
<VnSubToolbar />
<div :class="useCardSize()">
<RouterView />
</div>

View File

@ -12,14 +12,16 @@ onMounted(() => {
actions.value = document.querySelector('#st-actions');
data.value = document.querySelector('#st-data');
if (!actions.value && !data.value) return;
// Check if there's content to display
const observer = new MutationObserver(
Review

comprueba que haya contenido dentro de ambos divs. Sería como un "watch" pero del DOM.

comprueba que haya contenido dentro de ambos divs. Sería como un "watch" pero del DOM.
() =>
(hasContent.value =
actions.value.childNodes.length + data.value.childNodes.length)
);
observer.observe(actions.value, opts);
observer.observe(data.value, opts);
if (actions.value) observer.observe(actions.value, opts);
if (data.value) observer.observe(data.value, opts);
});
onUnmounted(() => {

View File

@ -2,7 +2,6 @@
import { useI18n } from 'vue-i18n';
import { useStateStore } from 'stores/useStateStore';
import InvoiceInDescriptor from './InvoiceInDescriptor.vue';
import LeftMenu from 'components/LeftMenu.vue';
import VnSearchbar from 'components/ui/VnSearchbar.vue';
import { useArrayData } from 'src/composables/useArrayData';
import { onMounted, watch } from 'vue';
@ -47,7 +46,7 @@ const arrayData = useArrayData('InvoiceIn', {
onMounted(async () => await arrayData.fetch({ append: false }));
watch(
() => route.params.id,
async (newId, oldId) => {
async (newId) => {
if (newId) {
arrayData.store.url = `InvoiceIns/${newId}`;
await arrayData.fetch({ append: false });
@ -64,14 +63,7 @@ watch(
:info="t('You can search by invoice reference')"
/>
</Teleport>
<QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256">
<QScrollArea class="fit">
<InvoiceInDescriptor />
<QSeparator />
<LeftMenu source="card" />
</QScrollArea>
</QDrawer>
<VnCard />
<VnCard :descriptor="InvoiceInDescriptor" />
</template>
<i18n>
es: