refactor: refs #8322 update WagonCard component and routing structure
This commit is contained in:
parent
57c2cc1baf
commit
94918011e6
|
@ -2,5 +2,5 @@
|
||||||
import VnCardBeta from 'src/components/common/VnCardBeta.vue';
|
import VnCardBeta from 'src/components/common/VnCardBeta.vue';
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnCardBeta data-key="Wagon" url="Wagons" :descriptor="WagonDescriptor" />
|
<VnCardBeta data-key="Wagon" url="Wagons" :descriptor="{}" />
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -77,7 +77,6 @@ function navigate(id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function remove(row) {
|
async function remove(row) {
|
||||||
try {
|
|
||||||
await axios.delete(`Wagons/${row.id}`).then(async () => {
|
await axios.delete(`Wagons/${row.id}`).then(async () => {
|
||||||
quasar.notify({
|
quasar.notify({
|
||||||
message: t('wagon.list.removeItem'),
|
message: t('wagon.list.removeItem'),
|
||||||
|
@ -86,12 +85,8 @@ async function remove(row) {
|
||||||
store.data.splice(store.data.indexOf(row), 1);
|
store.data.splice(store.data.indexOf(row), 1);
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
});
|
});
|
||||||
} catch (error) {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QPage class="column items-center q-pa-md">
|
<QPage class="column items-center q-pa-md">
|
||||||
<VnSection
|
<VnSection
|
||||||
|
@ -119,6 +114,7 @@ async function remove(row) {
|
||||||
:column-search="false"
|
:column-search="false"
|
||||||
:default-mode="'card'"
|
:default-mode="'card'"
|
||||||
:disable-option="{ table: true }"
|
:disable-option="{ table: true }"
|
||||||
|
:right-search="false"
|
||||||
>
|
>
|
||||||
<template #more-create-dialog="{ data }">
|
<template #more-create-dialog="{ data }">
|
||||||
<VnInput
|
<VnInput
|
||||||
|
@ -141,7 +137,9 @@ async function remove(row) {
|
||||||
:label="t('wagon.list.volume')"
|
:label="t('wagon.list.volume')"
|
||||||
type="number"
|
type="number"
|
||||||
min="0"
|
min="0"
|
||||||
:rules="[(val) => !!val || t('wagon.warnings.volumeNotEmpty')]"
|
:rules="[
|
||||||
|
(val) => !!val || t('wagon.warnings.volumeNotEmpty'),
|
||||||
|
]"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
url="WagonTypes"
|
url="WagonTypes"
|
||||||
|
|
|
@ -1,17 +1,23 @@
|
||||||
import { RouterView } from 'vue-router';
|
import { RouterView } from 'vue-router';
|
||||||
|
|
||||||
const wagonCard = {
|
const wagonCard = {
|
||||||
|
|
||||||
name: 'WagonCard',
|
name: 'WagonCard',
|
||||||
path: ':id',
|
path: ':id',
|
||||||
component: () => import('src/pages/Ticket/Card/WagonCard.vue'),
|
component: () => import('src/pages/Wagon/Card/WagonCard.vue'),
|
||||||
redirect: { name: 'WagonSummary' },
|
redirect: { name: 'WagonEdit' },
|
||||||
meta: {
|
meta: {
|
||||||
//main: ['WagonList', 'WagonTypeList', 'WagonCounter', 'WagonTray'],
|
menu: ['WagonEdit'],
|
||||||
menu: [],
|
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{},
|
{
|
||||||
|
path: 'edit',
|
||||||
|
name: 'WagonEdit',
|
||||||
|
meta: {
|
||||||
|
title: 'wagonEdit',
|
||||||
|
icon: 'edit',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Wagon/WagonCreate.vue'),
|
||||||
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -23,7 +29,7 @@ export default {
|
||||||
icon: 'vn:trolley',
|
icon: 'vn:trolley',
|
||||||
moduleName: 'Wagon',
|
moduleName: 'Wagon',
|
||||||
keyBinding: 'w',
|
keyBinding: 'w',
|
||||||
menu: ['WagonList', 'WagonTypeList', 'WagonCounter', 'WagonTray'],
|
menu: ['WagonList', 'WagonTypeList', 'WagonCounter'],
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'WagonMain' },
|
redirect: { name: 'WagonMain' },
|
||||||
|
@ -48,26 +54,8 @@ export default {
|
||||||
icon: 'view_list',
|
icon: 'view_list',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
wagonCard,
|
||||||
]
|
],
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'create',
|
|
||||||
name: 'WagonCreate',
|
|
||||||
meta: {
|
|
||||||
title: 'wagonCreate',
|
|
||||||
icon: 'create',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Wagon/WagonCreate.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: ':id/edit',
|
|
||||||
name: 'WagonEdit',
|
|
||||||
meta: {
|
|
||||||
title: 'wagonEdit',
|
|
||||||
icon: 'edit',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Wagon/WagonCreate.vue'),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'counter',
|
path: 'counter',
|
||||||
|
@ -78,12 +66,9 @@ export default {
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Wagon/WagonCounter.vue'),
|
component: () => import('src/pages/Wagon/WagonCounter.vue'),
|
||||||
},
|
},
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: '/wagon/type',
|
path: 'type',
|
||||||
name: 'WagonTypeMain',
|
name: 'WagonTypeMain',
|
||||||
component: () => import('src/components/common/VnModule.vue'),
|
|
||||||
redirect: { name: 'WagonTypeList' },
|
redirect: { name: 'WagonTypeList' },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
@ -93,16 +78,8 @@ export default {
|
||||||
title: 'typesList',
|
title: 'typesList',
|
||||||
icon: 'view_list',
|
icon: 'view_list',
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Wagon/Type/WagonTypeList.vue'),
|
component: () =>
|
||||||
},
|
import('src/pages/Wagon/Type/WagonTypeList.vue'),
|
||||||
{
|
|
||||||
path: 'create',
|
|
||||||
name: 'WagonTypeCreate',
|
|
||||||
meta: {
|
|
||||||
title: 'typeCreate',
|
|
||||||
icon: 'create',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Wagon/Type/WagonTypeList.vue'),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':id/edit',
|
path: ':id/edit',
|
||||||
|
@ -111,7 +88,10 @@ export default {
|
||||||
title: 'typeEdit',
|
title: 'typeEdit',
|
||||||
icon: 'edit',
|
icon: 'edit',
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Wagon/Type/WagonTypeEdit.vue'),
|
component: () =>
|
||||||
|
import('src/pages/Wagon/Type/WagonTypeEdit.vue'),
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue