feat: refs #6123 enhance VnColumn and ZoneControl optimized data fetching

This commit is contained in:
Pablo Natek 2025-05-09 10:07:56 +02:00
parent 52ac804c1d
commit 8b598eba86
2 changed files with 13 additions and 4 deletions

View File

@ -129,6 +129,7 @@ const defaultComponents = {
forceAttrs: { forceAttrs: {
label, label,
autofocus: true, autofocus: true,
size: 'sm',
}, },
events: { events: {
blur: () => emit('blur'), blur: () => emit('blur'),
@ -154,6 +155,9 @@ const defaultComponents = {
}, },
toggle: { toggle: {
component: markRaw(QToggle), component: markRaw(QToggle),
forceAttrs: {
size: 'sm',
},
}, },
}; };

View File

@ -95,10 +95,15 @@ const columns = computed(() => [
component: 'checkbox', component: 'checkbox',
cellEvent: { cellEvent: {
'update:modelValue': async (value, oldValue, row) => { 'update:modelValue': async (value, oldValue, row) => {
const filter = {
where: {
zoneFk: row.zoneFk,
type: 'day',
dated: row.landed,
},
};
const zoneEvent = await axios.get('ZoneEvents', { const zoneEvent = await axios.get('ZoneEvents', {
zoneFk: row.zoneFk, params: { filter: JSON.stringify(filter) },
type: 'day',
dated: row.landed,
}); });
console.log('zoneEvent: ', zoneEvent); console.log('zoneEvent: ', zoneEvent);
@ -132,7 +137,7 @@ function expressAsPercent(value) {
function progressStyle(value) { function progressStyle(value) {
if (value < 1 && value) return 'color: var(--q-negative)'; if (value < 1 && value) return 'color: var(--q-negative)';
return 'color: var(--q-positive)'; if (value === 1) return 'color: var(--q-positive)';
} }
</script> </script>
<template> <template>