feat: refs #6480 hide if no content
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
dafc9f83b9
commit
4fa311120d
|
@ -9,6 +9,7 @@ import VnPaginate from 'components/ui/VnPaginate.vue';
|
||||||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||||
import SkeletonTable from 'components/ui/SkeletonTable.vue';
|
import SkeletonTable from 'components/ui/SkeletonTable.vue';
|
||||||
import { tMobile } from 'src/composables/tMobile';
|
import { tMobile } from 'src/composables/tMobile';
|
||||||
|
import VnSubToolbar from './ui/VnSubToolbar.vue';
|
||||||
|
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
|
@ -258,6 +259,44 @@ watch(formUrl, async () => {
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
<VnSubToolbar class="q-mb-md">
|
||||||
|
<template #st-actions>
|
||||||
|
<QBtnGroup push style="column-gap: 10px">
|
||||||
|
<slot name="moreBeforeActions" />
|
||||||
|
<QBtn
|
||||||
|
:label="tMobile('globals.remove')"
|
||||||
|
color="primary"
|
||||||
|
icon="delete"
|
||||||
|
flat
|
||||||
|
@click="remove(selected)"
|
||||||
|
:disable="!selected?.length"
|
||||||
|
:title="t('globals.remove')"
|
||||||
|
v-if="$props.defaultRemove"
|
||||||
|
/>
|
||||||
|
<QBtn
|
||||||
|
:label="tMobile('globals.reset')"
|
||||||
|
color="primary"
|
||||||
|
icon="restart_alt"
|
||||||
|
flat
|
||||||
|
@click="reset"
|
||||||
|
:disable="!hasChanges"
|
||||||
|
:title="t('globals.reset')"
|
||||||
|
v-if="$props.defaultReset"
|
||||||
|
/>
|
||||||
|
<QBtn
|
||||||
|
:label="tMobile('globals.save')"
|
||||||
|
ref="saveButtonRef"
|
||||||
|
color="primary"
|
||||||
|
icon="save"
|
||||||
|
@click="onSubmit"
|
||||||
|
:disable="!hasChanges"
|
||||||
|
:title="t('globals.save')"
|
||||||
|
v-if="$props.defaultSave"
|
||||||
|
/>
|
||||||
|
<slot name="moreAfterActions" />
|
||||||
|
</QBtnGroup>
|
||||||
|
</template>
|
||||||
|
</VnSubToolbar>
|
||||||
<VnPaginate
|
<VnPaginate
|
||||||
:url="url"
|
:url="url"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
|
@ -275,42 +314,6 @@ watch(formUrl, async () => {
|
||||||
</template>
|
</template>
|
||||||
</VnPaginate>
|
</VnPaginate>
|
||||||
<SkeletonTable v-if="!formData" />
|
<SkeletonTable v-if="!formData" />
|
||||||
<Teleport to="#st-actions" v-if="stateStore?.isSubToolbarShown()">
|
|
||||||
<QBtnGroup push style="column-gap: 10px">
|
|
||||||
<slot name="moreBeforeActions" />
|
|
||||||
<QBtn
|
|
||||||
:label="tMobile('globals.remove')"
|
|
||||||
color="primary"
|
|
||||||
icon="delete"
|
|
||||||
flat
|
|
||||||
@click="remove(selected)"
|
|
||||||
:disable="!selected?.length"
|
|
||||||
:title="t('globals.remove')"
|
|
||||||
v-if="$props.defaultRemove"
|
|
||||||
/>
|
|
||||||
<QBtn
|
|
||||||
:label="tMobile('globals.reset')"
|
|
||||||
color="primary"
|
|
||||||
icon="restart_alt"
|
|
||||||
flat
|
|
||||||
@click="reset"
|
|
||||||
:disable="!hasChanges"
|
|
||||||
:title="t('globals.reset')"
|
|
||||||
v-if="$props.defaultReset"
|
|
||||||
/>
|
|
||||||
<QBtn
|
|
||||||
:label="tMobile('globals.save')"
|
|
||||||
ref="saveButtonRef"
|
|
||||||
color="primary"
|
|
||||||
icon="save"
|
|
||||||
@click="onSubmit"
|
|
||||||
:disable="!hasChanges"
|
|
||||||
:title="t('globals.save')"
|
|
||||||
v-if="$props.defaultSave"
|
|
||||||
/>
|
|
||||||
<slot name="moreAfterActions" />
|
|
||||||
</QBtnGroup>
|
|
||||||
</Teleport>
|
|
||||||
<QInnerLoading
|
<QInnerLoading
|
||||||
:showing="isLoading"
|
:showing="isLoading"
|
||||||
:label="t && t('globals.pleaseWait')"
|
:label="t && t('globals.pleaseWait')"
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
<script setup>
|
||||||
|
import useCardSize from 'src/composables/useCardSize';
|
||||||
|
import VnSubToolbar from 'src/components/common/VnSubToolbar.vue';
|
||||||
|
defineProps({
|
||||||
|
component: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<QPageContainer>
|
||||||
|
<QPage>
|
||||||
|
<VnSubToolbar />
|
||||||
|
<div :class="useCardSize()">
|
||||||
|
<RouterView :name="component"> </RouterView>
|
||||||
|
</div>
|
||||||
|
</QPage>
|
||||||
|
</QPageContainer>
|
||||||
|
</template>
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, onUnmounted } from 'vue';
|
import { onMounted, onUnmounted } from 'vue';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
|
// Falta si los divs tienen contenido o remplazar los teleport y usar siempre slots
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@ -14,7 +14,7 @@ onUnmounted(() => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QToolbar class="bg-vn-section-color justify-end sticky">
|
<QToolbar class="justify-end sticky" v-if="$slots['st-data'] || $slots['st-actions']">
|
||||||
<slot name="st-data">
|
<slot name="st-data">
|
||||||
<div id="st-data"></div>
|
<div id="st-data"></div>
|
||||||
</slot>
|
</slot>
|
||||||
|
@ -27,6 +27,7 @@ onUnmounted(() => {
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.q-toolbar {
|
.q-toolbar {
|
||||||
background: var(--vn-section-color);
|
background: var(--vn-section-color);
|
||||||
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
Loading…
Reference in New Issue