8282-testToMaster #1057
|
@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { toDate } from 'src/filters';
|
import { toDate } from 'src/filters';
|
||||||
|
|
||||||
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
import EntryLatestBuysFilter from './EntryLatestBuysFilter.vue';
|
import EntryLatestBuysFilter from './EntryLatestBuysFilter.vue';
|
||||||
|
@ -12,6 +13,9 @@ import VnImg from 'src/components/ui/VnImg.vue';
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const tableRef = ref();
|
||||||
|
const arrayData = useArrayData('LatestBuys', { searchUrl: 'Buys/latestBuysFilter' });
|
||||||
|
const lastParams = {};
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
@ -234,13 +238,26 @@ const columns = [
|
||||||
format: (row, dashIfEmpty) => dashIfEmpty(toDate(row.landing)),
|
format: (row, dashIfEmpty) => dashIfEmpty(toDate(row.landing)),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const tableRef = ref();
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
stateStore.rightDrawer = true;
|
stateStore.rightDrawer = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
|
|
||||||
|
const onTabPressed = async () => {
|
||||||
|
let params = tableRef.value.params;
|
||||||
|
|
||||||
|
if (
|
||||||
|
Object.keys(params).length > 0 &&
|
||||||
|
JSON.stringify(params) !== JSON.stringify(lastParams)
|
||||||
|
) {
|
||||||
|
Object.assign(lastParams, params);
|
||||||
|
|
||||||
|
await arrayData.addFilter({ filter: { where: params } });
|
||||||
|
}
|
||||||
|
params = {};
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -260,6 +277,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
:row-click="({ entryFk }) => tableRef.redirect(entryFk)"
|
:row-click="({ entryFk }) => tableRef.redirect(entryFk)"
|
||||||
auto-load
|
auto-load
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
|
@keydown.tab="onTabPressed"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue