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