7383-testToMaster #370
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue