refs #6111 fix qtable, actions, scroll

This commit is contained in:
Carlos Satorres 2024-03-27 13:09:10 +01:00
parent 72e3fcb4b7
commit c0c94ff924
4 changed files with 36 additions and 18 deletions

View File

@ -2,7 +2,7 @@
import { computed, ref } from 'vue'; import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import isValidDate from 'filters/isValidDate'; import isValidDate from 'filters/isValidDate';
import VnInput from "components/common/VnInput.vue"; import VnInput from 'components/common/VnInput.vue';
const props = defineProps({ const props = defineProps({
modelValue: { modelValue: {
@ -27,12 +27,7 @@ const value = computed({
set(value) { set(value) {
const [hours, minutes] = value.split(':'); const [hours, minutes] = value.split(':');
const date = new Date(props.modelValue); const date = new Date(props.modelValue);
date.setHours( date.setHours(Number.parseInt(hours) || 0, Number.parseInt(minutes) || 0, 0, 0);
Number.parseInt(hours) || 0,
Number.parseInt(minutes) || 0,
0,
0
);
emit('update:modelValue', value ? date.toISOString() : null); emit('update:modelValue', value ? date.toISOString() : null);
}, },
}); });
@ -79,7 +74,7 @@ const styleAttrs = computed(() => {
@click="isPopupOpen = true" @click="isPopupOpen = true"
> >
<template #append> <template #append>
<QIcon name="event" class="cursor-pointer"> <QIcon name="Schedule" class="cursor-pointer">
<QPopupProxy <QPopupProxy
v-model="isPopupOpen" v-model="isPopupOpen"
cover cover

View File

@ -14,12 +14,6 @@ body.body--light {
.q-header .q-toolbar { .q-header .q-toolbar {
color: var(--font-color); color: var(--font-color);
} }
.q-card,
.q-table,
.q-table__bottom,
.q-drawer {
background-color: var(--vn-section-color);
}
} }
body.body--dark { body.body--dark {
@ -122,6 +116,13 @@ select:-webkit-autofill {
color: black; color: black;
} }
.q-card,
.q-table,
.q-table__bottom,
.q-drawer {
background-color: var(--vn-section-color);
}
input[type='number'] { input[type='number'] {
-moz-appearance: textfield; -moz-appearance: textfield;
} }

View File

@ -12,6 +12,7 @@ import VnInput from 'components/common/VnInput.vue';
import VnInputTime from 'components/common/VnInputTime.vue'; import VnInputTime from 'components/common/VnInputTime.vue';
import axios from 'axios'; import axios from 'axios';
import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue'; import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue';
import TableVisibleColumns from 'src/components/common/TableVisibleColumns.vue';
import RouteFilter from 'pages/Route/Card/RouteFilter.vue'; import RouteFilter from 'pages/Route/Card/RouteFilter.vue';
import RouteSummary from 'pages/Route/Card/RouteSummary.vue'; import RouteSummary from 'pages/Route/Card/RouteSummary.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
@ -224,8 +225,16 @@ const openTicketsDialog = (id) => {
<FetchData url="AgencyModes" @on-fetch="(data) => (agencyList = data)" auto-load /> <FetchData url="AgencyModes" @on-fetch="(data) => (agencyList = data)" auto-load />
<FetchData url="Vehicles" @on-fetch="(data) => (vehicleList = data)" auto-load /> <FetchData url="Vehicles" @on-fetch="(data) => (vehicleList = data)" auto-load />
<QPage class="column items-center"> <QPage class="column items-center">
<QToolbar class="justify-end"> </QToolbar>
<VnSubToolbar class="justify-end"> <VnSubToolbar class="justify-end">
<template #st-actions> <template #st-actions>
<TableVisibleColumns
class="LeftIcon"
:all-columns="allColumnNames"
table-code="latestBuys"
labels-traductions-path="entry.latestBuys"
@on-config-saved="visibleColumns = ['picture', ...$event]"
/>
<QBtn <QBtn
icon="vn:clone" icon="vn:clone"
color="primary" color="primary"
@ -260,7 +269,7 @@ const openTicketsDialog = (id) => {
:key="refreshKey" :key="refreshKey"
data-key="RouteList" data-key="RouteList"
url="Routes/filter" url="Routes/filter"
:order="['created DESC', 'id DESC']" :order="['created ASC', 'started ASC', 'id ASC']"
:limit="20" :limit="20"
auto-load auto-load
> >
@ -275,7 +284,6 @@ const openTicketsDialog = (id) => {
selection="multiple" selection="multiple"
:rows-per-page-options="[0]" :rows-per-page-options="[0]"
hide-pagination hide-pagination
:pagination="{ sortBy: 'ID', descending: true }"
:no-data-label="t('globals.noResults')" :no-data-label="t('globals.noResults')"
> >
<template #body-cell-worker="{ row }"> <template #body-cell-worker="{ row }">
@ -329,7 +337,7 @@ const openTicketsDialog = (id) => {
</QTd> </QTd>
</template> </template>
<template #body-cell-vehicle="{ row }"> <template #body-cell-vehicle="{ row }">
<QTd> <QTd class="vehicle">
<VnSelectFilter <VnSelectFilter
:label="t('Vehicle')" :label="t('Vehicle')"
v-model="row.vehicleFk" v-model="row.vehicleFk"
@ -466,6 +474,18 @@ const openTicketsDialog = (id) => {
.table-actions { .table-actions {
gap: 12px; gap: 12px;
} }
.vehicle {
max-width: 150px;
}
th:last-child,
td:last-child {
background-color: var(--vn-section-color);
position: sticky;
right: 0;
z-index: 1;
}
</style> </style>
<i18n> <i18n>
en: en:

View File

@ -1,8 +1,10 @@
<script setup> <script setup>
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import LeftMenu from 'src/components/LeftMenu.vue'; import LeftMenu from 'src/components/LeftMenu.vue';
import { onMounted } from 'vue';
const stateStore = useStateStore(); const stateStore = useStateStore();
onMounted(() => (stateStore.leftDrawer = false));
</script> </script>
<template> <template>