Merge branch 'dev' into 8725_submit_form_onClick
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javier Segarra 2025-04-08 11:31:00 +00:00
commit d6362d042d
5 changed files with 47 additions and 28 deletions

View File

@ -19,6 +19,7 @@ import { useQuasar, date } from 'quasar';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { useFilterParams } from 'src/composables/useFilterParams'; import { useFilterParams } from 'src/composables/useFilterParams';
import { dashIfEmpty, toDate } from 'src/filters'; import { dashIfEmpty, toDate } from 'src/filters';
import { useTableHeight } from './filters/useTableHeight';
import CrudModel from 'src/components/CrudModel.vue'; import CrudModel from 'src/components/CrudModel.vue';
import FormModelPopup from 'components/FormModelPopup.vue'; import FormModelPopup from 'components/FormModelPopup.vue';
@ -117,7 +118,7 @@ const $props = defineProps({
}, },
tableHeight: { tableHeight: {
type: String, type: String,
default: '90vh', default: undefined,
}, },
footer: { footer: {
type: Boolean, type: Boolean,
@ -166,6 +167,7 @@ const tableRef = ref();
const params = ref(useFilterParams($attrs['data-key']).params); const params = ref(useFilterParams($attrs['data-key']).params);
const orders = ref(useFilterParams($attrs['data-key']).orders); const orders = ref(useFilterParams($attrs['data-key']).orders);
const app = inject('app'); const app = inject('app');
const tableHeight = useTableHeight();
const editingRow = ref(null); const editingRow = ref(null);
const editingField = ref(null); const editingField = ref(null);
@ -678,7 +680,7 @@ const rowCtrlClickFunction = computed(() => {
table-header-class="bg-header" table-header-class="bg-header"
card-container-class="grid-three" card-container-class="grid-three"
flat flat
:style="isTableMode && `max-height: ${tableHeight}`" :style="isTableMode && `max-height: ${$props.tableHeight || tableHeight}`"
:virtual-scroll="isTableMode" :virtual-scroll="isTableMode"
@virtual-scroll="handleScroll" @virtual-scroll="handleScroll"
@row-click="(event, row) => handleRowClick(event, row)" @row-click="(event, row) => handleRowClick(event, row)"

View File

@ -0,0 +1,18 @@
import { onMounted, nextTick, ref } from 'vue';
export function useTableHeight() {
const tableHeight = ref('90vh');
onMounted(async () => {
await nextTick();
let height = 100;
Array.from(document.querySelectorAll('[role="toolbar"]'))
.filter((element) => window.getComputedStyle(element).display !== 'none')
.forEach(() => {
height -= 10;
});
tableHeight.value = `${height}vh`;
});
return tableHeight;
}

View File

@ -340,3 +340,6 @@ input::-webkit-inner-spin-button {
.containerShrinked { .containerShrinked {
width: 70%; width: 70%;
} }
.q-item__section--main ~ .q-item__section--side {
padding-inline: 0;
}

View File

@ -7,7 +7,7 @@ import FetchData from 'components/FetchData.vue';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue'; import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnSelect from 'src/components/common/VnSelect.vue'; import VnSelect from 'src/components/common/VnSelect.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import { QCheckbox } from 'quasar'; import VnCheckbox from 'src/components/common/VnCheckbox.vue';
import { useArrayData } from 'composables/useArrayData'; import { useArrayData } from 'composables/useArrayData';
import { useValidator } from 'src/composables/useValidator'; import { useValidator } from 'src/composables/useValidator';
@ -250,10 +250,9 @@ onMounted(async () => {
</QItemSection> </QItemSection>
</QItem> </QItem>
<!-- Tags filter --> <!-- Tags filter -->
<QItem class="row items-center"> <QItemLabel header>
<QItemLabel> {{ t('params.tags') }}
{{ t('params.tags') }}
</QItemLabel>
<QIcon <QIcon
name="add_circle" name="add_circle"
class="fill-icon-on-hover q-ml-md" class="fill-icon-on-hover q-ml-md"
@ -261,7 +260,7 @@ onMounted(async () => {
color="primary" color="primary"
@click="tagValues.push({})" @click="tagValues.push({})"
/> />
</QItem> </QItemLabel>
<QItem <QItem
v-for="(tag, index) in tagValues" v-for="(tag, index) in tagValues"
:key="index" :key="index"
@ -269,6 +268,7 @@ onMounted(async () => {
> >
<QItemSection class="col"> <QItemSection class="col">
<VnSelect <VnSelect
class="full-width"
:label="t('params.tag')" :label="t('params.tag')"
v-model="tag.selectedTag" v-model="tag.selectedTag"
:options="tagOptions" :options="tagOptions"
@ -316,25 +316,19 @@ onMounted(async () => {
/> />
</QItem> </QItem>
<!-- Filter fields --> <!-- Filter fields -->
<QItem class="row items-center"> <QItemLabel header
<QItemLabel> >{{ t('More fields') }}
{{ t('More fields') }}
</QItemLabel>
<QIcon <QIcon
name="add_circle" name="add_circle"
class="fill-icon-on-hover q-ml-md" class="fill-icon-on-hover q-ml-md"
size="sm" size="sm"
color="primary" color="primary"
@click="fieldFiltersValues.push({})" @click="fieldFiltersValues.push({})"
/> /></QItemLabel>
</QItem> <QItem v-for="(fieldFilter, index) in fieldFiltersValues" :key="index">
<QItem
v-for="(fieldFilter, index) in fieldFiltersValues"
:key="index"
class="row items-center"
>
<QItemSection class="col"> <QItemSection class="col">
<VnSelect <VnSelect
class="full-width"
:label="t('params.tag')" :label="t('params.tag')"
:model-value="fieldFilter.selectedField" :model-value="fieldFilter.selectedField"
:options="moreFields" :options="moreFields"
@ -355,7 +349,7 @@ onMounted(async () => {
/> />
</QItemSection> </QItemSection>
<QItemSection class="col"> <QItemSection class="col">
<QCheckbox <VnCheckbox
v-if="fieldFilter.selectedField?.type === 'boolean'" v-if="fieldFilter.selectedField?.type === 'boolean'"
v-model="fieldFilter.value" v-model="fieldFilter.value"
:label="t('params.value')" :label="t('params.value')"
@ -370,13 +364,14 @@ onMounted(async () => {
@keydown.enter="applyFieldFilters(params, searchFn)" @keydown.enter="applyFieldFilters(params, searchFn)"
/> />
</QItemSection> </QItemSection>
<QIcon <QItemSection side
name="delete" ><QIcon
class="fill-icon-on-hover q-ml-xs" name="delete"
size="sm" class="fill-icon-on-hover q-ml-xs"
color="primary" size="sm"
@click="removeFieldFilter(index, params, searchFn)" color="primary"
/> @click="removeFieldFilter(index, params, searchFn)"
/></QItemSection>
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>

View File

@ -99,6 +99,7 @@ const columns = computed(() => [
align: 'left', align: 'left',
label: t('globals.quantity'), label: t('globals.quantity'),
name: 'quantity', name: 'quantity',
class: 'shrink',
format: (row) => toCurrency(row.quantity), format: (row) => toCurrency(row.quantity),
}, },
{ {
@ -791,7 +792,7 @@ watch(
{{ row?.item?.subName.toUpperCase() }} {{ row?.item?.subName.toUpperCase() }}
</div> </div>
</div> </div>
<FetchedTags v-if="row.item" :item="row.item" :max-length="6" /> <FetchedTags v-if="row.item" :item="row.item" :columns="6" :max-length="6" />
<QPopupProxy v-if="row.id && isTicketEditable"> <QPopupProxy v-if="row.id && isTicketEditable">
<VnInput <VnInput
v-model="row.concept" v-model="row.concept"