feat: refs #8322 fix route.js and unify with /roadmap
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
f7e0fbf728
commit
6a9bbd93e8
|
@ -18,22 +18,6 @@ const props = defineProps({
|
||||||
const emit = defineEmits(['search']);
|
const emit = defineEmits(['search']);
|
||||||
|
|
||||||
const supplierList = ref([]);
|
const supplierList = ref([]);
|
||||||
const exprBuilder = (param, value) => {
|
|
||||||
switch (param) {
|
|
||||||
case 'tractorPlate':
|
|
||||||
case 'trailerPlate':
|
|
||||||
case 'driverName':
|
|
||||||
case 'phone':
|
|
||||||
return { [param]: { like: `%${value}%` } };
|
|
||||||
case 'supplierFk':
|
|
||||||
case 'price':
|
|
||||||
return { [param]: value };
|
|
||||||
case 'from':
|
|
||||||
return { etd: { gte: value } };
|
|
||||||
case 'to':
|
|
||||||
return { etd: { lte: value } };
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -48,7 +32,6 @@ const exprBuilder = (param, value) => {
|
||||||
<VnFilterPanel
|
<VnFilterPanel
|
||||||
:data-key="props.dataKey"
|
:data-key="props.dataKey"
|
||||||
:search-button="true"
|
:search-button="true"
|
||||||
:expr-builder="exprBuilder"
|
|
||||||
@search="emit('search')"
|
@search="emit('search')"
|
||||||
>
|
>
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn }">
|
||||||
|
|
|
@ -16,6 +16,7 @@ import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import VnInputTime from 'src/components/common/VnInputTime.vue';
|
import VnInputTime from 'src/components/common/VnInputTime.vue';
|
||||||
import VnSection from 'src/components/common/VnSection.vue';
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
|
import RoadmapFilter from './Roadmap/RoadmapFilter.vue';
|
||||||
|
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -130,6 +131,25 @@ function confirmRemove() {
|
||||||
})
|
})
|
||||||
.onOk(() => tableRef.value++);
|
.onOk(() => tableRef.value++);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function exprBuilder(param, value) {
|
||||||
|
switch (param) {
|
||||||
|
case 'search':
|
||||||
|
return /^\d+$/.test(value) ? { id: value } : { name: { like: `%${value}%` } };
|
||||||
|
case 'tractorPlate':
|
||||||
|
case 'trailerPlate':
|
||||||
|
case 'driverName':
|
||||||
|
case 'phone':
|
||||||
|
return { [param]: { like: `%${value}%` } };
|
||||||
|
case 'supplierFk':
|
||||||
|
case 'price':
|
||||||
|
return { [param]: value };
|
||||||
|
case 'from':
|
||||||
|
return { etd: { gte: value } };
|
||||||
|
case 'to':
|
||||||
|
return { etd: { lte: value } };
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -175,19 +195,23 @@ function confirmRemove() {
|
||||||
</template>
|
</template>
|
||||||
</VnSubToolbar>
|
</VnSubToolbar>
|
||||||
<VnSection
|
<VnSection
|
||||||
:data-key="dataKey"
|
:data-key
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
prefix="route.roadmap"
|
prefix="route.roadmap"
|
||||||
:array-data-props="{
|
:array-data-props="{
|
||||||
url: 'roadmaps',
|
url: 'roadmaps',
|
||||||
|
exprBuilder,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
|
<template #advanced-menu>
|
||||||
|
<RoadmapFilter :dataKey />
|
||||||
|
</template>
|
||||||
<template #body>
|
<template #body>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
:data-key="dataKey"
|
:data-key
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:right-search="true"
|
:right-search="false"
|
||||||
:use-model="true"
|
:use-model="true"
|
||||||
default-mode="table"
|
default-mode="table"
|
||||||
v-model:selected="selectedRows"
|
v-model:selected="selectedRows"
|
||||||
|
|
|
@ -12,7 +12,6 @@ import Supplier from './supplier';
|
||||||
import Travel from './travel';
|
import Travel from './travel';
|
||||||
import Order from './order';
|
import Order from './order';
|
||||||
import Entry from './entry';
|
import Entry from './entry';
|
||||||
import roadmap from './roadmap';
|
|
||||||
import Zone from './zone';
|
import Zone from './zone';
|
||||||
import Account from './account';
|
import Account from './account';
|
||||||
import Monitor from './monitor';
|
import Monitor from './monitor';
|
||||||
|
@ -32,7 +31,6 @@ export default [
|
||||||
Order,
|
Order,
|
||||||
invoiceIn,
|
invoiceIn,
|
||||||
Entry,
|
Entry,
|
||||||
roadmap,
|
|
||||||
Zone,
|
Zone,
|
||||||
Account,
|
Account,
|
||||||
Monitor,
|
Monitor,
|
||||||
|
|
|
@ -1,79 +0,0 @@
|
||||||
import { RouterView } from 'vue-router';
|
|
||||||
|
|
||||||
const roadmapCard = {
|
|
||||||
path: ':id',
|
|
||||||
name: 'RoadmapCard',
|
|
||||||
component: () => import('src/pages/Route/Roadmap/RoadmapCard.vue'),
|
|
||||||
redirect: { name: 'RoadmapSummary' },
|
|
||||||
meta: {
|
|
||||||
menu: ['RoadmapBasicData', 'RoadmapStops'],
|
|
||||||
},
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: 'RoadmapSummary',
|
|
||||||
path: 'summary',
|
|
||||||
meta: {
|
|
||||||
title: 'summary',
|
|
||||||
icon: 'open_in_new',
|
|
||||||
},
|
|
||||||
component: () => import('pages/Route/Roadmap/RoadmapSummary.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'RoadmapBasicData',
|
|
||||||
path: 'basic-data',
|
|
||||||
meta: {
|
|
||||||
title: 'basicData',
|
|
||||||
icon: 'vn:settings',
|
|
||||||
},
|
|
||||||
component: () => import('pages/Route/Roadmap/RoadmapBasicData.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'RoadmapStops',
|
|
||||||
path: 'stops',
|
|
||||||
meta: {
|
|
||||||
title: 'stops',
|
|
||||||
icon: 'vn:lines',
|
|
||||||
},
|
|
||||||
component: () => import('pages/Route/Roadmap/RoadmapStops.vue'),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
export default {
|
|
||||||
path: '/route/roadmap',
|
|
||||||
name: 'Roadmap',
|
|
||||||
meta: {
|
|
||||||
title: 'roadmap',
|
|
||||||
icon: 'vn:troncales',
|
|
||||||
moduleName: 'Roadmap',
|
|
||||||
},
|
|
||||||
component: RouterView,
|
|
||||||
redirect: { name: 'RoadmapMain' },
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: 'RoadmapMain',
|
|
||||||
path: '',
|
|
||||||
component: () => import('src/components/common/VnModule.vue'),
|
|
||||||
redirect: { name: 'RoadmapIndexMain' },
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: 'RoadmapIndexMain',
|
|
||||||
path: '',
|
|
||||||
redirect: { name: 'RoadmapList' },
|
|
||||||
component: () => import('src/pages/Route/RouteRoadmap.vue'),
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: 'RoadmapList',
|
|
||||||
path: 'list',
|
|
||||||
meta: {
|
|
||||||
title: 'roadmapList',
|
|
||||||
icon: 'view_list',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
roadmapCard,
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
|
@ -121,6 +121,45 @@ const agencyCard = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const roadmapCard = {
|
||||||
|
path: ':id',
|
||||||
|
name: 'RoadmapCard',
|
||||||
|
component: () => import('src/pages/Route/Roadmap/RoadmapCard.vue'),
|
||||||
|
redirect: { name: 'RoadmapSummary' },
|
||||||
|
meta: {
|
||||||
|
menu: ['RoadmapBasicData', 'RoadmapStops'],
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: 'RoadmapSummary',
|
||||||
|
path: 'summary',
|
||||||
|
meta: {
|
||||||
|
title: 'summary',
|
||||||
|
icon: 'open_in_new',
|
||||||
|
},
|
||||||
|
component: () => import('pages/Route/Roadmap/RoadmapSummary.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'RoadmapBasicData',
|
||||||
|
path: 'basic-data',
|
||||||
|
meta: {
|
||||||
|
title: 'basicData',
|
||||||
|
icon: 'vn:settings',
|
||||||
|
},
|
||||||
|
component: () => import('pages/Route/Roadmap/RoadmapBasicData.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'RoadmapStops',
|
||||||
|
path: 'stops',
|
||||||
|
meta: {
|
||||||
|
title: 'stops',
|
||||||
|
icon: 'vn:lines',
|
||||||
|
},
|
||||||
|
component: () => import('pages/Route/Roadmap/RoadmapStops.vue'),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Route',
|
name: 'Route',
|
||||||
path: '/route',
|
path: '/route',
|
||||||
|
@ -193,11 +232,23 @@ export default {
|
||||||
{
|
{
|
||||||
path: 'roadmap',
|
path: 'roadmap',
|
||||||
name: 'RouteRoadmap',
|
name: 'RouteRoadmap',
|
||||||
|
redirect: { name: 'RoadmapList' },
|
||||||
meta: {
|
meta: {
|
||||||
title: 'RouteRoadmap',
|
title: 'RouteRoadmap',
|
||||||
icon: 'vn:troncales',
|
icon: 'vn:troncales',
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Route/RouteRoadmap.vue'),
|
component: () => import('src/pages/Route/RouteRoadmap.vue'),
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: 'RoadmapList',
|
||||||
|
path: 'list',
|
||||||
|
meta: {
|
||||||
|
title: 'list',
|
||||||
|
icon: 'view_list',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
roadmapCard,
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'cmr',
|
path: 'cmr',
|
||||||
|
@ -210,7 +261,7 @@ export default {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'agency',
|
path: 'agency',
|
||||||
name: 'AgencyMain',
|
name: 'RouteAgency',
|
||||||
redirect: { name: 'AgencyList' },
|
redirect: { name: 'AgencyList' },
|
||||||
meta: {
|
meta: {
|
||||||
title: 'agency',
|
title: 'agency',
|
||||||
|
|
|
@ -12,7 +12,6 @@ import travel from './modules/travel';
|
||||||
import shelving from 'src/router/modules/shelving';
|
import shelving from 'src/router/modules/shelving';
|
||||||
import order from 'src/router/modules/order';
|
import order from 'src/router/modules/order';
|
||||||
import entry from 'src/router/modules/entry';
|
import entry from 'src/router/modules/entry';
|
||||||
import roadmap from 'src/router/modules/roadmap';
|
|
||||||
import zone from 'src/router/modules/zone';
|
import zone from 'src/router/modules/zone';
|
||||||
import account from './modules/account';
|
import account from './modules/account';
|
||||||
import monitor from 'src/router/modules/monitor';
|
import monitor from 'src/router/modules/monitor';
|
||||||
|
@ -81,7 +80,6 @@ const routes = [
|
||||||
route,
|
route,
|
||||||
supplier,
|
supplier,
|
||||||
travel,
|
travel,
|
||||||
roadmap,
|
|
||||||
entry,
|
entry,
|
||||||
zone,
|
zone,
|
||||||
account,
|
account,
|
||||||
|
|
|
@ -2,7 +2,7 @@ describe('AgencyWorkCenter', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/agency/11/workCenter`);
|
cy.visit(`/#/route/agency/11/workCenter`);
|
||||||
});
|
});
|
||||||
const createButton = '.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon';
|
const createButton = '.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon';
|
||||||
const workCenterCombobox = 'input[role="combobox"]';
|
const workCenterCombobox = 'input[role="combobox"]';
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
describe('RoadMap', () => {
|
describe('RoadMap', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1920, 1080);
|
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/route/roadmap`);
|
cy.visit(`/#/route/roadmap`);
|
||||||
});
|
});
|
||||||
it('Route list create roadmap and redirect', () => {
|
it('Route list create roadmap and redirect', () => {
|
||||||
cy.addBtnClick();
|
cy.addBtnClick();
|
||||||
cy.get('input[name="name"]').eq(1).type('roadMapTestOne{enter}');
|
cy.get('input[name="name"]').type('roadMapTestOne{enter}');
|
||||||
cy.get('.q-notification__message').should('have.text', 'Data created');
|
cy.get('.q-notification__message').should('have.text', 'Data created');
|
||||||
cy.url().should('include', '/summary');
|
cy.url().should('include', '/summary');
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue