feat(VnRow): add new conponenet VnRow refs #6118
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Pablo Natek 2023-10-25 18:45:29 +02:00
parent 91a88d148d
commit 36cf762857
4 changed files with 33 additions and 13 deletions

View File

@ -122,8 +122,10 @@ watch(formUrl, async () => {
<QIcon name="warning" size="md" class="q-mr-md" />
<span>{{ t('globals.changesToSave') }}</span>
</QBanner>
<QForm v-if="formData" @submit="save" @reset="reset" class="q-pa-md">
<slot name="form" :data="formData" :validate="validate" :filter="filter"></slot>
<QForm v-if="formData" @submit="save" @reset="reset" class="q-pa-md" id="formModel">
<QCard>
<slot name="form" :data="formData" :validate="validate" :filter="filter" />
</QCard>
</QForm>
<Teleport to="#st-actions" v-if="stateStore?.isSubToolbarShown()">
<div v-if="$props.defaultActions">
@ -156,10 +158,12 @@ watch(formUrl, async () => {
color="primary"
/>
</template>
<style lang="scss" scopped>
.formModel {
<style lang="scss" scoped>
#formModel {
max-width: 800px;
width: 100%;
}
.q-card {
padding: 32px;
}
</style>

View File

@ -0,0 +1,13 @@
<script></script>
<template>
<div id="row">
<slot></slot>
</div>
</template>
<style lang="scss" scopped>
@media screen and (max-width: 800px) {
#row {
flex-direction: column;
}
}
</style>

View File

@ -6,6 +6,7 @@ import { useI18n } from 'vue-i18n';
import { useSession } from 'src/composables/useSession';
import FetchData from 'components/FetchData.vue';
import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
const route = useRoute();
const { t } = useI18n();
@ -99,7 +100,7 @@ const statesFilter = {
model="claim"
>
<template #form="{ data, validate, filter }">
<vnRow class="row q-gutter-md q-mb-md">
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<QInput
v-model="data.client.name"
@ -136,8 +137,8 @@ const statesFilter = {
</template>
</QInput>
</div>
</vnRow>
<vnRow class="row q-gutter-md q-mb-md">
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<QSelect
v-model="data.workerFk"
@ -183,8 +184,8 @@ const statesFilter = {
>
</QSelect>
</div>
</vnRow>
<vnRow class="row q-gutter-md q-mb-md">
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<QInput
v-model.number="data.packages"
@ -200,15 +201,15 @@ const statesFilter = {
:rules="validate('claim.rma')"
/>
</div>
</vnRow>
<vnRow class="row q-gutter-md q-mb-md">
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<QCheckbox
v-model="data.hasToPickUp"
:label="t('claim.basicData.picked')"
/>
</div>
</vnRow>
</VnRow>
</template>
</FormModel>
</div>

View File

@ -6,6 +6,8 @@ import { useI18n } from 'vue-i18n';
import { useSession } from 'src/composables/useSession';
import FetchData from 'components/FetchData.vue';
import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
const route = useRoute();
const { t } = useI18n();
const session = useSession();