7383-testToMaster #370

Merged
alexm merged 365 commits from 7383-testToMaster into master 2024-05-14 05:46:56 +00:00
4 changed files with 26 additions and 4 deletions
Showing only changes of commit c1ed4ab032 - Show all commits

View File

@ -145,7 +145,8 @@ const customTags = computed(() =>
);
async function remove(key) {
userParams.value[key] = null;
// userParams.value[key] = null;
if (userParams.value[key]) delete userParams.value[key];
await search();
emit('remove', key);
}

View File

@ -81,8 +81,10 @@ async function search() {
const staticParams = Object.entries(store.userParams).filter(
([key, value]) => value && (props.staticParams || []).includes(key)
);
// const filter =props?.where? { where: JSON.parse(props.where) }: {}
await arrayData.applyFilter({
params: {
// filter ,
...Object.fromEntries(staticParams),
search: searchText.value,
},

View File

@ -24,6 +24,17 @@ const redirectToItemTypeSummary = (id) => {
const redirectToCreateView = () => {
router.push({ name: 'ItemTypeCreate' });
};
const exprBuilder = (param, value) => {
switch (param) {
case 'name':
case 'code':
case 'search':
return {
name: { like: `%${value}%` },
code: { like: `%${value}%` },
};
}
};
</script>
<template>
@ -32,8 +43,10 @@ const redirectToCreateView = () => {
<VnSearchbar
data-key="ItemTypeList"
url="ItemTypes"
:label="t('Search item type')"
:label="t('Search item type')"
:redirect="false"
:info="t('Search itemType by id, name or code')"
:expr-builder="exprBuilder"
/>
</Teleport>
<Teleport to="#actions-append">
@ -54,7 +67,7 @@ const redirectToCreateView = () => {
</template>
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
<QScrollArea class="fit text-grey-8">
<ItemTypeFilter data-key="ItemTypes" />
<ItemTypeFilter data-key="ItemTypeList" :expr-builder="exprBuilder" />
</QScrollArea>
</QDrawer>
<QPage class="column items-center q-pa-md">

View File

@ -10,10 +10,16 @@ const props = defineProps({
required: true,
},
});
const emit = defineEmits(['search']);
</script>
<template>
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
<VnFilterPanel
:data-key="props.dataKey"
:search-button="true"
@search="emit('search')"
>
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
<strong>{{ t(`params.${tag.label}`) }}: </strong>