refactor: refs #8322 changed ZoneList component to use VnSection/VnCardBeta
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
bd5daa8368
commit
9911137725
|
@ -1,13 +1,10 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import VnCard from 'components/common/VnCard.vue';
|
import VnCardBeta from 'src/components/common/VnCardBeta.vue';
|
||||||
import ZoneDescriptor from './ZoneDescriptor.vue';
|
import ZoneDescriptor from './ZoneDescriptor.vue';
|
||||||
import ZoneFilterPanel from '../ZoneFilterPanel.vue';
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const routeName = computed(() => route.name);
|
const routeName = computed(() => route.name);
|
||||||
|
|
||||||
|
@ -18,21 +15,5 @@ function notIsLocations(ifIsFalse, ifIsTrue) {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnCard
|
<VnCardBeta data-key="zone" base-url="Zones" :descriptor="ZoneDescriptor" />
|
||||||
data-key="zone"
|
|
||||||
:base-url="notIsLocations('Zones', undefined)"
|
|
||||||
:descriptor="ZoneDescriptor"
|
|
||||||
:filter-panel="notIsLocations(ZoneFilterPanel, undefined)"
|
|
||||||
:search-data-key="notIsLocations('ZoneList', undefined)"
|
|
||||||
:searchbar-props="{
|
|
||||||
url: notIsLocations('Zones', 'ZoneLocations'),
|
|
||||||
label: notIsLocations(t('list.searchZone'), t('list.searchLocation')),
|
|
||||||
info: t('list.searchInfo'),
|
|
||||||
whereFilter: notIsLocations((value) => {
|
|
||||||
return /^\d+$/.test(value)
|
|
||||||
? { id: value }
|
|
||||||
: { name: { like: `%${value}%` } };
|
|
||||||
}),
|
|
||||||
}"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -14,9 +14,8 @@ import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnInputTime from 'src/components/common/VnInputTime.vue';
|
import VnInputTime from 'src/components/common/VnInputTime.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
|
||||||
import ZoneFilterPanel from './ZoneFilterPanel.vue';
|
import ZoneFilterPanel from './ZoneFilterPanel.vue';
|
||||||
import ZoneSearchbar from './Card/ZoneSearchbar.vue';
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -25,6 +24,7 @@ const { viewSummary } = useSummaryDialog();
|
||||||
const { openConfirmationModal } = useVnConfirm();
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const warehouseOptions = ref([]);
|
const warehouseOptions = ref([]);
|
||||||
|
const dataKey = 'ZoneList';
|
||||||
|
|
||||||
const tableFilter = {
|
const tableFilter = {
|
||||||
include: [
|
include: [
|
||||||
|
@ -132,26 +132,41 @@ const handleClone = (id) => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ZoneSearchbar />
|
<VnSection
|
||||||
<RightMenu>
|
:data-key="dataKey"
|
||||||
<template #right-panel>
|
:columns="columns"
|
||||||
|
prefix="list"
|
||||||
|
:array-data-props="{
|
||||||
|
url: 'Zones',
|
||||||
|
order: ['id'],
|
||||||
|
exprBuilder,
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<template #rightMenu>
|
||||||
<ZoneFilterPanel data-key="ZonesList" />
|
<ZoneFilterPanel data-key="ZonesList" />
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
<template #body>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="ZonesList"
|
data-key="dataKey"
|
||||||
url="Zones"
|
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'Zones',
|
urlCreate: 'Zones',
|
||||||
title: t('list.createZone'),
|
title: t('list.createZone'),
|
||||||
onDataSaved: ({ id }) => tableRef.redirect(`${id}/location`),
|
onDataSaved: ({ id }) => tableRef.redirect(`${id}/location`),
|
||||||
formInitialData: {},
|
formInitialData: {},
|
||||||
}"
|
}"
|
||||||
:user-filter="tableFilter"
|
default-mode="table"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
redirect="zone"
|
:user-filter="tableFilter"
|
||||||
|
:user-params="userParams"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
|
redirect="zone"
|
||||||
|
v-model:selected="selectedRows"
|
||||||
|
:table="{
|
||||||
|
'row-key': 'id',
|
||||||
|
slelection: 'multiple',
|
||||||
|
}"
|
||||||
|
data-cy="zoneListTable"
|
||||||
>
|
>
|
||||||
<template #more-create-dialog="{ data }">
|
<template #more-create-dialog="{ data }">
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
@ -196,8 +211,11 @@ const handleClone = (id) => {
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
|
</template>
|
||||||
|
</VnSection>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Search zone: Buscar zona
|
Search zone: Buscar zona
|
||||||
|
|
|
@ -24,7 +24,7 @@ list:
|
||||||
price: Price
|
price: Price
|
||||||
create: Create zone
|
create: Create zone
|
||||||
openSummary: Details
|
openSummary: Details
|
||||||
searchZone: Search zones
|
search: Search zones
|
||||||
searchLocation: Search locations
|
searchLocation: Search locations
|
||||||
searchInfo: Search zone by id or name
|
searchInfo: Search zone by id or name
|
||||||
confirmCloneTitle: All it's properties will be copied
|
confirmCloneTitle: All it's properties will be copied
|
||||||
|
|
|
@ -1,24 +1,12 @@
|
||||||
import { RouterView } from 'vue-router';
|
import { RouterView } from 'vue-router';
|
||||||
|
|
||||||
export default {
|
const zoneCard = {
|
||||||
path: '/zone',
|
|
||||||
name: 'Zone',
|
name: 'Zone',
|
||||||
|
path: '/zone',
|
||||||
|
component: () => import('src/pages/Zone/Card/ZoneCard.vue'),
|
||||||
|
redirect: { name: 'ZoneSummary' },
|
||||||
meta: {
|
meta: {
|
||||||
title: 'zones',
|
menu: [
|
||||||
icon: 'vn:zone',
|
|
||||||
moduleName: 'Zone',
|
|
||||||
keyBinding: 'z',
|
|
||||||
},
|
|
||||||
component: RouterView,
|
|
||||||
redirect: { name: 'ZoneMain' },
|
|
||||||
menus: {
|
|
||||||
main: [
|
|
||||||
'ZoneList',
|
|
||||||
'ZoneDeliveryDays',
|
|
||||||
'ZoneUpcomingList',
|
|
||||||
'ZoneUpcomingDeliveries',
|
|
||||||
],
|
|
||||||
card: [
|
|
||||||
'ZoneBasicData',
|
'ZoneBasicData',
|
||||||
'ZoneWarehouses',
|
'ZoneWarehouses',
|
||||||
'ZoneHistory',
|
'ZoneHistory',
|
||||||
|
@ -26,21 +14,99 @@ export default {
|
||||||
'ZoneEvents',
|
'ZoneEvents',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: 'ZoneSummary',
|
||||||
|
path: 'summary',
|
||||||
|
meta: {
|
||||||
|
title: 'summary',
|
||||||
|
icon: 'launch',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Zone/Card/ZoneSummary.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'ZoneBasicData',
|
||||||
|
path: 'basic-data',
|
||||||
|
meta: {
|
||||||
|
title: 'basicData',
|
||||||
|
icon: 'vn:settings',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Zone/Card/ZoneBasicData.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'ZoneLocations',
|
||||||
|
path: 'location',
|
||||||
|
meta: {
|
||||||
|
title: 'locations',
|
||||||
|
icon: 'my_location',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Zone/Card/ZoneLocations.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'ZoneWarehouses',
|
||||||
|
path: 'warehouses',
|
||||||
|
meta: {
|
||||||
|
title: 'warehouses',
|
||||||
|
icon: 'home',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Zone/Card/ZoneWarehouses.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'ZoneHistory',
|
||||||
|
path: 'log',
|
||||||
|
meta: {
|
||||||
|
title: 'log',
|
||||||
|
icon: 'history',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Zone/Card/ZoneLog.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'ZoneEvents',
|
||||||
|
path: 'events',
|
||||||
|
meta: {
|
||||||
|
title: 'calendar',
|
||||||
|
icon: 'vn:calendar',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Zone/Card/ZoneEvents.vue'),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'Zone',
|
||||||
|
path: '/zone',
|
||||||
|
meta: {
|
||||||
|
title: 'zones',
|
||||||
|
icon: 'vn:zone',
|
||||||
|
moduleName: 'Zone',
|
||||||
|
keyBinding: 'z',
|
||||||
|
menu: ['ZoneList', 'ZoneDeliveryDays', 'ZoneUpcomingList', 'ZoneUpcomingDeliveries',],
|
||||||
|
},
|
||||||
|
component: RouterView,
|
||||||
|
redirect: { name: 'ZoneMain' },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '/zone',
|
path: '/zone',
|
||||||
name: 'ZoneMain',
|
name: 'ZoneMain',
|
||||||
component: () => import('src/components/common/VnModule.vue'),
|
component: () => import('src/components/common/VnModule.vue'),
|
||||||
redirect: { name: 'ZoneList' },
|
redirect: { name: 'ZoneIndexMain' },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'list',
|
path: '',
|
||||||
name: 'ZoneList',
|
name: 'ZoneIndexMain',
|
||||||
meta: {
|
redirect: { name: 'ZoneList' },
|
||||||
title: 'zonesList',
|
|
||||||
icon: 'view_list',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Zone/ZoneList.vue'),
|
component: () => import('src/pages/Zone/ZoneList.vue'),
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: 'ZoneList',
|
||||||
|
path: 'list',
|
||||||
|
meta: {
|
||||||
|
title: 'list',
|
||||||
|
icon: 'view_list',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
zoneCard,
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'delivery-days',
|
path: 'delivery-days',
|
||||||
|
@ -62,67 +128,5 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'ZoneCard',
|
|
||||||
path: ':id',
|
|
||||||
component: () => import('src/pages/Zone/Card/ZoneCard.vue'),
|
|
||||||
redirect: { name: 'ZoneSummary' },
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: 'ZoneSummary',
|
|
||||||
path: 'summary',
|
|
||||||
meta: {
|
|
||||||
title: 'summary',
|
|
||||||
icon: 'launch',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Zone/Card/ZoneSummary.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'ZoneBasicData',
|
|
||||||
path: 'basic-data',
|
|
||||||
meta: {
|
|
||||||
title: 'basicData',
|
|
||||||
icon: 'vn:settings',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Zone/Card/ZoneBasicData.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'ZoneLocations',
|
|
||||||
path: 'location',
|
|
||||||
meta: {
|
|
||||||
title: 'locations',
|
|
||||||
icon: 'my_location',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Zone/Card/ZoneLocations.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'ZoneWarehouses',
|
|
||||||
path: 'warehouses',
|
|
||||||
meta: {
|
|
||||||
title: 'warehouses',
|
|
||||||
icon: 'home',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Zone/Card/ZoneWarehouses.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'ZoneHistory',
|
|
||||||
path: 'log',
|
|
||||||
meta: {
|
|
||||||
title: 'log',
|
|
||||||
icon: 'history',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Zone/Card/ZoneLog.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'ZoneEvents',
|
|
||||||
path: 'events',
|
|
||||||
meta: {
|
|
||||||
title: 'calendar',
|
|
||||||
icon: 'vn:calendar',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Zone/Card/ZoneEvents.vue'),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue