Merge pull request 'Update Wagon List' (#19) from feature/ms-28-wagons into dev

Reviewed-on: hyervoni/salix-front-mindshore#19
This commit is contained in:
Carlos Fonseca 2023-11-30 10:43:27 +00:00
commit cf53245bcf
4 changed files with 112 additions and 134 deletions

View File

@ -239,8 +239,8 @@ function exceedMaxHeight(pos) {
<template>
<QPage class="q-pa-sm q-mx-xl">
<QCard class="q-pa-sm">
<QForm @submit="onSubmit()" @reset="onReset()" class="q-pa-md">
<QForm @submit="onSubmit()" @reset="onReset()" class="q-pa-sm">
<QCard class="q-pa-md">
<QInput
filled
v-model="name"
@ -248,7 +248,7 @@ function exceedMaxHeight(pos) {
:rules="[(val) => !!val || t('wagon.warnings.nameNotEmpty')]"
/>
<QCheckbox class="q-mb-sm" v-model="divisible" label="Divisible" />
<div class="wagon-tray q-mx-xl" v-for="tray in wagon" :key="tray.id">
<div class="wagon-tray q-mx-lg" v-for="tray in wagon" :key="tray.id">
<div class="position">
<QInput
autofocus
@ -309,16 +309,6 @@ function exceedMaxHeight(pos) {
<QIcon color="grey-6" name="trip_origin" size="3rem" />
<QIcon color="grey-6" name="trip_origin" size="3rem" />
</div>
<div>
<QBtn :label="t('wagon.type.submit')" type="submit" color="primary" />
<QBtn
:label="t('wagon.type.reset')"
type="reset"
color="primary"
flat
class="q-ml-sm"
/>
</div>
<QDialog
v-model="colorPickerActive"
position="right"
@ -346,8 +336,18 @@ function exceedMaxHeight(pos) {
</QCardSection>
</QCard>
</QDialog>
</QForm>
</QCard>
</QCard>
<div class="q-mt-md">
<QBtn :label="t('wagon.type.submit')" type="submit" color="primary" />
<QBtn
:label="t('wagon.type.reset')"
type="reset"
color="primary"
flat
class="q-ml-sm"
/>
</div>
</QForm>
</QPage>
</template>
@ -357,45 +357,55 @@ function exceedMaxHeight(pos) {
justify-content: center;
align-items: flex-start;
}
.q-card {
.q-form {
width: 70%;
}
.q-dialog {
.q-card {
width: 100%;
}
}
.wheels {
margin-left: 5%;
display: flex;
justify-content: space-around;
}
.wagon-tray {
display: flex;
height: 6rem;
.position {
width: 15%;
width: 20%;
border-right: 1rem solid gray;
display: flex;
align-items: flex-end;
justify-content: flex-end;
padding-right: 1rem;
}
.shelving {
display: flex;
width: 75%;
.shelving-half {
width: 50%;
height: 100%;
.shelving-up {
height: 80%;
width: 100%;
}
.shelving-down {
height: 20%;
width: 100%;
}
}
.shelving-divisible {
width: 1%;
height: 100%;
@ -403,6 +413,7 @@ function exceedMaxHeight(pos) {
border-right: 0.5rem dashed grey;
}
}
.action-button {
width: 10%;
border-left: 1rem solid gray;

View File

@ -5,6 +5,8 @@ import VnPaginate from 'src/components/ui/VnPaginate.vue';
import { useArrayData } from 'src/composables/useArrayData';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import CardList2 from 'components/ui/CardList2.vue';
import VnLv from 'components/ui/VnLv.vue';
const quasar = useQuasar();
const arrayData = useArrayData('WagonTypeList');
@ -48,43 +50,32 @@ async function remove(row) {
auto-load
>
<template #body="{ rows }">
<QCard class="card q-mb-md" v-for="row of rows" :key="row.id">
<QItem
class="q-pa-none items-start cursor-pointer q-hoverable"
v-ripple
clickable
>
<QItemSection class="q-pa-md" @click="navigate(row.id)">
<div class="text-h6">{{ row.name }}</div>
<QItem-label caption>#{{ row.id }}</QItem-label>
</QItemSection>
<QSeparator vertical />
<QCardActions vertical class="justify-between">
<QBtn
flat
round
color="primary"
icon="arrow_circle_right"
@click="navigate(row.id)"
>
<QTooltip>
{{ t('components.smartCard.openCard') }}
</QTooltip>
</QBtn>
<QBtn
flat
round
color="primary"
icon="delete"
@click="remove(row)"
>
<QTooltip>
{{ t('wagon.list.remove') }}
</QTooltip>
</QBtn>
</QCardActions>
</QItem>
</QCard>
<CardList2
v-for="row of rows"
:key="row.id"
:title="(row.name || '').toString()"
:id="row.id"
@click="navigate(row.id)"
>
<template #list-items>
<VnLv label="ID" :value="row.id" />
</template>
<template #actions>
<QBtn
:label="t('components.smartCard.openCard')"
@click.stop="navigate(row.id)"
color="white"
outline
type="submit"
/>
<QBtn
:label="t('wagon.list.remove')"
@click.stop="remove(row)"
color="primary"
style="margin-top: 15px"
/>
</template>
</CardList2>
</template>
</VnPaginate>
</div>

View File

@ -86,9 +86,9 @@ function filterType(val, update) {
<template>
<QPage class="q-pa-sm q-mx-xl">
<QCard class="q-pa-sm">
<QForm @submit="onSubmit()" @reset="onReset()" class="q-pa-md">
<div class="row q-col-gutter-md q-mb-md">
<QForm @submit="onSubmit()" @reset="onReset()" class="q-pa-sm">
<QCard class="q-pa-md">
<div class="row q-col-gutter-md">
<div class="col">
<QInput
filled
@ -108,7 +108,7 @@ function filterType(val, update) {
/>
</div>
</div>
<div class="row q-col-gutter-md q-mb-md">
<div class="row q-col-gutter-md">
<div class="col">
<QInput
filled
@ -155,18 +155,18 @@ function filterType(val, update) {
</QSelect>
</div>
</div>
<div>
<QBtn :label="t('wagon.type.submit')" type="submit" color="primary" />
<QBtn
:label="t('wagon.type.reset')"
type="reset"
color="primary"
flat
class="q-ml-sm"
/>
</div>
</QForm>
</QCard>
</QCard>
<div class="q-mt-md">
<QBtn :label="t('wagon.type.submit')" type="submit" color="primary" />
<QBtn
:label="t('wagon.type.reset')"
type="reset"
color="primary"
flat
class="q-ml-sm"
/>
</div>
</QForm>
</QPage>
</template>
@ -176,7 +176,8 @@ function filterType(val, update) {
justify-content: center;
align-items: flex-start;
}
.q-card {
.q-form {
width: 70%;
}
</style>

View File

@ -5,6 +5,8 @@ import VnPaginate from 'src/components/ui/VnPaginate.vue';
import { useArrayData } from 'src/composables/useArrayData';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import CardList2 from 'components/ui/CardList2.vue';
import VnLv from 'components/ui/VnLv.vue';
const quasar = useQuasar();
const arrayData = useArrayData('WagonList');
@ -55,69 +57,42 @@ async function remove(row) {
auto-load
>
<template #body="{ rows }">
<QCard class="card q-mb-md" v-for="row of rows" :key="row.id">
<QItem
class="q-pa-none items-start cursor-pointer q-hoverable"
v-ripple
clickable
>
<QItemSection class="q-pa-md" @click="navigate(row.id)">
<div class="text-h6">{{ row.label }}</div>
<QItemLabel caption>#{{ row.id }}</QItemLabel>
<QList>
<QItem class="q-pa-none">
<QItemSection>
<QItemLabel caption>
{{ t('wagon.list.plate') }}
</QItemLabel>
<QItemLabel>{{ row.plate }}</QItemLabel>
</QItemSection>
</QItem>
<QItem class="q-pa-none">
<QItemSection>
<QItemLabel caption>
{{ t('wagon.list.volume') }}
</QItemLabel>
<QItemLabel>{{ row.volume }}</QItemLabel>
</QItemSection>
</QItem>
<QItem class="q-pa-none">
<QItemSection>
<QItemLabel caption>
{{ t('wagon.list.type') }}
</QItemLabel>
<QItemLabel>{{ row.type.name }}</QItemLabel>
</QItemSection>
</QItem>
</QList>
</QItemSection>
<QSeparator vertical />
<QCardActions vertical class="justify-between">
<QBtn
flat
round
color="primary"
icon="arrow_circle_right"
@click="navigate(row.id)"
>
<QTooltip>
{{ t('components.smartCard.openCard') }}
</QTooltip>
</QBtn>
<QBtn
flat
round
color="primary"
icon="delete"
@click="remove(row)"
>
<QTooltip>
{{ t('wagon.list.remove') }}
</QTooltip>
</QBtn>
</QCardActions>
</QItem>
</QCard>
<CardList2
v-for="row of rows"
:key="row.id"
:title="(row.label || '').toString()"
:id="row.id"
@click="navigate(row.id)"
>
<template #list-items>
<VnLv label="ID" :value="row.id" />
<VnLv
:label="t('wagon.list.plate')"
:title-label="t('wagon.list.plate')"
:value="row.plate"
/>
<VnLv :label="t('wagon.list.volume')" :value="row?.volume" />
<VnLv
:label="t('wagon.list.type')"
:value="row?.type?.name"
/>
</template>
<template #actions>
<QBtn
:label="t('components.smartCard.openCard')"
@click.stop="navigate(row.id)"
color="white"
outline
type="submit"
/>
<QBtn
:label="t('wagon.list.remove')"
@click.stop="remove(row)"
color="primary"
style="margin-top: 15px"
/>
</template>
</CardList2>
</template>
</VnPaginate>
</div>