0
0
Fork 0

refs #7283 fix searchbar

This commit is contained in:
Carlos Satorres 2024-07-16 08:24:57 +02:00
parent daf99f4730
commit b7ba8eec3d
1 changed files with 21 additions and 20 deletions

View File

@ -3,11 +3,12 @@ import { onMounted, ref, computed, reactive, onUnmounted } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRouter, useRoute } from 'vue-router';
import VnImg from 'src/components/ui/VnImg.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import VnTable from 'components/VnTable/VnTable.vue';
import { useStateStore } from 'stores/useStateStore';
import { toDate } from 'src/filters';
import axios from 'axios';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
const entityId = computed(() => route.params.id);
const router = useRouter();
@ -212,16 +213,21 @@ const columns = computed(() => [
},
format: (row, dashIfEmpty) => dashIfEmpty(toDate(row.landed)),
},
{
align: 'right',
label: '',
name: 'tableActions',
actions: [
{
title: t('Clone item'),
icon: 'vn:clone',
action: cloneItem,
isPrimary: true,
},
],
},
]);
const redirectToItemCreate = () => {
router.push({ name: 'ItemCreate' });
};
const redirectToItemSummary = (id) => {
router.push({ name: 'ItemSummary', params: { id } });
};
const cloneItem = async (itemFk) => {
try {
const { data } = await axios.post(`Items/${itemFk}/clone`);
@ -236,16 +242,11 @@ onUnmounted(() => (stateStore.rightDrawer = false));
</script>
<template>
<!-- <VnSubToolbar>
<template #st-data>
<TableVisibleColumns
:all-columns="allColumnNames"
table-code="itemsIndex"
labels-traductions-path="item.list"
@on-config-saved="visibleColumns = ['picture', ...$event, 'actions']"
/>
</template>
</VnSubToolbar> -->
<VnSearchbar
data-key="ItemList"
:label="t('Search Item')"
:info="t('You can search by id')"
/>
<VnTable
ref="tableRef"
data-key="ItemList"
@ -265,7 +266,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
:columns="columns"
auto-load
redirect="Item"
:right-search="false"
:right-search="true"
:is-editable="false"
:use-model="true"
/>