refactor: #8322 changed Route component to use VnSection/VnCardBeta #1141
|
@ -1,19 +1,8 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import VnCard from 'components/common/VnCard.vue';
|
|
||||||
import RouteDescriptor from 'pages/Route/Card/RouteDescriptor.vue';
|
import RouteDescriptor from 'pages/Route/Card/RouteDescriptor.vue';
|
||||||
import RouteFilter from './RouteFilter.vue';
|
import VnCardBeta from 'src/components/common/VnCardBeta.vue';
|
||||||
import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue';
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnCard
|
<VnCardBeta data-key="Route" base-url="Routes" :descriptor="RouteDescriptor" />
|
||||||
data-key="Route"
|
|
||||||
base-url="Routes"
|
|
||||||
:descriptor="RouteDescriptor"
|
|
||||||
:filter-panel="RouteFilter"
|
|
||||||
search-data-key="RouteList"
|
|
||||||
>
|
|
||||||
<template #searchbar>
|
|
||||||
<RouteSearchbar />
|
|
||||||
</template>
|
|
||||||
</VnCard>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -3,17 +3,16 @@ import { computed, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import { toHour } from 'src/filters';
|
import { toHour } from 'src/filters';
|
||||||
|
|
||||||
import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue';
|
|
||||||
import RouteSummary from 'pages/Route/Card/RouteSummary.vue';
|
import RouteSummary from 'pages/Route/Card/RouteSummary.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
|
||||||
import RouteFilter from 'pages/Route/Card/RouteFilter.vue';
|
import RouteFilter from 'pages/Route/Card/RouteFilter.vue';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const tableRef = ref([]);
|
const tableRef = ref([]);
|
||||||
|
const dataKey = 'RouteList';
|
||||||
const routeFilter = {
|
const routeFilter = {
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
|
@ -110,32 +109,39 @@ const columns = computed(() => [
|
||||||
]);
|
]);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<RouteSearchbar />
|
<VnSection
|
||||||
<RightMenu>
|
:data-key="dataKey"
|
||||||
<template #right-panel>
|
:columns="columns"
|
||||||
|
prefix="route"
|
||||||
|
:array-data-props="{
|
||||||
|
url: 'Routes/filter',
|
||||||
|
userFilter: routeFilter,
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<template #rightMenu>
|
||||||
<RouteFilter data-key="RouteList" />
|
<RouteFilter data-key="RouteList" />
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
<template #body>
|
||||||
<VnTable
|
<VnTable
|
||||||
data-key="RouteList"
|
:data-key="dataKey"
|
||||||
url="Routes/filter"
|
:columns="columns"
|
||||||
:columns="columns"
|
:right-search="false"
|
||||||
:right-search="false"
|
redirect="route"
|
||||||
:filter="routeFilter"
|
:create="{
|
||||||
redirect="route"
|
urlCreate: 'Routes',
|
||||||
:create="{
|
title: t('route.createRoute'),
|
||||||
urlCreate: 'Routes',
|
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||||
title: t('route.createRoute'),
|
formInitialData: {},
|
||||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
}"
|
||||||
formInitialData: {},
|
table-height="85vh"
|
||||||
}"
|
>
|
||||||
table-height="85vh"
|
<template #column-workerFk="{ row }">
|
||||||
>
|
<span class="link" @click.stop>
|
||||||
<template #column-workerFk="{ row }">
|
{{ row?.workerUserName }}
|
||||||
<span class="link" @click.stop>
|
<WorkerDescriptorProxy :id="row?.workerFk" v-if="row?.workerFk" />
|
||||||
{{ row?.workerUserName }}
|
</span>
|
||||||
<WorkerDescriptorProxy :id="row?.workerFk" v-if="row?.workerFk" />
|
</template>
|
||||||
</span>
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnSection>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -37,6 +37,8 @@ route:
|
||||||
Summary: Summary
|
Summary: Summary
|
||||||
Route is closed: Route is closed
|
Route is closed: Route is closed
|
||||||
Route is not served: Route is not served
|
Route is not served: Route is not served
|
||||||
|
search: Search route
|
||||||
|
searchInfo: You can search by route reference
|
||||||
cmr:
|
cmr:
|
||||||
list:
|
list:
|
||||||
results: results
|
results: results
|
||||||
|
|
|
@ -37,6 +37,8 @@ route:
|
||||||
Summary: Resumen
|
Summary: Resumen
|
||||||
Route is closed: La ruta está cerrada
|
Route is closed: La ruta está cerrada
|
||||||
Route is not served: La ruta no está servida
|
Route is not served: La ruta no está servida
|
||||||
|
search: Buscar rutas
|
||||||
|
searchInfo: Puedes buscar por referencia de la ruta
|
||||||
cmr:
|
cmr:
|
||||||
list:
|
list:
|
||||||
results: resultados
|
results: resultados
|
||||||
|
|
|
@ -1,41 +1,87 @@
|
||||||
import { RouterView } from 'vue-router';
|
import { RouterView } from 'vue-router';
|
||||||
|
|
||||||
|
const routeCard = {
|
||||||
|
name: 'RouteCard',
|
||||||
|
path: ':id',
|
||||||
|
component: () => import('src/pages/Route/Card/RouteCard.vue'),
|
||||||
|
redirect: { name: 'RouteSummary' },
|
||||||
|
meta: {
|
||||||
|
menu: ['RouteBasicData', 'RouteTickets', 'RouteLog'],
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: 'RouteBasicData',
|
||||||
|
path: 'basic-data',
|
||||||
|
meta: {
|
||||||
|
title: 'basicData',
|
||||||
|
icon: 'vn:settings',
|
||||||
|
},
|
||||||
|
component: () => import('pages/Route/Card/RouteForm.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'RouteSummary',
|
||||||
|
path: 'summary',
|
||||||
|
meta: {
|
||||||
|
title: 'summary',
|
||||||
|
icon: 'open_in_new',
|
||||||
|
},
|
||||||
|
component: () => import('pages/Route/Card/RouteSummary.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'tickets',
|
||||||
|
name: 'RouteTickets',
|
||||||
|
meta: {
|
||||||
|
title: 'tickets',
|
||||||
|
icon: 'vn:ticket',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Route/RouteTickets.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'log',
|
||||||
|
name: 'RouteLog',
|
||||||
|
meta: {
|
||||||
|
title: 'log',
|
||||||
|
icon: 'vn:History',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Route/RouteLog.vue'),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: '/route',
|
|
||||||
name: 'Route',
|
name: 'Route',
|
||||||
|
path: '/route',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'routes',
|
title: 'routes',
|
||||||
icon: 'vn:delivery',
|
icon: 'vn:delivery',
|
||||||
moduleName: 'Route',
|
moduleName: 'Route',
|
||||||
|
menu: ['RouteList', 'RouteExtendedList', 'RouteAutonomous', 'RouteRoadmap', 'CmrList', 'AgencyList'],
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'RouteMain' },
|
redirect: { name: 'RouteMain' },
|
||||||
menus: {
|
|
||||||
main: [
|
|
||||||
'RouteList',
|
|
||||||
'RouteExtendedList',
|
|
||||||
'RouteAutonomous',
|
|
||||||
'RouteRoadmap',
|
|
||||||
'CmrList',
|
|
||||||
'AgencyList',
|
|
||||||
],
|
|
||||||
card: ['RouteBasicData', 'RouteTickets', 'RouteLog'],
|
|
||||||
},
|
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '/route',
|
|
||||||
name: 'RouteMain',
|
name: 'RouteMain',
|
||||||
|
path: '',
|
||||||
component: () => import('src/components/common/VnModule.vue'),
|
component: () => import('src/components/common/VnModule.vue'),
|
||||||
redirect: { name: 'RouteList' },
|
redirect: { name: 'RouteIndexMain' },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'list',
|
path: '',
|
||||||
name: 'RouteList',
|
name: 'RouteIndexMain',
|
||||||
meta: {
|
redirect: { name: 'RouteList' },
|
||||||
title: 'RouteList',
|
|
||||||
icon: 'view_list',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Route/RouteList.vue'),
|
component: () => import('src/pages/Route/RouteList.vue'),
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: 'RouteList',
|
||||||
|
path: 'list',
|
||||||
|
meta: {
|
||||||
|
title: 'list',
|
||||||
|
icon: 'view_list',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
routeCard,
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'extended-list',
|
path: 'extended-list',
|
||||||
|
@ -100,49 +146,5 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'RouteCard',
|
|
||||||
path: ':id',
|
|
||||||
component: () => import('src/pages/Route/Card/RouteCard.vue'),
|
|
||||||
redirect: { name: 'RouteSummary' },
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: 'RouteBasicData',
|
|
||||||
path: 'basic-data',
|
|
||||||
meta: {
|
|
||||||
title: 'basicData',
|
|
||||||
icon: 'vn:settings',
|
|
||||||
},
|
|
||||||
component: () => import('pages/Route/Card/RouteForm.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'RouteSummary',
|
|
||||||
path: 'summary',
|
|
||||||
meta: {
|
|
||||||
title: 'summary',
|
|
||||||
icon: 'open_in_new',
|
|
||||||
},
|
|
||||||
component: () => import('pages/Route/Card/RouteSummary.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'tickets',
|
|
||||||
name: 'RouteTickets',
|
|
||||||
meta: {
|
|
||||||
title: 'tickets',
|
|
||||||
icon: 'vn:ticket',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Route/RouteTickets.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'log',
|
|
||||||
name: 'RouteLog',
|
|
||||||
meta: {
|
|
||||||
title: 'log',
|
|
||||||
icon: 'vn:History',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Route/RouteLog.vue'),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue