From b03efbc9771b84dbb14d2e8ce0793b6c24f00ced Mon Sep 17 00:00:00 2001 From: provira Date: Fri, 27 Dec 2024 14:51:23 +0100 Subject: [PATCH 1/6] refactor: refs #8322 changed Worker component to use VnSection/VnCardBeta --- src/pages/Worker/Card/WorkerCard.vue | 18 +- src/pages/Worker/WorkerList.vue | 364 +++++++++++++------------ src/pages/Worker/locale/en.yml | 3 + src/pages/Worker/locale/es.yml | 5 +- src/router/modules/worker.js | 389 ++++++++++++++------------- 5 files changed, 401 insertions(+), 378 deletions(-) diff --git a/src/pages/Worker/Card/WorkerCard.vue b/src/pages/Worker/Card/WorkerCard.vue index d66bd2608..1ada15a33 100644 --- a/src/pages/Worker/Card/WorkerCard.vue +++ b/src/pages/Worker/Card/WorkerCard.vue @@ -1,21 +1,7 @@ diff --git a/src/pages/Worker/WorkerList.vue b/src/pages/Worker/WorkerList.vue index c2ddfcd20..6883a149f 100644 --- a/src/pages/Worker/WorkerList.vue +++ b/src/pages/Worker/WorkerList.vue @@ -2,7 +2,6 @@ import { onBeforeMount, computed, ref } from 'vue'; import { useI18n } from 'vue-i18n'; import { useSummaryDialog } from 'src/composables/useSummaryDialog'; -import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; import VnTable from 'src/components/VnTable/VnTable.vue'; import WorkerSummary from './Card/WorkerSummary.vue'; import VnRow from 'src/components/ui/VnRow.vue'; @@ -14,12 +13,11 @@ import VnLocation from 'src/components/common/VnLocation.vue'; import VnSelectDialog from 'src/components/common/VnSelectDialog.vue'; import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue'; import FetchData from 'src/components/FetchData.vue'; -import RightMenu from 'src/components/common/RightMenu.vue'; import WorkerFilter from './WorkerFilter.vue'; import { useState } from 'src/composables/useState'; import axios from 'axios'; import VnSelectWorker from 'src/components/common/VnSelectWorker.vue'; - +import VnSection from 'src/components/common/VnSection.vue'; const { t } = useI18n(); const tableRef = ref(); const { viewSummary } = useSummaryDialog(); @@ -31,6 +29,7 @@ const postcodesOptions = ref([]); const user = useState().getUser(); const defaultPayMethod = ref(); const bankEntitiesRef = ref(); +const dataKey = 'WorkerList'; const columns = computed(() => [ { align: 'left', @@ -170,11 +169,6 @@ async function autofillBic(worker) { } + \ No newline at end of file diff --git a/src/pages/Worker/WorkerList.vue b/src/pages/Worker/WorkerList.vue index 365ea94de..6883a149f 100644 --- a/src/pages/Worker/WorkerList.vue +++ b/src/pages/Worker/WorkerList.vue @@ -189,7 +189,7 @@ async function autofillBic(worker) {
diff --git a/src/pages/Worker/WorkerDepartment.vue b/src/pages/Worker/WorkerDepartment.vue index fe4c23051..67731a6cb 100644 --- a/src/pages/Worker/WorkerDepartment.vue +++ b/src/pages/Worker/WorkerDepartment.vue @@ -1,11 +1,16 @@ diff --git a/src/pages/Worker/WorkerDepartmentTree.vue b/src/pages/Worker/WorkerDepartmentTree.vue index f349b449d..9abf4e312 100644 --- a/src/pages/Worker/WorkerDepartmentTree.vue +++ b/src/pages/Worker/WorkerDepartmentTree.vue @@ -111,18 +111,16 @@ function handleEvent(type, event, node) { switch (type) { case 'path': state.set('TreeState', lastId); - node.id && router.push({ path: `/department/department/${node.id}/summary` }); + node.id && router.push({ path: `/worker/department/${node.id}/summary` }); break; case 'tab': state.set('TreeState', lastId); - node.id && - window.open(`#/department/department/${node.id}/summary`, '_blank'); + node.id && window.open(`#/worker/department/${node.id}/summary`, '_blank'); break; default: - node.id && - router.push({ path: `#/department/department/${node.id}/summary` }); + node.id && router.push({ path: `#/worker/department/${node.id}/summary` }); break; } } diff --git a/src/router/modules/department.js b/src/router/modules/department.js deleted file mode 100644 index 878abd4d3..000000000 --- a/src/router/modules/department.js +++ /dev/null @@ -1,55 +0,0 @@ -import { RouterView } from 'vue-router'; - -const departmentCard = { - name: 'DepartmentCard', - path: ':id', - component: () => import('src/pages/Department/Card/DepartmentCard.vue'), - redirect: { name: 'DepartmentSummary' }, - meta: { - menu: [ - 'DepartmentBasicData', - ] - }, - children: [ - { - path: 'summary', - name: 'DepartmentSummary', - meta: { - title: 'summary', - icon: 'launch', - }, - component: () => import('src/pages/Department/Card/DepartmentSummary.vue'), - }, - { - path: 'basic-data', - name: 'DepartmentBasicData', - meta: { - title: 'basicData', - icon: 'vn:settings', - }, - component: () => import('src/pages/Department/Card/DepartmentBasicData.vue'), - }, - ], -}; - -export default { - name: 'Department', - path: '/worker/department', - meta: { - title: 'department', - icon: 'vn:greuge', - moduleName: 'Department', - menu: [], - }, - component: RouterView, - redirect: { name: 'DepartmentMain' }, - children: [ - { - name: 'DepartmentMain', - path: '', - component: () => import('src/components/common/VnModule.vue'), - redirect: { name: 'DepartmentIndexMain' }, - children: [departmentCard], - }, - ], -}; \ No newline at end of file diff --git a/src/router/modules/index.js b/src/router/modules/index.js index f28fed1c2..a22d5399c 100644 --- a/src/router/modules/index.js +++ b/src/router/modules/index.js @@ -11,7 +11,6 @@ import Route from './route'; import Supplier from './supplier'; import Travel from './travel'; import Order from './order'; -import Department from './department'; import Entry from './entry'; import roadmap from './roadmap'; import Parking from './parking'; @@ -35,7 +34,6 @@ export default [ Travel, Order, invoiceIn, - Department, Entry, roadmap, Parking, diff --git a/src/router/modules/worker.js b/src/router/modules/worker.js index 9be470dd8..1895e230b 100644 --- a/src/router/modules/worker.js +++ b/src/router/modules/worker.js @@ -62,8 +62,7 @@ const workerCard = { title: 'notes', icon: 'vn:notes', }, - component: () => - import('src/pages/Worker/Card/WorkerNotes.vue'), + component: () => import('src/pages/Worker/Card/WorkerNotes.vue'), }, ], }, @@ -74,8 +73,7 @@ const workerCard = { title: 'timeControl', icon: 'access_time', }, - component: () => - import('src/pages/Worker/Card/WorkerTimeControl.vue'), + component: () => import('src/pages/Worker/Card/WorkerTimeControl.vue'), }, { name: 'WorkerCalendar', @@ -190,6 +188,36 @@ const workerCard = { ], }; +const departmentCard = { + name: 'DepartmentCard', + path: ':id', + component: () => import('src/pages/Department/Card/DepartmentCard.vue'), + redirect: { name: 'DepartmentSummary' }, + meta: { + menu: ['DepartmentBasicData'], + }, + children: [ + { + path: 'summary', + name: 'DepartmentSummary', + meta: { + title: 'summary', + icon: 'launch', + }, + component: () => import('src/pages/Department/Card/DepartmentSummary.vue'), + }, + { + path: 'basic-data', + name: 'DepartmentBasicData', + meta: { + title: 'basicData', + icon: 'vn:settings', + }, + component: () => import('src/pages/Department/Card/DepartmentBasicData.vue'), + }, + ], +}; + export default { name: 'Worker', path: '/worker', @@ -224,16 +252,21 @@ export default { }, }, workerCard, - ] + ], }, { path: 'department', - name: 'WorkerDepartment', - meta: { - title: 'department', - icon: 'vn:greuge', - }, + name: 'Department', + redirect: { name: 'WorkerDepartment' }, component: () => import('src/pages/Worker/WorkerDepartment.vue'), + children: [ + { + name: 'WorkerDepartment', + path: 'list', + meta: { title: 'department', icon: 'vn:greuge' }, + }, + departmentCard, + ], }, { path: 'create', diff --git a/src/router/routes.js b/src/router/routes.js index b9120f8c4..d84ba7e46 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -9,7 +9,6 @@ import invoiceIn from './modules/invoiceIn'; import wagon from './modules/wagon'; import supplier from './modules/supplier'; import travel from './modules/travel'; -import department from './modules/department'; import ItemType from './modules/itemType'; import shelving from 'src/router/modules/shelving'; import order from 'src/router/modules/order'; @@ -85,7 +84,6 @@ const routes = [ route, supplier, travel, - department, roadmap, entry, parking, From 5440d94df2e54e95555f1c846bc1b226a10c6049 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 7 Jan 2025 13:00:42 +0100 Subject: [PATCH 5/6] chore: refs #8322 unnecessary prop --- src/pages/Worker/WorkerList.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/Worker/WorkerList.vue b/src/pages/Worker/WorkerList.vue index 6883a149f..48393a8c7 100644 --- a/src/pages/Worker/WorkerList.vue +++ b/src/pages/Worker/WorkerList.vue @@ -193,7 +193,6 @@ async function autofillBic(worker) { :array-data-props="{ url: 'Workers/filter', order: ['id DESC'], - exprBuilder, }" >