0
0
Fork 0

fix: refs #7354 fix zoneSearchbar

This commit is contained in:
Jon Elias 2024-08-12 14:28:35 +02:00
parent b955ded123
commit aefcfdba51
1 changed files with 43 additions and 11 deletions

View File

@ -1,17 +1,49 @@
<script setup> <script setup>
import { useStateStore } from 'stores/useStateStore'; import { useI18n } from 'vue-i18n';
import LeftMenu from 'src/components/LeftMenu.vue'; import VnSearchbar from 'components/ui/VnSearchbar.vue';
const stateStore = useStateStore(); const { t } = useI18n();
const exprBuilder = (param, value) => {
switch (param) {
case 'name':
return {
name: { like: `%${value}%` },
};
case 'code':
return {
code: { like: `%${value}%` },
};
case 'agencyModeFk':
return {
agencyModeFk: value,
};
case 'search':
if (value) {
if (!isNaN(value)) {
return { id: value };
} else {
return {
name: {
like: `%${value}%`,
},
};
}
}
}
};
</script> </script>
<template> <template>
<QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256"> <VnSearchbar
<QScrollArea class="fit text-grey-8"> data-key="ZoneList"
<LeftMenu /> url="Zones"
</QScrollArea> :filter="{
</QDrawer> include: { relation: 'agencyMode', scope: { fields: ['name'] } },
<QPageContainer> }"
<RouterView></RouterView> :expr-builder="exprBuilder"
</QPageContainer> :label="t('list.searchZone')"
:info="t('list.searchInfo')"
custom-route-redirect-name="ZoneSummary"
/>
</template> </template>